Closed IuliiaHerets closed 23 hours ago
Triggered auto assignment to @adelekennedy (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@adelekennedy FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Edited by proposal-police: This proposal was edited at 2024-08-29 21:30:38 UTC.
Existing tags are restructured when custom tag name is 0 and adding 0: 0 as tag
We don't check when user add 0 as a custom tag name. It's a similar issue to this https://github.com/Expensify/App/issues/45016. The backend response is null
key
:
"policyTags_8FE3CA458B14BEF9"
onyxMethod
:
"merge"
value
:
[null]
0
:
null
We should stop user from adding 0 as a custom tag name. We can go for similar approach that we do here https://github.com/Expensify/App/blob/8c0386a562ac8ecdc0aa8e0496c8ed24971a5089/src/pages/workspace/tags/WorkspaceCreateTagPage.tsx#L48 We can throw error when user tries to enter 0 in custom tag. We can also add translations in en.ts and es.ts files for the error.
@adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
📣 @nihatuzlaci! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: senius.33@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~011416d6c42e4e4d8c
The account belongs to my partner and I have consent to hire him for the payments.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Adding "0" as a custom tag name restructuring the existing tags.
Adding "0" as a custom tag causes restructuring tag list.
We should add an if block to check adding "0" as a custom tag name and throw an error when the user tries to add it.
Allowed to save custom Tag name as 0.
We do not have any validation in place to check for custom tag name here, this is why we do not get any validation errors here
Like we do for regular tag names, we can add a validation for custom tag names as well:
So we have to update the code here to:
const validateTagName = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.POLICY_TAG_NAME_FORM>) => {
const errors: FormInputErrors<typeof ONYXKEYS.FORMS.POLICY_TAG_NAME_FORM> = {};
.
.
if (values[INPUT_IDS.POLICY_TAGS_NAME].trim() === '0'){
errors[INPUT_IDS.POLICY_TAGS_NAME] = translate('workspace.tags.invalidTagNameError');
}
.
.
.
return errors;
},
[translate, policyTags, route.params.orderWeight],
);
We can look at any other parts of the code where these changes are needed and also small improvements can be done during PR phase
Job added to Upwork: https://www.upwork.com/jobs/~021831485723893012269
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (External
)
Something else I see is that even after renaming the custom tag it still shows up as the old name
https://github.com/user-attachments/assets/1ce347d3-bd2b-46f3-a6ca-59ab3b309443
https://github.com/Expensify/App/issues/45016#issuecomment-2331356711 - I think this is getting a bit ridiculous with all these issues related to setting a tag name to 0. Asking to consolidate and close these out.
Done as part of https://github.com/Expensify/App/issues/45016
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v9.0.26-3 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Exp https://expensify.testrail.io/index.php?/tests/view/4902717 Email or phone of affected tester (no customers): applausetester+kh050806@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Nothing will happen to the existing tags.
Actual Result:
The existing tags are duplicated and restructured - one set falls under 0: 0 as multi tags, the other set is regular tag.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/704508e7-484d-430e-a4b3-fb5955f30e4f
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mananjadhav