You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$500] [Wave 6: Tags] - Unable to unselect tag from created expense when the tag is disabled #30380
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review
Version Number: 1.3.91-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Go to staging.new.expensify.com
As employee, create a workspace expense with a tag
As admin, go to OD and disable the tag created in Step 1
As employee, go to the workspace expense details page and refresh the page
Click on Tag
Expected Result:
User is able to unselect the tag
Actual Result:
User is unable to unselect the tag. It is disabled
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Tag - Unable to unselect tag from created expense when the tag is disabled[/-][+][$500] Tag - Unable to unselect tag from created expense when the tag is disabled[/+]on Oct 25, 2023
Please re-state the problem that we are trying to solve in this issue.
Unable to unselect a previously set tag after it has been disabled by an admin.
What is the root cause of that problem?
The OptionsSelector disables interaction for all tags that have been switched off by a workspace admin. Although this is appropriate behaviour for a tag that is not selected, we should still let the user remove the tag.
What changes do you think we should make in order to solve the problem?
We need to make an exception in the TagPicker component to allow an already selected tag to be removed regardless of its state. This way, the user can deselect it (while preventing it from being selected again).
We can read the value of the selectedOptions array in TagPicker to do this. For these tags, we ensure that they are enabled in the OptionsSelector.
What alternative solutions did you explore? (Optional)
What changes do you think we should make in order to solve the problem?
Because we use TagPicker in many places, so we should define the new props for TagPicker like shouldShowDisabledAndSelectedOption and just enable it in EditRequestTagPage
In TagPicker, if shouldShowDisabledAndSelectedOption is true, we can get the enabledTags by merging 2 arrays: selectedOptions and policyTagList (remove the duplicate option)
then pass enabledTags to getFilteredOptions function
What alternative solutions did you explore? (Optional)
In the case we're creating the new request and select the enabled tag. But at that time, admin disable this tag, we should clear the tag in the in-processing request
I will be OOO starting Monday, December 18, and will return Tuesday, January 2.
Current status:
We're waiting on an overall status from @tienifr / @robertKozik
Payment has not been issued
Regression steps have not been proposed (if applicable)
If this issue is open when I'm back from OOO, I'll take it back over. Thank you!
Hey! PR for this issue caused one regression which was handled as different task by the time of merge (here but overally the issue should be resolved already.
As for the regression steps, I think we can propose them here:
As employee, create a workspace expense with a tag
As admin, go to OD and disable the tag created in Step 1
As employee, go to the workspace expense details page and refresh the page
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review
Activity
[-]Tag - Unable to unselect tag from created expense when the tag is disabled[/-][+][$500] Tag - Unable to unselect tag from created expense when the tag is disabled[/+]melvin-bot commentedon Oct 25, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01dfd87fd1cc34a215
melvin-bot commentedon Oct 25, 2023
Triggered auto assignment to @johncschuster (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 25, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 25, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @robertKozik (
External)GItGudRatio commentedon Oct 25, 2023
Weirdly enough, while trying to re create this issue, the tag itself disappears completely for me. It's not present in the list at all
Samueljh1 commentedon Oct 25, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Unable to unselect a previously set tag after it has been disabled by an admin.
What is the root cause of that problem?
The
OptionsSelectordisables interaction for all tags that have been switched off by a workspace admin. Although this is appropriate behaviour for a tag that is not selected, we should still let the user remove the tag.What changes do you think we should make in order to solve the problem?
We need to make an exception in the
TagPickercomponent to allow an already selected tag to be removed regardless of its state. This way, the user can deselect it (while preventing it from being selected again).We can read the value of the
selectedOptionsarray inTagPickerto do this. For these tags, we ensure that they are enabled in theOptionsSelector.What alternative solutions did you explore? (Optional)
N/A
tienifr commentedon Oct 26, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Tag - Unable to unselect tag from created expense when the tag is disabled
What is the root cause of that problem?
When the tag is disabled, we don't show it in option list
App/src/libs/OptionsListUtils.js
Line 937 in 05ae4c4
What changes do you think we should make in order to solve the problem?
Because we use
TagPickerin many places, so we should define the new props forTagPickerlikeshouldShowDisabledAndSelectedOptionand just enable it inEditRequestTagPageIn TagPicker, if
shouldShowDisabledAndSelectedOptionis true, we can get theenabledTagsby merging 2 arrays: selectedOptions and policyTagList (remove the duplicate option)Here's the sample code:
then pass
enabledTagstogetFilteredOptionsfunctionWhat alternative solutions did you explore? (Optional)
In the case we're creating the new request and select the enabled tag. But at that time, admin disable this tag, we should clear the tag in the in-processing request
Result
Screen.Recording.2023-10-26.at.11.39.13.mov
DylanDylann commentedon Oct 26, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
If we disable selected tag, this tag will hide in Tag list
What is the root cause of that problem?
Let's see the logic to get tags
App/src/libs/OptionsListUtils.js
Line 893 in 69119aa
If numberOfTag < 8, we return all enable tags (only enable tags)
What changes do you think we should make in order to solve the problem?
we should move this code
App/src/libs/OptionsListUtils.js
Lines 915 to 933 in 69119aa
to before
App/src/libs/OptionsListUtils.js
Line 893 in 69119aa
and in here
App/src/libs/OptionsListUtils.js
Line 899 in 69119aa
update to
to avoid dupe the selected tag.
With this approach we also need to update
App/src/components/TagPicker/index.js
Line 39 in cd851f5
like we did in CategoryPicker
What alternative solutions did you explore? (Optional)
28 remaining items
melvin-bot commentedon Dec 15, 2023
Triggered auto assignment to @slafortune (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.johncschuster commentedon Dec 15, 2023
I will be OOO starting Monday, December 18, and will return Tuesday, January 2.
Current status:
We're waiting on an overall status from @tienifr / @robertKozik
Payment has not been issued
Regression steps have not been proposed (if applicable)
If this issue is open when I'm back from OOO, I'll take it back over. Thank you!
robertKozik commentedon Dec 18, 2023
Hey! PR for this issue caused one regression which was handled as different task by the time of merge (here but overally the issue should be resolved already.
As for the regression steps, I think we can propose them here:
slafortune commentedon Dec 18, 2023
Thanks for the update!
Test GH created - https://github.com/Expensify/Expensify/issues/351737
Paid @tienifr
@robertKozik part of Software Mansion