Repository navigation
Hide Approve-only role during card assignment member invites - #107714
ShridharGoel wants to merge 5 commits into
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@Pujan92 is the reviewer for this follow-up |
JmillsExpensify
left a comment
There was a problem hiding this comment.
LGTM, previously discussed
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb Safari |
|
@ShridharGoel let's fix the conflicts |
|
Done |
| }); | ||
| const backPath = useDynamicBackPath(DYNAMIC_ROUTES.WORKSPACE_INVITE_MESSAGE_ROLE.path); | ||
| const openerScreenName = previousRouteName ?? getRouteNameFromPath(backPath); | ||
| // Cardholders must be able to create expenses, so card invite flows hide roles without that permission. |
There was a problem hiding this comment.
❌ CONSISTENCY-18 (docs)
The opener screen is resolved by two different mechanisms chained with ??: first the previous route in the navigation stack (previousRouteName), then by parsing the back path (getRouteNameFromPath(backPath)). Why a second resolution path is needed is not recoverable from the code: it exists so the card-invite flow is still detected when the page is deep-linked directly and no opener screen is present in the navigation stack (this intent only surfaces in the test file's "deep-linked directly" case). The existing comment on the next line explains why roles are hidden, not why the fallback exists.
Add a short comment explaining the fallback, e.g.:
// The opener is usually the previous route in the stack, but on a direct deep link there is no opener there,
// so fall back to parsing the back path to recognize the card invite flow.
const openerScreenName = previousRouteName ?? getRouteNameFromPath(backPath);Reviewed at: 560e0df | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
There was a problem hiding this comment.
The explicit query parameter is a cleaner approach: it lets both pages use the same isInviteNewMemberStep signal instead of inferring the flow from navigation history.
Include the route builder/query metadata, screen parameter type, navigation call, and updated tests. Keep useDynamicBackPath for back navigation. Also decide how existing card-invite deep links without the flag should behave—the current implementation supports those.
…o hide-approve-only-card-invite
|
Updated |
Explanation of Change
Prevent users from selecting the Approve-only role when inviting a new member during the company card assignment or Expensify Card issuance flow. Cardholders must be able to create expenses, and assigning a card to an Approve-only member causes card assignment to fail.
Fixed Issues
$ #106892
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2026-11-23.at.6.11.39.PM.mov