Skip to content

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

Closed

Description

@lanitochka17

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.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

Activity

  1. added
    External
    Daily
    Bug
    on Feb 6, 2024
  2. 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[/+] on Feb 6, 2024
  3. melvin-bot commented on Feb 6, 2024

    @melvin-bot
  4. added
    Help Wanted
    on Feb 6, 2024
  5. melvin-bot commented on Feb 6, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 6, 2024

    @melvin-bot

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

  7. lanitochka17 commented on Feb 6, 2024

    @lanitochka17
    Author

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

  8. 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[/+] on Feb 6, 2024
  9. dukenv0307 commented on Feb 7, 2024

    @dukenv0307
    Contributor

    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
  10. 10 remaining items

  11. dukenv0307 commented on Feb 15, 2024

    @dukenv0307
    Contributor

    I am working on it

  12. added
    Reviewing
    Weekly
    and removed
    Daily
    on Feb 15, 2024
  13. dukenv0307 commented on Feb 15, 2024

    @dukenv0307
    Contributor

    @allroundexperts PR #36596 is ready to review

  14. stephanieelliott commented on Feb 21, 2024

    @stephanieelliott
    Contributor

    PR is undergoing QA

  15. stephanieelliott commented on Feb 27, 2024

    @stephanieelliott
    Contributor

    PR is on staging

  16. stephanieelliott commented on Mar 5, 2024

    @stephanieelliott
    Contributor

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

  17. 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[/+] on Mar 5, 2024
  18. stephanieelliott commented on Mar 6, 2024

    @stephanieelliott
    Contributor

    Summarizing payment on this issue:

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

  19. JmillsExpensify commented on Mar 12, 2024

    @JmillsExpensify
    Contributor

    $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

Metadata

Metadata

Labels

BugExternalReviewingWeekly

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions