Skip to content
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

[LOW] Tags: Support independent, multi-level tags on workspace requests #32828

Closed
puneetlath opened this issue Dec 11, 2023 · 17 comments
Closed
Assignees
Labels
NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2

Comments

@puneetlath
Copy link
Contributor

puneetlath commented Dec 11, 2023

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.

Issue OwnerCurrent Issue Owner: @yuwenmemon
@puneetlath puneetlath added Daily KSv2 NewFeature Something to build that is a new item. labels Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Dec 11, 2023
@yuwenmemon
Copy link
Contributor

I think this will be relatively simple, we already import all levels of tags into NewDot when you have them turned on:
Screenshot 2023-12-18 at 7 48 43 PM

cc @amyevans in case you can think of any gotchas that might be out there.

@yuwenmemon
Copy link
Contributor

yuwenmemon commented Dec 19, 2023

Onyx updates from auth and PHP are already supported as well.

@yuwenmemon
Copy link
Contributor

yuwenmemon commented 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} 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.

Screenshot 2023-12-18 at 8 48 35 PM

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:
Screenshot 2023-12-18 at 9 12 48 PM

@yuwenmemon
Copy link
Contributor

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

@yuwenmemon
Copy link
Contributor

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
Copy link
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!

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!

@yuwenmemon
Copy link
Contributor

Discussion about the route here: https://expensify.slack.com/archives/C01GTK53T8Q/p1703100843219419

Seems like we're leaning towards using an index-based route. Going to create an issue to fix the renaming bug with policyRecentlyUsedTags_ and work on it, as that's a pre-existing bug that's a prerequisite to this feature anyway.

@yuwenmemon yuwenmemon added Daily KSv2 and removed Weekly KSv2 labels Dec 21, 2023
@melvin-bot melvin-bot bot added the Overdue label Dec 25, 2023
Copy link

melvin-bot bot commented Dec 26, 2023

@garrettmknight, @yuwenmemon Huh... This is 4 days overdue. Who can take care of this?

@garrettmknight
Copy link
Contributor

Yuwen's out till 1/3

@yuwenmemon
Copy link
Contributor

yuwenmemon commented Jan 5, 2024

Created the front-end issue above and tagged @rezkiy37 and @waterim - are either of you two interested in working on this? It's an extension of the tags feature you helped plan/build before.

@melvin-bot melvin-bot bot removed the Overdue label Jan 5, 2024
@rezkiy37
Copy link
Contributor

rezkiy37 commented Jan 8, 2024

Sounds interesting, I would like to work on the issue. Posting a comment...

@melvin-bot melvin-bot bot added the Overdue label Jan 13, 2024
@yuwenmemon
Copy link
Contributor

@rezkiy37 asked a few questions in the issue linked above - answered them coming back from OOO

@melvin-bot melvin-bot bot removed the Overdue label Jan 16, 2024
@greg-schroeder
Copy link
Contributor

Where do we stand on this one? Are you still taking this @rezkiy37?

@rezkiy37
Copy link
Contributor

Where do we stand on this one? Are you still taking this @rezkiy37?

I am actively working on this sub-issue: #33983.

@greg-schroeder greg-schroeder changed the title [Wave 6: Tags] Support independent, multi-level tags on workspace requests [HIGH] Tags: Support independent, multi-level tags on workspace requests Jan 31, 2024
@melvin-bot melvin-bot bot added the Overdue label Feb 2, 2024
@puneetlath puneetlath changed the title [HIGH] Tags: Support independent, multi-level tags on workspace requests Tags: Support independent, multi-level tags on workspace requests Feb 6, 2024
@yuwenmemon
Copy link
Contributor

@rezkiy37's PR is awaiting further review from @allroundexperts

@melvin-bot melvin-bot bot removed the Overdue label Feb 7, 2024
@yuwenmemon yuwenmemon added the Reviewing Has a PR in review label Feb 9, 2024
@greg-schroeder greg-schroeder changed the title Tags: Support independent, multi-level tags on workspace requests [LOW] Tags: Support independent, multi-level tags on workspace requests Feb 20, 2024
@yuwenmemon
Copy link
Contributor

This is done. One follow up bug to fix here: #37054

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

6 participants