[No QA] Add eslint rule to limit usage of SelectionListWithSections#77737
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@zfurtak Looks good, do we have the docs on how to use the new pattern? |
|
I wasn't sure where to add this, wdyt? 🤔 |
|
I think we can do it in contributingGuides like https://github.com/Expensify/App/blob/main/contributingGuides/FORMS.md |
| @@ -1,5 +1,6 @@ | |||
| import {Str} from 'expensify-common'; | |||
| import React, {useCallback, useMemo, useState} from 'react'; | |||
| // eslint-disable-next-line no-restricted-imports | |||
There was a problem hiding this comment.
are all the disable lines files left to migrate ?
There was a problem hiding this comment.
Almost all of them are awaiting the new component for SelectionList with sectioned data
| }, | ||
| { | ||
| name: './SelectionListWithSections', | ||
| message: 'Use `SelectionList` for flat data. Only use `SelectionListWithSection` when data is actually sectioned.', |
There was a problem hiding this comment.
is there a more descriptive way to describe sections vs not
There was a problem hiding this comment.
I will add more detailed description in docs and put a reference here
|
@dukenv0307 I added the doc 👍 |
grgia
left a comment
There was a problem hiding this comment.
the doc update / eslint comment is great. LGTM
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.2.85-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.2.85-7 🚀
|
Explanation of Change
After introducing new
SelectionListcomponent designed for usages with 1 section of data, I noticed that people are still using the old one (now calledSelectionListWithSections).In this PR I creating a restricted import for
SelectionListWithSectionsto ensure that people use it only when it's actually needed.Fixed Issues
$ #77742
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari