-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2023-09-21] [Wave 6: Categories] CRITICAL - Create Category MenuItem and CategoryPicker component #24463
Comments
Triggered auto assignment to @joekaufmanexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to @Christinadobrzyn ( |
Triggered auto assignment to Design team member for new feature review - @shawnborton ( |
Hi, I'm Michael (Mykhailo) from Callstack and I would like to work in this issue. |
Hello, Im Artem from Callstack and I would like to take this issue as well. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
Already working on a fix. |
The PR already reviewing internally, public review gonna be soon. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.69-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-09-21. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue: As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
@puneetlath can we close this? |
I need to pay out the C+ that were involved. I'll do that tomorrow and then we can close. |
Ok so it looks like we had three PRs here:
Does that all seem right? If so the payment summary would be:
All to be paid out via Upwork. |
@puneetlath I think @situchan and I both had our PR reviews from before the compensation was updated (Aug 30), so I wonder if it should be $1000 instead? |
From #27509 (comment), seems like it's still applied to PRs created before announcement |
Looks like you're right. I'll update that. Thanks for letting me know. |
@puneetlath Offer accepted, thanks! |
@situchan and @jjcoffee have been paid. Now just waiting for @abdulrahuman5196 to accept the contract and we should be good to go here. |
@puneetlath are we good to close here? |
All paid now. Thanks everyone! |
Tracking Issue: https://github.com/Expensify/Expensify/issues/282161
Design Doc: https://docs.google.com/document/d/1itXKWlhms5YHcF4-lujO6g8T5LPdLVD_7onjtZBsATQ/edit#
HOLD ON https://github.com/Expensify/Expensify/issues/302028
(Context) Fetching and Storing Categories
Even though the
categoryObjects
map is part of the policy object, we'll store them under a new collection key in Onyx:policyCategories_<policyID>
. This has a few benefits over storing them directly in the policy. For instance, it allows categories to be evicted independently of the policy they belong to and makes it easier to update categories via Pusher.Thus, we'll push category Onyx updates to all the members of the policy whenever changes are made by an admin in the policy editor. This will ensure clients have the most up-to-date copy of their policies'
categoryObjects
maps without having to fetch the full list each time they need to display categories.With #vip-reliable-updates, we'll rely on
GetMissingOnyxUpdates
to keep the list up to date if you were offline when the changes were made.Category Menu Item
We will build off of what will be added for the Date and Merchant fields in Wave 4: Scan Receipt.
Note: If this is not implemented yet, refer to the Wave 4 doc to implement the Category field before the Date and Merchant fields cc @MariaHCD
When creating a Money Request on a policy that has categories, we'll show a "Category" menu item that is initially empty:
We'll show the category as part of the
MoneyRequestConfirmationList
, as aMenuItemWithTopDescription
, similar to what we presently do for the "amount" and "description" fields.With the Distance Requests project, we'll start connecting to the workspace
policyID
in theMoneyRequestConfirm
component. We'll only show the menu item if there's apolicyID
. Additionally, we'll use thepolicyID
to connect to the correspondingpolicyCategories_
Onyx key. With that, we can confirm that the policy has categories enabled and populated (we'll know this because we load categories when opening theMoneyRequestConfirmPage
beforehand).Note: If this is not implemented yet, refer to the Wave 5 doc to implement the workspace
policyID
connection in theMoneyRequestConfirm
component cc @neil-marcelliniROUTES.getMoneyRequestCategoryRoute
that links to${iouType}/new/category/${reportID}
.Category Picker
We'll use a single page to render both the "simple" categories selector and the more complex category selector (for when you have >= 8 categories). Both versions of the page will mainly utilize an
OptionsList
component. This will support sections, custom container styling, keyboard controls, and search via text input already.The
CategoryPicker
will take in the following props:onSubmit
: Callback function to fire the moment a category is selected.onSelectRow
function we pass to theOptionsSelector
.policyID
: Used so that we may fetch the corresponding policy categories from OnyxcategoryList
(Onyx prop): The category list from theCOLLECTION_POLICY_CATEGORIES
Onyx key.recentlyUsedCategories
(Onyx prop): TherecentlyUsedCategories
NVP of the user stored in Onyx.Less than 8 categories
When a policy has less than 8 categories, rendering the
sections
for theOptionsSelector
is very simple. We'll have a single, untitled section with each of our category names passed as options. TheshouldShowTextInput
prop will be passed asfalse
.More than 8 categories
When a policy has 8 or more categories, we'll render up to three sections, as well as show the text input for search.
The sections will be as follows, and will be returned by a method similar to what we use for the
MoneyRequestParticipantsSelector
:recentlyUsedCategories
prop. We'll only display this section if the array of recently used categories for the policies is non-empty.We'll utilize some methods in
CategoryPicker
to help us display our options:getOptionTree
: In order to format the parent sections we'll need to utilize a helper method to transform the "parent category:child category" format into a format that is easier to interpret. We can follow a similar logic to what we have with buildOptions for thecategorySelector
in OldDot. This will still be used even if we're displaying < 8 categories.getOptions
: When there is text in the search bar, we'll hide the Recents section and flatten the options (including the selected option) as one unified section. They will use their original names (i.e. in "parent: child" format). We'll filter the options using thegetNewChatOptions
method, passing in our search term. If our search term ever goes back to an empty string, we'll change back to using the result ofgetOptionTree
above, as well as re-showing all sections.Other details across both cases
CreateTransaction
The action to create transactions, both for distance and regular requests already exists or will exist. The updates for each are quite simple. We'll need to update
createTransaction
to incorporate the selected category. We'll also need to updatecreateDistanceRequest
to incorporate the category as well.Automated Tests
We'll add tests for the CategoryPicker logic, most notably around creating the list of options to be displayed. We'll test that the following criteria are satisfied:
getOptionTree
getOptionTree
.getOptionTree
- and that alphabetical order is still honored from the original parent category.getOptionTree
.getOptions
recentlyUsedCategories
for the policy, a category has already been selected, and there are more than 8 categories.recentlyUsedCategories
for the policy and there are more than 8 categories, but no category is selected.recentlyUsedCategories
for the policy are empty.recentlyUsedCategories
is present and has valuesImplementation:
getOptionTree
function, to format the parent sections we'll need to utilize a helper method to transform the "Parent: Child" category format into a format that is easier to interpret.getOptions
function, to split categories by sections.getNewChatOptions
function, to filter the options using the function.The text was updated successfully, but these errors were encountered: