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

[Search v2] Add displaying advanced filter values and type/status #46022

Conversation

Kicu
Copy link
Contributor

@Kicu Kicu commented Jul 23, 2024

Details

This is another step in partial implementation of Advanced Search filters.

Waiting for merging of: #45756 and #45617

This PR does:

  • adds page + input for type filter (we support only 1 type for now)
  • adds page + input for status filter
  • adds displaying values for filters on the advanced filters page
  • adds ViewResults button that generates string query

What is not done:

  • the default state for form is always empty, and for now will stay
  • in a separate PR we will start to use the values from query for default values of form

Notes:

  • SearchFiltersStatusPage and SearchFiltersTypePage are extremely similar, but before extracting common code I want to see some more pages
  • I can't simply use ValuePicker because it renders an extra screen and requires extra click, whereas we need the list of options directly on Page

Fixed Issues

$ #45026
$ #46029
$ #46028
PROPOSAL:

Tests

  • visit route /search/filters
  • (currently view is not ready so there is no navigation for this; on web use URL on mobile use deeplink)
  • test that all 3 filters and navigation behave correctly
  • after clicking "View Results" verify that URL is updated with query encoded with all the filter values chosen by user

Offline tests

QA Steps

  • visit route /search/filters
  • (currently view is not ready so there is no navigation for this; on web use URL on mobile use deeplink)
  • test that all 3 filters and navigation behave correctly
  • after clicking "View Results" verify that URL is updated with query encoded with all the filter values chosen by user

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
rec-andr-filtervals.mp4
Android: mWeb Chrome

// had problems running on android

iOS: Native
rec-ios-filtervals.mp4
iOS: mWeb Safari Screenshot 2024-07-24 at 15 37 16
MacOS: Chrome / Safari
rec-web-filtervals.mp4
MacOS: Desktop

@Kicu
Copy link
Contributor Author

Kicu commented Jul 24, 2024

@luacmartins this is basically done, but I need code from date filter: #45756
so you could take a quick look if you want, as soon as the date filter is merged this will be ready.

I'm also moving the conversation about form/input flows here.
Re: your comment here: #45756 (comment)

[..] reason for the date filter (and some others) to have their own route/page is because they are a bit special

I've handled this for type and status by not using ValuePicker and just directly using Selection List. The main reason is that in AdvancedFilters component I want all the fields to look the same - that is - be MenuItems which navigate.

I don't think its good practice to have some of them be menu items which navigate, while some be FormInputs that navigate within their own flow.

We already do it like that for example here: ReportSettings has a button with redirects: https://github.com/Expensify/App/blob/main/src/pages/settings/Report/ReportSettingsPage.tsx#L63
redirects here to a page with List: https://github.com/Expensify/App/blob/main/src/pages/settings/Report/NotificationPreferencePage.tsx#L40-L52

@Kicu Kicu force-pushed the kicu/45026-advanced-filter-values branch from b8c4643 to 22481db Compare July 24, 2024 14:51
@Kicu Kicu force-pushed the kicu/45026-advanced-filter-values branch from 22481db to 9aa2ffb Compare July 24, 2024 17:12
@Kicu Kicu marked this pull request as ready for review July 24, 2024 17:14
@Kicu Kicu requested a review from a team as a code owner July 24, 2024 17:14
@melvin-bot melvin-bot bot removed the request for review from a team July 24, 2024 17:14
Copy link

melvin-bot bot commented Jul 24, 2024

@rayane-djouah Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot requested a review from rayane-djouah July 24, 2024 17:14
@Kicu
Copy link
Contributor Author

Kicu commented Jul 24, 2024

Even though the whole filters are kinda dependent on #45617 this PR works as-is and can be reviewed
@rayane-djouah @luacmartins

@luacmartins luacmartins changed the title [Search] Add displaying advanced filter values and type/status [Search v2] Add displaying advanced filter values and type/status Jul 24, 2024
src/CONST.ts Outdated
Comment on lines 5242 to 5244
TYPE: {
EXPENSES: 'expenses',
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to DATA_TYPES and use singular expense please?

Copy link
Contributor Author

@Kicu Kicu Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh sorry unfortunately that won't work. DATA_TYPES are connected via typedefinition with the mechanism of rendering data in lists in SearchUtils:

https://github.com/Expensify/App/blob/main/src/libs/SearchUtils.ts#L218

If I add expense to this const, then I would have to implement all these functions for displaying an expense. So let's keep them as TYPE I think?

Btw this beautifully shows us that we have too many "types" that mean different things 😉

src/pages/Search/SearchFiltersStatusPage.tsx Outdated Show resolved Hide resolved
src/pages/Search/SearchFiltersStatusPage.tsx Outdated Show resolved Hide resolved
src/pages/Search/AdvancedSearchFilters.tsx Outdated Show resolved Hide resolved
@Kicu
Copy link
Contributor Author

Kicu commented Jul 25, 2024

@luacmartins pushed some of your changes. How about we wait with the CONST changes for Adam's PR to be merged, I will make sure that whatever was done there will be the final version.

@rayane-djouah
Copy link
Contributor

rayane-djouah commented Jul 25, 2024

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native
Screen.Recording.2024-07-29.at.4.34.17.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-07-29.at.4.29.59.PM.mov
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-07-29.at.16.32.41.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-07-29.at.16.28.45.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-07-29.at.4.24.51.PM.mov
MacOS: Desktop
Screen.Recording.2024-07-29.at.4.28.07.PM.mov

// TODO once we have values from query, this value should be `filters[fieldName].value`
return fieldName;
// the values of dateBefore+dateAfter map to just a single 'date' field on advanced filters
type AvailableFilters = ValueOf<typeof INPUT_IDS> | 'date';
Copy link
Contributor

@rayane-djouah rayane-djouah Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better if we define the available filter names as constants in the CONST file, like this:

in CONST.SEARCH add:

ADVANCED_SEARCH_FILTERS: {
    FIELDS_NAMES: {
          DATE: 'date',
          ...
    },
},

Then, use ValueOf<typeof CONST.ADVANCED_SEARCH_FILTERS.FIELDS_NAMES> and replace the hardcoded values with the constants.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you suggest I have both the INPUT_IDS and also ADVANCED_SEARCH_FILTERS and use them here?

Btw this is most likely the only case where there are 2 inputs that map to 1 filter, because the actual filter will be date > xxxx and date < yyyy.
I think all the other filters will map 1-to-1 filter name to input.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can define it as follows:

const FIELDS_NAMES = Object.entries(INPUT_IDS).reduce<Record<string, string>>((fields, [key, value]) => {
    if (key === INPUT_IDS.DATE_AFTER || key === INPUT_IDS.DATE_BEFORE) {
        fields.DATE = 'date';
    } else {
        fields[key] = value;
    }
    return fields;
}, {});

type AvailableFilters = ValueOf<typeof FIELDS_NAMES>;

My concern here is to avoid using hardcoded values when referencing getFilterDisplayTitle, we should be using FIELDS_NAMES const instead.

Copy link
Contributor Author

@Kicu Kicu Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rayane-djouah after we merged the other PR with new query/syntax - CONSTs were modified, and now I can use better more fitting consts specific to query here.
So I didn't do it your way, but there will be no hardcoded values used here anymore

@luacmartins
Copy link
Contributor

Nice, now that the syntax PR is merged, let's update this one to work with that!

src/pages/Search/SearchFiltersTypePage.tsx Outdated Show resolved Hide resolved
// TODO once we have values from query, this value should be `filters[fieldName].value`
return fieldName;
// the values of dateBefore+dateAfter map to just a single 'date' field on advanced filters
type AvailableFilters = ValueOf<typeof INPUT_IDS> | 'date';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can define it as follows:

const FIELDS_NAMES = Object.entries(INPUT_IDS).reduce<Record<string, string>>((fields, [key, value]) => {
    if (key === INPUT_IDS.DATE_AFTER || key === INPUT_IDS.DATE_BEFORE) {
        fields.DATE = 'date';
    } else {
        fields[key] = value;
    }
    return fields;
}, {});

type AvailableFilters = ValueOf<typeof FIELDS_NAMES>;

My concern here is to avoid using hardcoded values when referencing getFilterDisplayTitle, we should be using FIELDS_NAMES const instead.

const advancedFilters = useMemo(
() => [
{
title: getFilterDisplayTitle({}, 'title'),
title: getFilterDisplayTitle(searchAdvancedFilters, 'type', translate),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, here we can use FIELDS_NAMES.TYPE instead of 'type'

src/pages/Search/SearchFiltersStatusPage.tsx Outdated Show resolved Hide resolved
@rayane-djouah
Copy link
Contributor

Bug 1: "Expense" option is focused initially and has a green check icon even if it's not selected

Screen.Recording.2024-07-25.at.8.10.00.PM.mov

Bug 2: All status options have a green check icon (I believe only the selected one should have this icon)

Screen.Recording.2024-07-25.at.8.10.34.PM.mov

Bug 3: Status is not updated in Onyx and in the advanced filters page

Screen.Recording.2024-07-25.at.8.10.43.PM.mov

@rayane-djouah
Copy link
Contributor

There are conflicts

@luacmartins
Copy link
Contributor

Bug 1: "Expense" option is focused initially and has a green check icon even if it's not selected

I think this one is expected. Expense is the default type and we should always have a selected type (even if not in the query itself)

@rayane-djouah
Copy link
Contributor

Bug 1: "Expense" option is focused initially and has a green check icon even if it's not selected

I think this one is expected. Expense is the default type and we should always have a selected type (even if not in the query itself)

Hm, in this case it should be also selected by default in the menu item in the advanced filters page:

Screenshot 2024-07-25 at 10 27 16 PM

@luacmartins
Copy link
Contributor

Yea, I agree with that. Same goes for status, if nothing is selected All is the default

@Kicu Kicu mentioned this pull request Jul 26, 2024
50 tasks
@Kicu
Copy link
Contributor Author

Kicu commented Jul 26, 2024

I fixed some of the comments but not all of them, will continue on Monday, please don't re-review yet.

@Kicu
Copy link
Contributor Author

Kicu commented Jul 29, 2024

@rayane-djouah ready for re-review. However tested only on web now, since native builds take a lot of time. Will test on native later and update this comment.

I'm not able to reproduce any of the 3 bugs you mentioned - I hope they are all fixed.

What should and should NOT work:

  • View button should work and update the query after clicking
  • initially all filter values will be empty when entering the view. That is expected because filter values will come only from onyx form data
  • on a separate PR I will parse the query value and set onyx form fields - then we will have all the initial values set correctly

CC @luacmartins
Also this PR keeps growing so I would like to merge it in this state (of course unless there are bugs). There are 2 more people that could be doing more filters in parallel and this is a blocker since this PR displays the values of selected filters.

I will clean and fix whatever else in separate PRs :)

// TODO once we have values from query, this value should be `filters[fieldName].value`
return fieldName;
function getFilterDisplayTitle(filters: Partial<SearchAdvancedFiltersForm>, fieldName: AdvancedFiltersKeys, translate: LocaleContextProps['translate']) {
if (fieldName === 'date') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (fieldName === 'date') {
if (fieldName === CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE) {

Comment on lines +361 to +373
const dateBefore = filterValues[INPUT_IDS.DATE_BEFORE];
const dateAfter = filterValues[INPUT_IDS.DATE_AFTER];

let dateFilter = '';
if (dateBefore) {
dateFilter += `${CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE}<${dateBefore}`;
}
if (dateBefore && dateAfter) {
dateFilter += ' ';
}
if (dateAfter) {
dateFilter += `${CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE}>${dateAfter}`;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB: We can simplify buildQueryStringFromFilters function by extracting the date handling logic to a new buildDateFilterQuery function

Copy link
Contributor

@rayane-djouah rayane-djouah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug 4: Results are not correctly filtered by date

Screen.Recording.2024-07-29.at.1.29.59.PM.mov

@rayane-djouah
Copy link
Contributor

@Kicu - Could you please update the test steps in the author checklist to make it clear for the QA team. I think this is not relevant anymore:

view results doesn't work yet

buttonText={translate('search.viewResults')}
containerStyles={[styles.m4]}
onSubmit={onFormSubmit}
/>
Copy link
Contributor

@rayane-djouah rayane-djouah Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the "View results" button should not be disabled offline. based on OfflineUX_Patterns_Flowchart, No offline pattern is needed here.

Screenshot 2024-07-29 at 3 27 32 PM
Suggested change
/>
enabledWhenOffline
/>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep it as is for now so that we don't block other issues, but I think we should disable it offline because the Search API command only works while the user is online.

@Kicu
Copy link
Contributor Author

Kicu commented Jul 29, 2024

@rayane-djouah code comments fixed.

About Bug 4 the filtering does not happen because I don't yet send values for the filters in the backend call to Search. Actually I'm not sure if I should handle calling api using the new jsonQuery format inside this PR or not yet.
@luacmartins what do you think? could we perhaps move it to a separate PR?
Technically these filters are still under construction and don't yet work 100%

@luacmartins
Copy link
Contributor

I think it's fine to handle that in a follow up.

Copy link
Contributor

@rayane-djouah rayane-djouah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! last comment

);

const onFormSubmit = () => {
Copy link
Contributor

@rayane-djouah rayane-djouah Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB:

Suggested change
const onFormSubmit = () => {
const openResults = () => {

From the Reviewer Checklist:

I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).

@rayane-djouah
Copy link
Contributor

cc @Expensify/design to review the new pages design

Screenshots/Videos

Android: Native
Screen.Recording.2024-07-29.at.4.34.17.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-07-29.at.4.29.59.PM.mov
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-07-29.at.16.32.41.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-07-29.at.16.28.45.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-07-29.at.4.24.51.PM.mov
MacOS: Desktop
Screen.Recording.2024-07-29.at.4.28.07.PM.mov

Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and tests well. Let's address the pending comments in a follow up

Comment on lines +5254 to +5256
TYPE: {
EXPENSE: 'expense',
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB we should eventually move this to CONST.SEARCH.DATA_TYPES.EXPENSE and get rid of transactions and reports. We'll do so as part of v2.2.

* Given object with chosen search filters builds correct query string from them
*/
function buildQueryStringFromFilters(filterValues: Partial<SearchAdvancedFiltersForm>) {
// TODO add handling of multiple values picked
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO add handling of multiple values picked

Copy link
Contributor

@rayane-djouah rayane-djouah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and tests well

@melvin-bot melvin-bot bot requested a review from luacmartins July 29, 2024 15:49
@luacmartins luacmartins merged commit b4c46f2 into Expensify:main Jul 29, 2024
19 of 20 checks passed
Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.0.14-1 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.0.14-6 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants