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-22] [$500] Category - Selected category is not ticked when it appears in the search result #37287

Closed
6 tasks done
kbecciv opened this issue Feb 27, 2024 · 15 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Feb 27, 2024

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: v1.4.44-0
Reproducible in staging?: y
Reproducible in production?: n
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com.
  2. Go to workspace chat.
  3. Click + > Request money > Manual.
  4. Proceed to confirmation page.
  5. Click Category.
  6. Select a category.
  7. Click Category.
  8. Search for the category selected in Step 5.

Expected Result:

The selected category will be ticked in the search result as it is selected.

Actual Result:

The selected category is not ticked in the search result.

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

Bug6393823_1709030989709.20240227_073006__1_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010c5eb5319c889dad
  • Upwork Job ID: 1762472753849147392
  • Last Price Increase: 2024-02-27
  • Automatic offers:
    • dukenv0307 | Contributor | 0
@kbecciv kbecciv added DeployBlockerCash This issue or pull request should block deployment External Added to denote the issue can be worked on by a contributor labels Feb 27, 2024
@melvin-bot melvin-bot bot changed the title Category - Selected category is not ticked when it appears in the search result [$500] Category - Selected category is not ticked when it appears in the search result Feb 27, 2024
Copy link

melvin-bot bot commented Feb 27, 2024

Job added to Upwork: https://www.upwork.com/jobs/~010c5eb5319c889dad

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

melvin-bot bot commented Feb 27, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Feb 27, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Feb 27, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Feb 27, 2024

Triggered auto assignment to @puneetlath (Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@kbecciv
Copy link
Author

kbecciv commented Feb 27, 2024

We think that this bug might be related to #wave5-free-submitters
CC @dylanexpensify

@dukenv0307
Copy link
Contributor

dukenv0307 commented Feb 27, 2024

Proposal

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

The selected category is not ticked in the search result.

What is the root cause of that problem?

In here, we don't insert isSelected: true based on whether the searched categories are selected.

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

In here, we don't insert isSelected: true field to the result based on whether the searched categories are selected. We can check whether the searched categories are selected based on the selectedOptions params passed in.

Something like:

const searchCategories = enabledCategories.filter((category) => category.name.toLowerCase().includes(searchInputValue.toLowerCase())).map((category) => ({
    ...category,
    isSelected: selectedOptions.some((selectedOption) => selectedOption.name === category.name),
}));

What alternative solutions did you explore? (Optional)

When the selected category matches the search result, currently it will not be in the 1st position by default, if we want it to be in the 1st position similar to non-search case, we can push it to top.

const searchCategories = enabledAndSelectedCategories.filter((category) => category.name.toLowerCase().includes(searchInputValue.toLowerCase()));

@nexarvo
Copy link
Contributor

nexarvo commented Feb 27, 2024

Proposal

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

Selected category is not ticked when it appears in the search result.

What is the root cause of that problem?

When we are searching for category, the getCategoryListSelection function does not preserve the isSelected flag which is responsible for showing the tick.

What changes do you think we should make in order to solve the problem?
We can find the loop through the selected options and find update the isSelected flag of the filtered object.

searchCategories.forEach(cat => {
            const selectedCatgory = selectedOptions.find(selectedCat => selectedCat.name === cat.name);
            if(selectedCatgory) {
                cat.isSelected = true;
            }
        });

The filter function is code block is located here:

if (searchInputValue) {
const searchCategories = enabledCategories.filter((category) => category.name.toLowerCase().includes(searchInputValue.toLowerCase()));
categorySections.push({
// "Search" section
title: '',
shouldShow: true,
indexOffset,
data: getCategoryOptionTree(searchCategories, true),
});
return categorySections;
}

What alternative solutions did you explore? (Optional)

@rushatgabhane
Copy link
Member

🎀👀🎀 i like @dukenv0307 's proposal #37287 (comment)

Copy link

melvin-bot bot commented Feb 27, 2024

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@puneetlath puneetlath removed the DeployBlockerCash This issue or pull request should block deployment label Feb 27, 2024
@puneetlath
Copy link
Contributor

Removing the label as I don't think this needs to be a deploy blocker.

@puneetlath puneetlath added Daily KSv2 and removed Hourly KSv2 labels Feb 27, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 27, 2024
Copy link

melvin-bot bot commented Feb 27, 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 added the Weekly KSv2 label Feb 29, 2024
@dukenv0307
Copy link
Contributor

@rushatgabhane this PR is ready for preview.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 15, 2024
@melvin-bot melvin-bot bot changed the title [$500] Category - Selected category is not ticked when it appears in the search result [HOLD for payment 2024-03-22] [$500] Category - Selected category is not ticked when it appears in the search result Mar 15, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 15, 2024
Copy link

melvin-bot bot commented Mar 15, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Mar 15, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.52-6 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 2024-03-22. 🎊

For reference, here are some details about the assignees on this issue:

@puneetlath
Copy link
Contributor

Payment summary:

@rushatgabhane please request on NewDot.

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

5 participants