Fix card admin card flows#93478
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
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 |
|
@arosiclair 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ab41f3031
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
| const policyID = policy?.id; | ||
| const areExpensifyCardsEnabled = policy?.areExpensifyCardsEnabled; | ||
| const canUseLearnMore = areExpensifyCardsEnabled ? canWriteCompanyCards : canWriteMoreFeatures; | ||
| const handleReadOnlyAction = areExpensifyCardsEnabled ? onReadOnlyAction : showMoreFeaturesReadOnlyModal; |
There was a problem hiding this comment.
Aren't both methods the same?
Also, earlier we decided to use
const canUseLearnMore = areExpensifyCardsEnabled && canWriteCompanyCards;any issue with that?
There was a problem hiding this comment.
Also, earlier we decided to use
const canUseLearnMore = areExpensifyCardsEnabled && canWriteCompanyCards;
any issue with that?
areExpensifyCardsEnabled && canWriteCompanyCards -> false && true will give false.
So when Expensify Card is not enabled yet, nobody can use Learn more, even a workspace admin who has permission to enable it.
There was a problem hiding this comment.
Aren't both methods the same?
Yes, updated
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
Oops, I forgot to fill the checklist. Thanks! |
|
CP requested! |
|
🚧 @flodnv has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Fix card admin card flows (cherry picked from commit 4f6abad) (cherry-picked to staging by puneetlath)
|
🚀 Cherry-picked to staging by https://github.com/puneetlath in version: 9.4.7-2 🚀
|
|
🤖 No help site changes required. I reviewed the changes in this PR against the help articles under Why: This PR is a set of permission-gating bug fixes for card admins in the workspace card flows — it restricts actions that shouldn't have been available to that sub-role, rather than adding or changing any documented, user-facing workflow:
What I checked: The relevant help articles ( Since no documentation changes are required, I did not create a draft help site PR. @ShridharGoel, please confirm this assessment matches the intended behavior. If you believe a help article should be updated to call out these card-admin permission requirements, let me know and I'll draft a help site PR. |
|
v9.4.7-4 The other steps are passed card.admin.mp4 |
|
That will be a backend fix, removed those last 2 steps. |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.7-4 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/puneetlath in version: 9.4.8-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 I reviewed the changes in this PR against the help site files under Why: This PR is a permission-gating bug fix. It restricts a narrower "card admin" role (a member granted Expensify Card write access but not More features or Members write access) from:
None of these behaviors are documented in the help site:
Since this only corrects who can perform existing actions — and doesn't add, remove, or rename any user-facing feature documented on the help site — no draft PR was created. @ShridharGoel, if you believe a help article should still be updated (for example, to document the granular card admin permission model), let me know and I'll draft the PR. |
|
🚀 Cherry-picked to staging by https://github.com/puneetlath in version: 9.4.8-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.8-3 🚀
|
Explanation of Change
This fixes a few card admin permission gaps in workspace card flows.
Card admins can no longer enable Expensify Card from the Company cards banner unless they can edit More features. The Expensify Card detail page no longer shows Edit spend rules when Rules are disabled. The issue card flow no longer offers card admins the option to invite a non-member.
Fixed Issues
$ #93508, #93506, #93501
PROPOSAL:
Tests
Offline tests
QA Steps
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
MacOS: Chrome / Safari
Screen.Recording.2026-06-13.at.2.19.54.PM.mov