[Bulk workspace edits] Add Copy Policy Settings Double-check confirmation page (step 3 of 3)#91241
Conversation
…election page to use them
… and navigation for policy copying
…cySettings pages using useEffect
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Refactor the selection logic to account for items that are effectively disabled, including those with a disabled checkbox. This ensures that only selectable items are added to the selected options and properly updates the disabled indexes.
…ySettingsSelectFeaturesPage Updated the visibility and selection logic for features, ensuring that accounting compatibility is properly checked. Introduced a new method for handling accounting mismatch explanations and streamlined the alternate text retrieval for disabled features. This improves the user experience by providing clearer feedback on feature availability.
…bled features When a feature row is disabled due to incompatible accounting connections between source and target workspaces, display an explanatory alternate text instead of the normal feature summary.
Precomputes eligible target policy IDs via useMemo so the per-item menu render does a constant-time check instead of iterating all policies. Hides the menu entry entirely when there are no valid targets for the source workspace.
Introduced a new test suite for the BaseSelectionList component to validate the selection logic, specifically focusing on how disabled and selected items are handled in the allSelected calculation. The tests cover scenarios for fully selected, partially selected, and unselected states, ensuring accurate checkbox states reflect the selection status of items.
Introduced new utility functions to validate accounting connection compatibility between source and target policies. Updated the CopyPolicySettingsSelectFeaturesPage to utilize these functions for improved feature visibility and selection logic. Added unit tests to ensure the correctness of the new compatibility checks.
Updated the translation files for multiple languages to enhance the structure of the copy policy settings section. Introduced nested objects for select workspaces, select settings, and confirmation settings, providing clearer organization and descriptions for each step in the settings copying process. This change aims to improve user experience by making the interface more intuitive and user-friendly.
…ency Refined the user interface for the copy policy settings pages by updating text labels and prompts to align with the new translation structure. This includes changes to the confirmation and selection pages, enhancing the overall user experience and ensuring consistency across the settings workflow.
…ing in CopyPolicySettingsConfirmPage
…target change Stale parts from a previous target set could remain in selectedFeatures and incorrectly flip isAccountingSelected (force-locking coding parts) even when the accounting row was itself disabled by Rule A. Extract isPartIncompatible (Rule A for accounting, Rule B for coding parts) and filter it out of selectedAvailableFeatures so the effective selection always reflects what's actually selectable for the current targets.
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-06-01.at.6.49.56.PM.movScreen.Recording.2026-06-01.at.11.56.01.PM.movScreen.Recording.2026-06-01.at.6.49.17.PM.mov |
|
@yuwenmemon looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
🚧 @yuwenmemon has triggered a test Expensify/App build. You can view the workflow run here. |
|
Ah, crap, I didn't see that ESLint and TypeScript checks were failing. Since this was my boo boo I'll make a follow-up PR to fix. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
I think all tests already passed. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
Ah yep @fedirjh you are correct |
|
🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.3.91-0 🚀
Bundle Size Analysis (Sentry): |
|
Deploy Blocker #92329 was identified to be related to this PR. |
|
Deploy Blocker #92332 was identified to be related to this PR. |
|
Deploy Blocker #92397 was identified to be related to this PR. |
|
🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.3.94-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.94-0 🚀
|
Explanation of Change
This PR implements the Page 3 (Double-check confirmation step) of the "Bulk Workspace Edits" feature as outlined in Issue #88672.
Key changes:
FEATURE_ROWSout ofCopyPolicySettingsSelectFeaturesPage.tsxand centralized it insrc/libs/CopyPolicySettingsUtils.ts, exporting it so it can be cleanly reused by both pages.CopyPolicySettingsConfirmPage.tsx): Created the confirm screen showing a descriptive header/subheader, a "Configuration" list of translated, selected features to copy (pointing back to feature selection page), and a "Workspaces" list of selected target workspaces (pointing back to workspace selection page). Clicking the success button callscopyPolicySettingsand dismisses the modal flow.showConfirmModalalert on "Copy configuration" button press if workflows are selected without members to copy.useEffectsynchronizers in bothCopyPolicySettingsSelectWorkspacesPage.tsxandCopyPolicySettingsSelectFeaturesPage.tsxconnected toONYXKEYS.COPY_POLICY_SETTINGS. This ensures selecting features/workspaces pre-populates properly when the user navigates backwards or forwards.Fixed Issues
$ #88672
PROPOSAL: Internal
Tests
Setup
Test 1 — Step 1 → 2 → 3 happy path
Profile, Members). Long lists must wrap onto multiple lines (no truncation).Test 2 — Edit features from confirm
Test 3 — Edit workspaces from confirm (re-validates features)
"You can only copy {part} if all workspaces use the same accounting system and company connection."
categories,tags,reports,taxes, oraccountingitself) are silently dropped — they should not appear as ticked, and tapping Next must not surface them on the Confirm step.Test 4 — Closing the RHP discards the in-progress flow
Test 5 — Workflows-without-members warning
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
Made with Cursor