-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Simplified Collect][Taxes] Tax editing and bulk actions #38208
[Simplified Collect][Taxes] Tax editing and bulk actions #38208
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. |
@@ -1871,6 +1871,12 @@ export default { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing es translations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asked for translations here.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const currentTaxRate = PolicyUtils.getTaxByID(policy, taxID); | ||
const {inputCallbackRef} = useAutoFocusInput(); | ||
|
||
const [name, setName] = useState(() => parser.htmlToMarkdown(currentTaxRate?.name ?? '')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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