Repository navigation
Description
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: 1.4.35-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4257599
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:
Preconditions:
Configure the OldDot administrator account, include a maximum of 7 categories and invite the employee to the policy https://sites.google.com/applausemail.com/applause-expensifyproject/wiki-guides/newdot-categories?authuser=0
Steps:
- Open https://staging.new.expensify.com/
- Log in with the account of the employee added to the policy
- Navigate to the group policy chat room
- Create a manual request with any category and send it to the WS room
- Open https://staging.expensify.com/
- Under the administrator account, disable the category from step 4
- In NewDot, under the employee's account, go to IOU details
- Click on the category field
- Click on the selected category with a green check mark
Expected Result:
When you click on a disabled category, it should deselect itself
Actual Result:
A disabled category in IOU does not deselect when you click on it
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android: Native
- Android: mWeb Chrome
- iOS: Native
- iOS: mWeb Safari
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
Bug6363552_1706788366027.Recording__1245.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01faafade61edc83ca
- Upwork Job ID: 1753056687790592000
- Last Price Increase: 2024-02-01
- Automatic offers:
- DylanDylann | Reviewer | 28142211
- tienifr | Contributor | 28142212
Activity
[-] IOU - A disabled category in IOU does not deselect when you click on it[/-][+][$500] IOU - A disabled category in IOU does not deselect when you click on it[/+]melvin-bot commentedon Feb 1, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01faafade61edc83ca
melvin-bot commentedon Feb 1, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)melvin-bot commentedon Feb 1, 2024
Triggered auto assignment to @laurenreidexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.lanitochka17 commentedon Feb 1, 2024
We think that this bug might be related to #wave6
CC @greg-schroeder
tienifr commentedon Feb 1, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
A disabled category in IOU does not deselect when you click on it
What is the root cause of that problem?
When the number of categories is small, this block will run, and we'll be getting the category option tree based on the
enabledAndSelectedCategories, but inenabledAndSelectedCategories, the selected category currently hasenabledfalse, because it was disabled in Admin side, so it shows as disabled in the list.If there're a lot of categories (equal or more than
CATEGORY_LIST_THRESHOLD), this issue won't happen because in that case we already set theenabled: truefor the selected category, regardless of itsenabledstatus, as can be seen here.What changes do you think we should make in order to solve the problem?
When constructing the
enabledAndSelectedCategorieslist here, push theselected categoriesin, all withenabled: truefirst, then push the remainingenabledcategories. This is the same as we're already doing for list of a lot of categories (equal or more thanCATEGORY_LIST_THRESHOLD). Also a bonus is that the selected category now will come as the first item in the list, consistent with the a-lot-of-categories UX.What alternative solutions did you explore? (Optional)
If instead we want to keep the ordering of the selected category amongst the categories as currently, we can look for the selected category in the current
enabledAndSelectedCategoriesand set itsenabledtotrue.Another approach is:
Pass an array of selected categories as a 3rd param of
getCategoryOptionTree, and when checkingisDisabled, make sure that category is not currently selected before settingisDisabledas true.In here we should apply similar logic as well.
Not related to this issue but in this line if both parent and child are categories, like
AdvertisingandAdvertising: Social Media: Facebook, theAdvertisingseems to be disabled incorrectly. We might want to check and fix it separately.tienifr commentedon Feb 1, 2024
Proposal updated to add example code change.
DylanDylann commentedon Feb 2, 2024
The main solution in @tienifr's proposal looks good to me
🎀 👀 🎀 C+ reviewed
12 remaining items
aimane-chnaif commentedon Feb 21, 2024
This caused regression. Restored this bug back.
Julesssss commentedon Feb 21, 2024
@tienifr could you please raise a follow-up? There's a good suggested fix here in the linked issue
tienifr commentedon Feb 23, 2024
Sure.
tienifr commentedon Feb 23, 2024
@DylanDylann Regression fix PR is ready for review #37127.
DylanDylann commentedon Feb 28, 2024
@laurenreidexpensify Please help to move forward with this issue, the PR is deployed to production and there are no regression as confirmed here
tienifr commentedon Mar 1, 2024
@laurenreidexpensify Please help move forward this issue or add Hold for payment label.
laurenreidexpensify commentedon Mar 4, 2024
Payment Summary:
Contributor $500 paid in Upwork @tienifr
C+ $500 paid in Upwork @DylanDylann
laurenreidexpensify commentedon Mar 4, 2024
@DylanDylann pls add checklist and regression step suggestions thank you
DylanDylann commentedon Mar 4, 2024
Julesssss commentedon Mar 4, 2024
I'm not sure we need this very specific regression test to be honest. If none already exist maybe we could create a generic one to test the list component with a disabled item to cover many cases
laurenreidexpensify commentedon Mar 6, 2024
@DylanDylann @Julesssss do you have a suggestion for how that could look? Just tryna visualise what the many cases could be. Thanks!
Julesssss commentedon Mar 6, 2024
I found one here. So no need for any new cases