-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: persist selection in room members page #59648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the same bug in other pages e.g. distance rates and ws members
@s77rt I updated the logics for: Group chat, WS Distance rate page and WS Members page. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemweb-chrome.moviOS: NativeJS bundle issue. NAB. iOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
Report fields and Multi level tags still not persisting the selection Screen.Recording.2025-04-08.at.6.01.43.PM.movScreen.Recording.2025-04-08.at.6.01.57.PM.mov |
@s77rt I updated. |
@daledah how is this looking? |
@mountiny Currently there's a difference in the selection data between screens, for example: RoomMembersPage uses
Which approach do you prefer in this case? |
I think that unifying the approach is better and we should also not use the edlint rule if not needed so sounds like using the Record and DRY hook is the way to go |
Thanks for the feedback, I'll update soon. |
Thank you for confirming, appreciate it! 🙇 |
@s77rt I updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is looking almost done just found 2 more bugs that we should handle first
@s77rt I updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thanks for improving this one
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@ChavdaSachin Thanks! @daledah Can you please raise a quick PR as this will hit staging soon diff --git a/src/pages/workspace/reportFields/WorkspaceReportFieldsPage.tsx b/src/pages/workspace/reportFields/WorkspaceReportFieldsPage.tsx
index 294ada570e3..229f8a7c373 100644
--- a/src/pages/workspace/reportFields/WorkspaceReportFieldsPage.tsx
+++ b/src/pages/workspace/reportFields/WorkspaceReportFieldsPage.tsx
@@ -154,8 +154,13 @@ function WorkspaceReportFieldsPage({
};
const toggleAllReportFields = () => {
- const availableReportFields = Object.values(selectionFieldList).filter((reportField) => reportField.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);
- setSelectedReportFields(selectedReportFields.length > 0 ? [] : Object.keys(availableReportFields));
+ setSelectedReportFields((prevSelectedReportFields) =>
+ prevSelectedReportFields.length > 0
+ ? []
+ : Object.entries(selectionFieldList)
+ .filter(([, reportField]) => reportField.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)
+ .map(([key]) => key),
+ );
};
const navigateToReportFieldsSettings = (reportField: ReportFieldForList) => { |
@s77rt Here's the followup PR |
🚀 Deployed to staging by https://github.com/mountiny in version: 9.1.40-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.1.40-7 🚀
|
setSelectedCategories({}); | ||
deleteWorkspaceCategories(policyId, selectedCategoriesArray); | ||
setSelectedCategories([]); | ||
deleteWorkspaceCategories(policyId, selectedCategories); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make sure that there are no null
values in selectedCategories
? We saw some cases where this was happening. I'm guessing it has to do with the logic on 160-170 above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we should cover this here too! @daledah Could you please take a look and make sure the category list only includes non-empty strings and no other types? thanks!
Explanation of Change
Fixed Issues
$ #59426
PROPOSAL: #59426 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2025-04-04.at.15.00.26.mov
Android: mWeb Chrome
Screen.Recording.2025-04-04.at.15.02.23.mov
iOS: Native
Screen.Recording.2025-04-04.at.15.03.50.mov
iOS: mWeb Safari
Screen.Recording.2025-04-04.at.15.04.45.mov
MacOS: Chrome / Safari
Screen.Recording.2025-04-04.at.15.05.32.mov
MacOS: Desktop
Screen.Recording.2025-04-04.at.15.05.59.mp4