Add customUnitRateOutOfDateRange violation for date-bound mileage rates#93555
Conversation
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
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 |
…king submit Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbb254f893
ℹ️ 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".
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73d4a526b8
ℹ️ 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".
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa7a0a699b
ℹ️ 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".
| const formattedStartDate = formatViolationDate(startDate); | ||
| const formattedEndDate = formatViolationDate(endDate); | ||
| if (formattedStartDate && formattedEndDate) { | ||
| return translate('violations.customUnitRateOutOfDateRange', {startDate: formattedStartDate, endDate: formattedEndDate}); |
There was a problem hiding this comment.
Add the new violation strings to every locale
When the user’s locale is anything other than English and this new out-of-date rate violation is rendered, translate('violations.customUnitRateOutOfDateRange', ...) has no matching key in the generated locale files (checked es/fr/de/it/nl/pl/pt-BR/ja/zh-hans). Localize.translate does not fall back to English for missing keys, so this path logs/throws in development and shows the key or missing-translation text in production instead of the rate message. Please add the three new customUnitRateOutOfDateRange* entries to the non-English locale files as well.
Useful? React with 👍 / 👎.
Explanation of Change
Fixed Issues
$ #89837
PROPOSAL:
Tests
Setup
$0.67/mi, valid Jan 1 – Dec 31, 2025$0.70/mi, valid Jan 1 – Dec 31, 20261. Primary — out-of-range rate on confirmation
Rate is only valid from Jan 1, 2025 to Dec 31, 20252. Fix by changing date
3. Fix by changing rate
4. Date change auto-selects eligible rate (no error)
5. Manually override auto-selected rate
6. Message variants
Repeat test 1 with rates that have only one bound:
Rate is only valid from Jan 1, 2025Rate is only valid until Dec 31, 2025Rate is only valid from … to …7.
invalidRatevs out-of-date (don’t mix them up)Rate is not valid(iou.error.invalidRate), not the date-range message.8. P2P / personal distance (no date-range violation)
customUnitRateOutOfDateRangeerror (P2P uses fake rate ID).9. Track expense flow
10. Post-save violation (edit existing expense)
MoneyRequestView)Offline tests
QA Steps
Same as tests
Verify that no errors appear in the JS console
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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