Add gift card purchase prohibited expense toggle#87534
Conversation
Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
|
@mjasikowski 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] |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: The diff is too large to include in this comment (64KB), so I've created a gist for you: 📋 View the translation diff here 📋 Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c41346b1f
ℹ️ 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".
| case 'adultEntertainment': | ||
| return `intrattenimento per adulti`; | ||
| case 'hotelIncidentals': | ||
| case ‘hotelIncidentals’: |
There was a problem hiding this comment.
Use ASCII quotes in Italian prohibited expense switch
The new case label uses typographic quotes (‘hotelIncidentals’) instead of normal JavaScript string delimiters, which makes src/languages/it.ts invalid syntax and prevents the bundle from parsing this module at build/runtime. Because the translations files are imported as code (not data), this breaks app startup universally until the quotes are changed back to '...' (and the same issue on the added giftCard case should be corrected too).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This was already fixed in commit f02cee3. The remaining typographic quotes (e.g. dell'hotel) are pre-existing in the main branch for other entries and are not part of this PR's changes.
The original commit introduced Unicode smart quotes (U+2018/U+2019) in case statement string delimiters in it.ts, which are not valid JavaScript syntax. This caused Prettier and TypeScript check failures. Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
|
Fixed the failing Prettier and TypeScript checks. The original commit had Unicode smart quotes ( |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
@dangrous you'll need to do the author checklist here |
|
Sorry, Melv shouldn't have put this in review yet, we need some other bits and pieces first. |
|
52007 is waiting on https://github.com/Expensify/Web-Expensify/pull/52006 |
|
https://github.com/Expensify/Web-Expensify/pull/52007 is off hold, so this one should be progressing soon |
|
https://github.com/Expensify/Web-Expensify/pull/52474 is merged! not yet deployed but then we'll be in business here |
|
@MelvinBot please merge main, handle conflicts, and also update translations as necessary based on Polyglot Parrot's comment here - #87534 (comment) |
|
|
|
Try again please @MelvinBot - start just by merging main and resolving comments |
Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
|
|
| GAMBLING: 'gambling', | ||
| TOBACCO: 'tobacco', | ||
| ADULT_ENTERTAINMENT: 'adultEntertainment', | ||
| GIFT_CARD: 'giftCard', |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
giftCard was added to CONST.POLICY.PROHIBITED_EXPENSES but is missing from CONST.POLICY.DEFAULT_PROHIBITED_EXPENSES (line ~3909). Every other prohibited expense type (alcohol, hotelIncidentals, gambling, tobacco, adultEntertainment, handwrittenReceipt) has an entry in both objects. This omission causes PolicyUtils.ts (line ~809) to skip giftCard when checking whether prohibited expenses differ from defaults, meaning enabling the gift card toggle will not be detected as a non-default rule change.
Add giftCard: false to DEFAULT_PROHIBITED_EXPENSES:
DEFAULT_PROHIBITED_EXPENSES: {
alcohol: false,
hotelIncidentals: false,
gambling: true,
tobacco: false,
adultEntertainment: true,
giftCard: false,
handwrittenReceipt: false,
},Reviewed at: c202f99 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
Added giftCard: false to DEFAULT_PROHIBITED_EXPENSES in e885ca7.
Adds the missing giftCard: false entry to DEFAULT_PROHIBITED_EXPENSES so that enabling the gift card toggle is detected as a non-default rule change by PolicyUtils. Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
|
MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
|
@MelvinBot can you fix the typecheck? Unrelated but helpful |
The property was removed from TypeMenuSectionsParams but the test still passed it, causing a typecheck failure. Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
|
Fixed the typecheck failure: removed stale |
This property was removed from TypeMenuSectionsParams but the test still referenced it, causing a typecheck failure. Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
…com/Expensify/App into claude-addGiftCardProhibitedExpense Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
|
Fixed the failing typecheck: removed |
|
The ESLint check failure is unrelated to this PR. All 6 errors are in
This PR only changes: These are pre-existing lint errors on |
|
why are there suddenly so many unrelated things? ugh. |
|
The ESLint check failure is unrelated to this PR's changes. Evidence: This PR modifies files in
These are pre-existing lint errors on |
|
okay well @mjasikowski this is ready for review, eslint is unrelated and I'll merge it out at some point hopefully... |
|
@dangrous looks good! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @dangrous has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/dangrous in version: 9.3.73-0 🚀
Bundle Size Analysis (Sentry): |
|
Yes, help site changes are required. The PR adds a new "Gift card purchases" prohibited expense toggle, but the two help site articles listing prohibited expense categories don't include it. Draft PR created: #90425 Changes made:
|
|
🚀 Deployed to staging by https://github.com/dangrous in version: 9.3.73-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.73-4 🚀
|
Explanation of Change
Adds the
giftCardtoggle to the prohibited expenses UI in workspace rules settings.GIFT_CARDtoPROHIBITED_EXPENSESin CONSTgiftCardtoProhibitedExpensestypeFixed Issues
$ https://github.com/Expensify/Expensify/issues/621672
Tests
giftCardkeyOffline tests
N/A
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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari