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

[$250] No way to save a search after searching for a custom query #53036

Open
1 of 8 tasks
m-natarajan opened this issue Nov 23, 2024 · 7 comments
Open
1 of 8 tasks

[$250] No way to save a search after searching for a custom query #53036

m-natarajan opened this issue Nov 23, 2024 · 7 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Nov 23, 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: 9.0.66-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @shawnborton
Slack conversation (hyperlinked to channel name): expensify-expense

Action Performed:

  1. Go to search
  2. Click on search
  3. Enter any query to give results
  4. Click filters

Expected Result:

Should have an option to save the results

Actual Result:

No option to save the search for a custom query

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Recording.792.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021861022728491645753
  • Upwork Job ID: 1861022728491645753
  • Last Price Increase: 2024-11-25
  • Automatic offers:
    • ikevin127 | Reviewer | 105057798
Issue OwnerCurrent Issue Owner: @Kicu
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 23, 2024
Copy link

melvin-bot bot commented Nov 23, 2024

Triggered auto assignment to @twisterdotcom (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@Shahidullah-Muffakir
Copy link
Contributor

Proposal

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

When a query is entered in the SearchRouter, the Save Search button does not appear in the AdvancedSearchFilters. Currently, it only appears if a filter is applied from AdvancedSearchFilters

What is the root cause of that problem?

The issue lies here where it determines whether the Save Search button should be displayed:
the Save Search button is displayed only if certain filters are applied.

const displaySearchButton = queryJSON && !SearchQueryUtils.isCannedSearchQuery(queryJSON);

* Returns whether a given search query is a Canned query.
*
* Canned queries are simple predefined queries, that are defined only using type and status and no additional filters.
* In addition, they can contain an optional policyID.
* For example: "type:trip status:all" is a canned query.
*/
function isCannedSearchQuery(queryJSON: SearchQueryJSON) {
return !queryJSON.filters;
}

This restriction was introduced to prevent showing the button for "canned" (default) search queries.

However, when a user manually inputs a query, the code does not account for this case, leading to the button not being displayed.

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

We have two options
Option 1: Include the searchAdvancedFilters.keyword Check

const displaySearchButton = queryJSON && !SearchQueryUtils.isCannedSearchQuery(queryJSON);

as:
const displaySearchButton = queryJSON && (!SearchQueryUtils.isCannedSearchQuery(queryJSON) || !!searchAdvancedFilters.keyword)

Option 2. Check If queryString Is Not the Default

@Kicu
Copy link
Contributor

Kicu commented Nov 25, 2024

This feature works correctly IF values are picked using autocomplete suggestion list.
This issue/bug appears only when pasting in the full query, because then the autocomplete logic is not run as we don't know what accountID was picked.

The solution above is not the best way to solve this, as the core of the issue is the replacement of user email <----> user id both ways.
This was heavily discussed on slack here: https://swmansion.slack.com/archives/C06ML6X0W9L/p1732225727559059?thread_ts=1732198278.634479&cid=C06ML6X0W9L

Please assign me to this task, and I will take care of the email part of this issue, after #52568 is merged.

CC @luacmartins

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Nov 25, 2024
@melvin-bot melvin-bot bot changed the title No way to save a search after searching for a custom query [$250] No way to save a search after searching for a custom query Nov 25, 2024
Copy link

melvin-bot bot commented Nov 25, 2024

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

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

melvin-bot bot commented Nov 25, 2024

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

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

melvin-bot bot commented Nov 25, 2024

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

Offer link
Upwork job

@luacmartins
Copy link
Contributor

Thanks @Kicu

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants