[Simplified Collect][Taxes] Tax editing and bulk actions#38208
[Simplified Collect][Taxes] Tax editing and bulk actions#38208luacmartins merged 40 commits intoExpensify:mainfrom
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
@kosmydel It seems there are no blockers anymore. Please continue to process this PR |
|
I should be able to prepare this PR for review tomorrow. |
| valuePercentageRange: 'Please enter a valid percentage between 0 and 100.', | ||
| genericFailureMessage: 'An error occurred while updating the tax rate, please try again.', | ||
| }, | ||
| deleteTaxConfirmation: 'Are you sure you want to delete this tax?', |
There was a problem hiding this comment.
missing es translations?
|
@luacmartins LGTM! |
|
Conflicts resolved, please test it one more time @DylanDylann, thanks! |
|
Look good |
|
@luacmartins looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.4.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.56-8 🚀
|
| WORKSPACE_TAX_EDIT: { | ||
| route: 'settings/workspaces/:policyID/tax/:taxID', | ||
| getRoute: (policyID: string, taxID: string) => `settings/workspaces/${policyID}/tax/${encodeURI(taxID)}` as const, | ||
| }, |
There was a problem hiding this comment.
We should have used encodeURIComponent instead of encodeURI since taxID is not a uri. Also we should have added a decode step (similar to other logic e.g. tag).
encodeURI does not encode all special chars e.g. / which caused this bug #39614
| const goBack = useCallback(() => Navigation.goBack(ROUTES.WORKSPACE_TAX_EDIT.getRoute(policyID ?? '', taxID)), [policyID, taxID]); | ||
|
|
||
| const submit = () => { | ||
| renamePolicyTax(policyID, taxID, name); |
There was a problem hiding this comment.
Coming from #42556 , we should disallow renaming the tax name if there is no change. Otherwise, BE would consider that we are updating the tax name with an already existing name and generate an error response (duplicate error) which causes unnecessary confusion to the user.
| * Whether the tax rate can be deleted and disabled | ||
| */ | ||
| function canEditTaxRate(policy: Policy, taxID: string): boolean { | ||
| return policy.taxRates?.defaultExternalID !== taxID; |
| const currentTaxRate = PolicyUtils.getTaxByID(policy, taxID); | ||
| const {inputCallbackRef} = useAutoFocusInput(); | ||
|
|
||
| const [name, setName] = useState(() => parser.htmlToMarkdown(currentTaxRate?.name ?? '')); |
There was a problem hiding this comment.
We don't support markdown for tax names, removed this in #54565

Details
Fixed Issues
$ #37794
$ #37795
$ #37796
$ #37797
It also fixes:
$ #38499
PROPOSAL: N/A
Tests
Offline tests
QA Steps
Tests from the above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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.mov
Android: mWeb Chrome
mwebandroid.mov
iOS: Native
ios.mp4
iOS: mWeb Safari
mwebios.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov