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

[HOLD for payment 2024-03-04] [$500] [MEDIUM] Categories: Selected category not highlighted if other category removed by WS Admin #35945

Closed
6 tasks
lanitochka17 opened this issue Feb 6, 2024 · 17 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 6, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.37-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4283510
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:

Prerequisites: Collect Policy with enabled Categories, which has < 8 Categories has been created in OD. Employee has been invited to the Policy

  1. Log in to New Expensify as Employee from prerequisites
  2. Navigate to workspace chat > start manual request
  3. Enter an amount > Next > Category > Select any Category
  4. Tap Category once more
  5. As Workspace Admin in OD - remove any other Category

Expected Result:

The removed category should disappear from Employee's categories list, and the selected category should remain highlighted

Actual Result:

The removed category disappears from Employee's category list. However, the first category in the list is highlighted instead of the selected one

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

Bug6369688_1707244389717.2024-02-06_17-18-07.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d1a6471df7b92a86
  • Upwork Job ID: 1754942209808277504
  • Last Price Increase: 2024-02-06
  • Automatic offers:
    • dukenv0307 | Contributor | 0
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 6, 2024
@melvin-bot melvin-bot bot changed the title mWeb - IOU - Selected category not highlighted if other category removed by WS Admin [$500] mWeb - IOU - Selected category not highlighted if other category removed by WS Admin Feb 6, 2024
Copy link

melvin-bot bot commented Feb 6, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01d1a6471df7b92a86

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 6, 2024
Copy link

melvin-bot bot commented Feb 6, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts (External)

Copy link

melvin-bot bot commented Feb 6, 2024

Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave6
CC @greg-schroeder

@greg-schroeder greg-schroeder changed the title [$500] mWeb - IOU - Selected category not highlighted if other category removed by WS Admin [$500] [MEDIUM] Categories: Selected category not highlighted if other category removed by WS Admin Feb 6, 2024
@dukenv0307
Copy link
Contributor

dukenv0307 commented Feb 7, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

  • Selected category not highlighted if other category removed by WS Admin

What is the root cause of that problem?

  • When we remove any category in OD, the sections data is changed, so the below logic is called, which leads to the focusedIndex is updated to 0:
    this.setState(
    {
    sections: newSections,
    allOptions: newOptions,
    focusedIndex: _.isNumber(this.props.focusedIndex) ? this.props.focusedIndex : newFocusedIndex,
    },

What changes do you think we should make in order to solve the problem?

  • We can create a new state, named focusedOption, and update it whenever we update the focusedIndex
  • Then, once the sections changed, we will check if the previous focused option is still in the new sections and the text search is not changed, if true, set the focus option to that index. Do it by updating the logic:
    focusedIndex: _.isNumber(this.props.focusedIndex) ? this.props.focusedIndex : newFocusedIndex,

    to:
 focusedIndex: newOptions.find((option) => option.keyForList === this.focusedOption?.keyForList)
                    ? newOptions.findIndex((option) => option.keyForList === this.focusedOption?.keyForList)
                    : _.isNumber(this.props.focusedIndex)
                    ? this.props.focusedIndex
                    : newFocusedIndex

What alternative solutions did you explore? (Optional)

  • NA

@stephanieelliott
Copy link
Contributor

Hey @allroundexperts we've got a proposal here, can you please review when you get a sec?

@allroundexperts
Copy link
Contributor

@dukenv0307's proposal looks good to me. It has the correct RCA and the solution makes sense as well.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Feb 9, 2024

Triggered auto assignment to @luacmartins, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot added the Overdue label Feb 12, 2024
Copy link

melvin-bot bot commented Feb 12, 2024

@luacmartins, @allroundexperts, @stephanieelliott Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 13, 2024
Copy link

melvin-bot bot commented Feb 13, 2024

📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot removed the Overdue label Feb 13, 2024
@dukenv0307
Copy link
Contributor

I am working on it

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Feb 15, 2024
@dukenv0307
Copy link
Contributor

@allroundexperts PR #36596 is ready to review

@stephanieelliott
Copy link
Contributor

PR is undergoing QA

@stephanieelliott
Copy link
Contributor

PR is on staging

@stephanieelliott
Copy link
Contributor

This was deployed to prod on 2/28, seems the automation didn't work so am updating manually

@stephanieelliott stephanieelliott changed the title [$500] [MEDIUM] Categories: Selected category not highlighted if other category removed by WS Admin [HOLD for payment 2024-03-04] [$500] [MEDIUM] Categories: Selected category not highlighted if other category removed by WS Admin Mar 5, 2024
@stephanieelliott
Copy link
Contributor

Summarizing payment on this issue:

Upwork job is here: https://www.upwork.com/jobs/~1737876297360310272

@JmillsExpensify
Copy link

$500 approved for @allroundexperts based on summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

6 participants