Show empty tax rate column when tax is deleted instead of default#87672
Draft
Show empty tax rate column when tax is deleted instead of default#87672
Conversation
When tax is deleted via "Delete tax", taxCode is set to ''. Previously, getTaxName used || which treated '' as falsy and fell back to the default tax code, causing the tax rate column to show the default rate instead of being empty. Co-authored-by: Rory Abraham <roryabraham@users.noreply.github.com>
7 tasks
Contributor
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Contributor
|
🚧 @roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
Contributor
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
When tax is deleted from an expense via "Delete tax" (introduced in #84769),
taxCodeis set to''. However,getTaxName()used the||operator to fall back to the default tax code whentaxCodewas falsy, so'' || defaultTaxCodeevaluated to the workspace's default tax code. This caused the tax rate column to display the default rate instead of being empty.This PR adds an early return in
getTaxName()whentaxCodeis explicitly'', and switches the remaining fallback from||to??so that onlynull/undefinedtrigger the default — not an intentionally cleared empty string.Fixed Issues
$ #87667
PROPOSAL: #87667 (comment)
Tests
Offline tests
N/A - this is a display-only fix for how an already-saved transaction field is rendered.
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.Checks run
Screenshots/Videos
Android: Native
N/A - logic-only change
Android: mWeb Chrome
N/A - logic-only change
iOS: Native
N/A - logic-only change
iOS: mWeb Safari
N/A - logic-only change
MacOS: Chrome / Safari
N/A - logic-only change