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
[LOW] Tags: Support independent, multi-level tags on workspace requests #32828
It is possible for Collect policies to be configured to have independent multi-level tags if they are connected to QBO. As such, let's add support for creating/editing requests with independent multi-level tags.
I'm guessing there will need to be both front-end and back-end components to this, but I'll leave it to @yuwenmemon to figure out the details.
Yeah, it will be mostly if not exclusively changes in the front-end. Mostly around turning our current code, which assumes a single tag list, to juggle the potential for multiple tags.
For instance, one thing to consider will be how to manage routes. The current setup is agnostic to any sort of "level" - we just show ${iouType}/new/tag/${reportID} or create/${iouType}/tag/${transactionID}/${reportID}/ or r/:threadReportID/edit/:field. We'll need to reconfigure this to factor in the index of a tag (or maybe the tag name, not sure which would be better 🤔), so we can edit the tag properly on the expense as well as show the correct tag list.
For saving tags on an Expense, we can do what we do in OldDot, which is delimit them using colons: "Ops:Asia:Project 3". Our API assumes this format anyway.
The policyRecentlyUsedTags_ collections are already keyed by the name of the tag level. However, there's a bug because we're using the tag name to key the recently used tags list. If you change the tag name, it will think it's a new tag entirely:
One backend change we'll need to make is to start sending the tag level in the MODIFIEDEXPENSE system message. Right now it ignores tag level, and we just assume the tag name is the first tag in the tagLists
I'll post some questions in the #wave6 room in the morning but so far this looks like it could be 3 GHs, with the main front-end one being able to be worked on by a Contributor.
one thing to consider will be how to manage routes
Yeah this was the biggest "gotcha" we saw going into the initial tags implementation in NewDot. We initially wrote in the doc that we'd use the tag list name in the route, "slug-ifying" the name (spaces to dashes, lowercase all letters, etc), and then decided to punt that to be a future problem (now 😄). Your idea of using the index is interesting though, could definitely side step some of the edge cases I was dreaming up with weird tag list names!
changed the title [-][Wave 6: Tags] Support independent, multi-level tags on workspace requests[/-][+][HIGH] Tags: Support independent, multi-level tags on workspace requests[/+]on Jan 31, 2024
changed the title [-][HIGH] Tags: Support independent, multi-level tags on workspace requests[/-][+]Tags: Support independent, multi-level tags on workspace requests[/+]on Feb 6, 2024
changed the title [-]Tags: Support independent, multi-level tags on workspace requests[/-][+][LOW] Tags: Support independent, multi-level tags on workspace requests[/+]on Feb 20, 2024
Activity
melvin-bot commentedon Dec 11, 2023
Triggered auto assignment to @garrettmknight (
NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details.yuwenmemon commentedon Dec 19, 2023
I think this will be relatively simple, we already import all levels of tags into NewDot when you have them turned on:

cc @amyevans in case you can think of any gotchas that might be out there.
yuwenmemon commentedon Dec 19, 2023
Onyx updates from auth and PHP are already supported as well.
yuwenmemon commentedon Dec 19, 2023
Yeah, it will be mostly if not exclusively changes in the front-end. Mostly around turning our current code, which assumes a single tag list, to juggle the potential for multiple tags.
For instance, one thing to consider will be how to manage routes. The current setup is agnostic to any sort of "level" - we just show
${iouType}/new/tag/${reportID}orcreate/${iouType}/tag/${transactionID}/${reportID}/orr/:threadReportID/edit/:field. We'll need to reconfigure this to factor in the index of a tag (or maybe the tag name, not sure which would be better 🤔), so we can edit the tag properly on the expense as well as show the correct tag list.For saving tags on an Expense, we can do what we do in OldDot, which is delimit them using colons:
"Ops:Asia:Project 3". Our API assumes this format anyway.The

policyRecentlyUsedTags_collections are already keyed by the name of the tag level. However, there's a bug because we're using the tag name to key the recently used tags list. If you change the tag name, it will think it's a new tag entirely:yuwenmemon commentedon Dec 19, 2023
One backend change we'll need to make is to start sending the tag level in the
MODIFIEDEXPENSEsystem message. Right now it ignores tag level, and we just assume the tag name is the first tag in thetagListsyuwenmemon commentedon Dec 19, 2023
I'll post some questions in the #wave6 room in the morning but so far this looks like it could be 3 GHs, with the main front-end one being able to be worked on by a Contributor.
amyevans commentedon Dec 19, 2023
Yeah this was the biggest "gotcha" we saw going into the initial tags implementation in NewDot. We initially wrote in the doc that we'd use the tag list name in the route, "slug-ifying" the name (spaces to dashes, lowercase all letters, etc), and then decided to punt that to be a future problem (now 😄). Your idea of using the index is interesting though, could definitely side step some of the edge cases I was dreaming up with weird tag list names!
Being careful around the splitting on colon and edge cases with that is another potential gotcha (for example this code probably needs to be ported to NewDot: https://github.com/Expensify/Web-Expensify/blob/main/site/lib/expenseUtils.jsx#L10-L39).
But yeah overall I agree the lift isn't too bad here really!
16 remaining items
greg-schroeder commentedon Jan 24, 2024
Where do we stand on this one? Are you still taking this @rezkiy37?
rezkiy37 commentedon Jan 24, 2024
I am actively working on this sub-issue: #33983.
[-][Wave 6: Tags] Support independent, multi-level tags on workspace requests[/-][+][HIGH] Tags: Support independent, multi-level tags on workspace requests[/+][-][HIGH] Tags: Support independent, multi-level tags on workspace requests[/-][+]Tags: Support independent, multi-level tags on workspace requests[/+]yuwenmemon commentedon Feb 7, 2024
@rezkiy37's PR is awaiting further review from @allroundexperts
[-]Tags: Support independent, multi-level tags on workspace requests[/-][+][LOW] Tags: Support independent, multi-level tags on workspace requests[/+]yuwenmemon commentedon Feb 28, 2024
This is done. One follow up bug to fix here: #37054