From e59a7a84102861b104c77fe27beb69f59012c1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Thu, 19 Sep 2024 16:50:54 +0200 Subject: [PATCH 01/15] persist in the backend the nvp value --- src/libs/actions/Search.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index a4f0e59ef976..862b7ec51120 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -4,7 +4,7 @@ import type {ValueOf} from 'type-fest'; import type {FormOnyxValues} from '@components/Form/types'; import type {SearchQueryJSON} from '@components/Search/types'; import * as API from '@libs/API'; -import type {ExportSearchItemsToCSVParams} from '@libs/API/parameters'; +import type {ExportSearchItemsToCSVParams, SetNameValuePairParams} from '@libs/API/parameters'; import {READ_COMMANDS, WRITE_COMMANDS} from '@libs/API/types'; import * as ApiUtils from '@libs/ApiUtils'; import fileDownload from '@libs/fileDownload'; @@ -157,7 +157,22 @@ function clearAdvancedFilters() { } function dismissSavedSearchRenameTooltip() { - Onyx.merge(ONYXKEYS.NVP_SHOULD_HIDE_SAVED_SEARCH_RENAME_TOOLTIP, true); + const parameters: SetNameValuePairParams = { + name: ONYXKEYS.NVP_SHOULD_HIDE_SAVED_SEARCH_RENAME_TOOLTIP, + value: true, + }; + + const optimisticData: OnyxUpdate[] = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: ONYXKEYS.NVP_SHOULD_HIDE_SAVED_SEARCH_RENAME_TOOLTIP, + value: true, + }, + ]; + + API.write(WRITE_COMMANDS.SET_NAME_VALUE_PAIR, parameters, { + optimisticData, + }); } export { From d9d574dccdfbbc8040804a69bdc11963c39c53a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Thu, 19 Sep 2024 16:51:02 +0200 Subject: [PATCH 02/15] fix tooltip rendering logic --- src/pages/Search/SearchTypeMenu.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/Search/SearchTypeMenu.tsx b/src/pages/Search/SearchTypeMenu.tsx index 7c8af2388f52..1ef877fbddc0 100644 --- a/src/pages/Search/SearchTypeMenu.tsx +++ b/src/pages/Search/SearchTypeMenu.tsx @@ -99,7 +99,7 @@ function SearchTypeMenu({queryJSON}: SearchTypeMenuProps) { [showDeleteModal], ); - const createSavedSearchMenuItem = (item: SaveSearchItem, key: string, isNarrow: boolean) => { + const createSavedSearchMenuItem = (item: SaveSearchItem, key: string, isNarrow: boolean, index: number) => { let title = item.name; if (title === item.query) { const jsonQuery = SearchUtils.buildSearchQueryJSON(item.query) ?? ({} as SearchQueryJSON); @@ -124,7 +124,7 @@ function SearchTypeMenu({queryJSON}: SearchTypeMenuProps) { if (!isNarrow) { return { ...baseMenuItem, - shouldRenderTooltip: !shouldHideSavedSearchRenameTooltip, + shouldRenderTooltip: index === 0 && !shouldHideSavedSearchRenameTooltip, tooltipAnchorAlignment: { horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, @@ -133,6 +133,9 @@ function SearchTypeMenu({queryJSON}: SearchTypeMenuProps) { tooltipShiftVertical: 15, tooltipWrapperStyle: [styles.bgPaleGreen, styles.mh4, styles.pv2], renderTooltipContent: () => { + if (index !== 0) { + return null; + } SearchActions.dismissSavedSearchRenameTooltip(); return ( @@ -178,7 +181,7 @@ function SearchTypeMenu({queryJSON}: SearchTypeMenuProps) { if (!savedSearches) { return []; } - return Object.entries(savedSearches).map(([key, item]) => createSavedSearchMenuItem(item as SaveSearchItem, key, shouldUseNarrowLayout)); + return Object.entries(savedSearches).map(([key, item], index) => createSavedSearchMenuItem(item as SaveSearchItem, key, shouldUseNarrowLayout, index)); }; const renderSavedSearchesSection = useCallback( From 87989ce2ceb02cff2d8dc5d67985ccbc59f2777d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Fri, 20 Sep 2024 16:33:45 +0200 Subject: [PATCH 03/15] remove check --- src/pages/Search/SearchTypeMenu.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/pages/Search/SearchTypeMenu.tsx b/src/pages/Search/SearchTypeMenu.tsx index 1ef877fbddc0..eee635610ac6 100644 --- a/src/pages/Search/SearchTypeMenu.tsx +++ b/src/pages/Search/SearchTypeMenu.tsx @@ -133,9 +133,6 @@ function SearchTypeMenu({queryJSON}: SearchTypeMenuProps) { tooltipShiftVertical: 15, tooltipWrapperStyle: [styles.bgPaleGreen, styles.mh4, styles.pv2], renderTooltipContent: () => { - if (index !== 0) { - return null; - } SearchActions.dismissSavedSearchRenameTooltip(); return ( From f703a8c09e8ba28f4140a12173e293c93539d504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 07:58:38 +0200 Subject: [PATCH 04/15] use better naming for NVP --- src/ONYXKEYS.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 68a9ca2f8502..610f56f50709 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -215,8 +215,8 @@ const ONYXKEYS = { /** The NVP containing all information related to educational tooltip in workspace chat */ NVP_WORKSPACE_TOOLTIP: 'workspaceTooltip', - /** Whether to hide save search rename tooltip */ - NVP_SHOULD_HIDE_SAVED_SEARCH_RENAME_TOOLTIP: 'nvp_should_hide_saved_search_rename_tooltip', + /** Whether to show save search rename tooltip */ + NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP: 'nvp_should_show_saved_search_rename_tooltip', /** Whether to hide gbr tooltip */ NVP_SHOULD_HIDE_GBR_TOOLTIP: 'nvp_should_hide_gbr_tooltip', @@ -995,7 +995,7 @@ type OnyxValuesMapping = { [ONYXKEYS.APPROVAL_WORKFLOW]: OnyxTypes.ApprovalWorkflowOnyx; [ONYXKEYS.IMPORTED_SPREADSHEET]: OnyxTypes.ImportedSpreadsheet; [ONYXKEYS.LAST_ROUTE]: string; - [ONYXKEYS.NVP_SHOULD_HIDE_SAVED_SEARCH_RENAME_TOOLTIP]: boolean; + [ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP]: boolean; }; type OnyxValues = OnyxValuesMapping & OnyxCollectionValuesMapping & OnyxFormValuesMapping & OnyxFormDraftValuesMapping; From 8e27005662a49a3684b678c0821d31f120c448ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 07:59:18 +0200 Subject: [PATCH 05/15] add method for saved search NVP tooltip rendering --- src/libs/actions/Search.ts | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 862b7ec51120..81cbf93d9b2b 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -156,16 +156,16 @@ function clearAdvancedFilters() { Onyx.merge(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM, values); } -function dismissSavedSearchRenameTooltip() { +function setShouldShowSavedSearchRenameTooltip() { const parameters: SetNameValuePairParams = { - name: ONYXKEYS.NVP_SHOULD_HIDE_SAVED_SEARCH_RENAME_TOOLTIP, + name: ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, value: true, }; const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.NVP_SHOULD_HIDE_SAVED_SEARCH_RENAME_TOOLTIP, + key: ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, value: true, }, ]; @@ -175,6 +175,25 @@ function dismissSavedSearchRenameTooltip() { }); } +function dismissSavedSearchRenameTooltip() { + const parameters: SetNameValuePairParams = { + name: ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, + value: false, + }; + + const optimisticData: OnyxUpdate[] = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, + value: false, + }, + ]; + + API.write(WRITE_COMMANDS.SET_NAME_VALUE_PAIR, parameters, { + optimisticData, + }); +} + export { saveSearch, search, @@ -188,4 +207,5 @@ export { clearAdvancedFilters, deleteSavedSearch, dismissSavedSearchRenameTooltip, + setShouldShowSavedSearchRenameTooltip, }; From 4523eaafc22f2958d59fdba569298a710d205f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 07:59:28 +0200 Subject: [PATCH 06/15] use new name for NVP --- src/pages/Search/SearchTypeMenu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Search/SearchTypeMenu.tsx b/src/pages/Search/SearchTypeMenu.tsx index eee635610ac6..2f6e2b7b97df 100644 --- a/src/pages/Search/SearchTypeMenu.tsx +++ b/src/pages/Search/SearchTypeMenu.tsx @@ -59,7 +59,7 @@ function SearchTypeMenu({queryJSON}: SearchTypeMenuProps) { const {singleExecution} = useSingleExecution(); const {translate} = useLocalize(); const [savedSearches] = useOnyx(ONYXKEYS.SAVED_SEARCHES); - const [shouldHideSavedSearchRenameTooltip] = useOnyx(ONYXKEYS.NVP_SHOULD_HIDE_SAVED_SEARCH_RENAME_TOOLTIP, {initialValue: true}); + const [shouldShowSavedSearchRenameTooltip] = useOnyx(ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP); const {showDeleteModal, DeleteConfirmModal} = useDeleteSavedSearch(); const personalDetails = usePersonalDetails(); @@ -124,7 +124,7 @@ function SearchTypeMenu({queryJSON}: SearchTypeMenuProps) { if (!isNarrow) { return { ...baseMenuItem, - shouldRenderTooltip: index === 0 && !shouldHideSavedSearchRenameTooltip, + shouldRenderTooltip: index === 0 && shouldShowSavedSearchRenameTooltip === true, tooltipAnchorAlignment: { horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, From 77e9333655b18e93f0aaf486f06b28b23ddeb11b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 07:59:41 +0200 Subject: [PATCH 07/15] set the nvp for the tooltip if no saved searches present --- src/pages/Search/AdvancedSearchFilters.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/Search/AdvancedSearchFilters.tsx b/src/pages/Search/AdvancedSearchFilters.tsx index 8f08b128619a..82abd590e8ab 100644 --- a/src/pages/Search/AdvancedSearchFilters.tsx +++ b/src/pages/Search/AdvancedSearchFilters.tsx @@ -250,6 +250,10 @@ function AdvancedSearchFilters() { return; } + if (savedSearches === undefined) { + SearchActions.setShouldShowSavedSearchRenameTooltip(); + } + SearchActions.saveSearch({ queryJSON, }); From 688a355a302a41f07c7364e097dc17c7caf23899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 08:43:26 +0200 Subject: [PATCH 08/15] use local NVP and do not persist to db --- src/libs/actions/Search.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 81cbf93d9b2b..c86edb3db9e2 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -157,22 +157,7 @@ function clearAdvancedFilters() { } function setShouldShowSavedSearchRenameTooltip() { - const parameters: SetNameValuePairParams = { - name: ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, - value: true, - }; - - const optimisticData: OnyxUpdate[] = [ - { - onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, - value: true, - }, - ]; - - API.write(WRITE_COMMANDS.SET_NAME_VALUE_PAIR, parameters, { - optimisticData, - }); + Onyx.set(ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, true); } function dismissSavedSearchRenameTooltip() { From ae13bf46dfe161ecd5527eacfa4e16a81878d7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 08:48:12 +0200 Subject: [PATCH 09/15] use proper naming --- src/ONYXKEYS.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 610f56f50709..73c83624867b 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -216,7 +216,7 @@ const ONYXKEYS = { NVP_WORKSPACE_TOOLTIP: 'workspaceTooltip', /** Whether to show save search rename tooltip */ - NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP: 'nvp_should_show_saved_search_rename_tooltip', + SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP: 'should_show_saved_search_rename_tooltip', /** Whether to hide gbr tooltip */ NVP_SHOULD_HIDE_GBR_TOOLTIP: 'nvp_should_hide_gbr_tooltip', @@ -995,7 +995,7 @@ type OnyxValuesMapping = { [ONYXKEYS.APPROVAL_WORKFLOW]: OnyxTypes.ApprovalWorkflowOnyx; [ONYXKEYS.IMPORTED_SPREADSHEET]: OnyxTypes.ImportedSpreadsheet; [ONYXKEYS.LAST_ROUTE]: string; - [ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP]: boolean; + [ONYXKEYS.SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP]: boolean; }; type OnyxValues = OnyxValuesMapping & OnyxCollectionValuesMapping & OnyxFormValuesMapping & OnyxFormDraftValuesMapping; From e5bee24ef5b9c00a2ccc085f150dc25be1fd6a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 08:48:27 +0200 Subject: [PATCH 10/15] use new naming for onyx key --- src/libs/actions/Search.ts | 6 +++--- src/pages/Search/SearchTypeMenu.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index c86edb3db9e2..1040ae38fa2b 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -157,19 +157,19 @@ function clearAdvancedFilters() { } function setShouldShowSavedSearchRenameTooltip() { - Onyx.set(ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, true); + Onyx.set(ONYXKEYS.SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, true); } function dismissSavedSearchRenameTooltip() { const parameters: SetNameValuePairParams = { - name: ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, + name: ONYXKEYS.SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, value: false, }; const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, + key: ONYXKEYS.SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, value: false, }, ]; diff --git a/src/pages/Search/SearchTypeMenu.tsx b/src/pages/Search/SearchTypeMenu.tsx index 2f6e2b7b97df..311168dc5d61 100644 --- a/src/pages/Search/SearchTypeMenu.tsx +++ b/src/pages/Search/SearchTypeMenu.tsx @@ -59,7 +59,7 @@ function SearchTypeMenu({queryJSON}: SearchTypeMenuProps) { const {singleExecution} = useSingleExecution(); const {translate} = useLocalize(); const [savedSearches] = useOnyx(ONYXKEYS.SAVED_SEARCHES); - const [shouldShowSavedSearchRenameTooltip] = useOnyx(ONYXKEYS.NVP_SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP); + const [shouldShowSavedSearchRenameTooltip] = useOnyx(ONYXKEYS.SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP); const {showDeleteModal, DeleteConfirmModal} = useDeleteSavedSearch(); const personalDetails = usePersonalDetails(); From 0f3b308c6b07a37d9822528fb014cef59ee20084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 08:50:43 +0200 Subject: [PATCH 11/15] use local NVP for dismissing save search tooltip --- src/libs/actions/Search.ts | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 1040ae38fa2b..689eae50fedf 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -4,7 +4,7 @@ import type {ValueOf} from 'type-fest'; import type {FormOnyxValues} from '@components/Form/types'; import type {SearchQueryJSON} from '@components/Search/types'; import * as API from '@libs/API'; -import type {ExportSearchItemsToCSVParams, SetNameValuePairParams} from '@libs/API/parameters'; +import type {ExportSearchItemsToCSVParams} from '@libs/API/parameters'; import {READ_COMMANDS, WRITE_COMMANDS} from '@libs/API/types'; import * as ApiUtils from '@libs/ApiUtils'; import fileDownload from '@libs/fileDownload'; @@ -161,22 +161,7 @@ function setShouldShowSavedSearchRenameTooltip() { } function dismissSavedSearchRenameTooltip() { - const parameters: SetNameValuePairParams = { - name: ONYXKEYS.SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, - value: false, - }; - - const optimisticData: OnyxUpdate[] = [ - { - onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, - value: false, - }, - ]; - - API.write(WRITE_COMMANDS.SET_NAME_VALUE_PAIR, parameters, { - optimisticData, - }); + Onyx.set(ONYXKEYS.SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, false); } export { From 2c87edb5c850d917d781aba9f0999c4ee9dcf7fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 08:52:14 +0200 Subject: [PATCH 12/15] use better naming --- src/libs/actions/Search.ts | 4 ++-- src/pages/Search/AdvancedSearchFilters.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 689eae50fedf..873603b68739 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -156,7 +156,7 @@ function clearAdvancedFilters() { Onyx.merge(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM, values); } -function setShouldShowSavedSearchRenameTooltip() { +function showSavedSearchRenameTooltip() { Onyx.set(ONYXKEYS.SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP, true); } @@ -177,5 +177,5 @@ export { clearAdvancedFilters, deleteSavedSearch, dismissSavedSearchRenameTooltip, - setShouldShowSavedSearchRenameTooltip, + showSavedSearchRenameTooltip, }; diff --git a/src/pages/Search/AdvancedSearchFilters.tsx b/src/pages/Search/AdvancedSearchFilters.tsx index 82abd590e8ab..306f33fb9c5f 100644 --- a/src/pages/Search/AdvancedSearchFilters.tsx +++ b/src/pages/Search/AdvancedSearchFilters.tsx @@ -251,7 +251,7 @@ function AdvancedSearchFilters() { } if (savedSearches === undefined) { - SearchActions.setShouldShowSavedSearchRenameTooltip(); + SearchActions.showSavedSearchRenameTooltip(); } SearchActions.saveSearch({ From c93f037dd78b67f6033f56e779d0712abe47245a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 09:20:20 +0200 Subject: [PATCH 13/15] Update ONYXKEYS.ts Co-authored-by: Carlos Martins --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 73c83624867b..a26d22bf6b47 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -216,7 +216,7 @@ const ONYXKEYS = { NVP_WORKSPACE_TOOLTIP: 'workspaceTooltip', /** Whether to show save search rename tooltip */ - SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP: 'should_show_saved_search_rename_tooltip', + SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP: 'shouldSshowSavedSearchRenameTooltip', /** Whether to hide gbr tooltip */ NVP_SHOULD_HIDE_GBR_TOOLTIP: 'nvp_should_hide_gbr_tooltip', From cf3c6456fa62c30aa5ee1b2511ee79efad2476df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 15:10:24 +0200 Subject: [PATCH 14/15] fix typo --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index a26d22bf6b47..b5262ce101c0 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -216,7 +216,7 @@ const ONYXKEYS = { NVP_WORKSPACE_TOOLTIP: 'workspaceTooltip', /** Whether to show save search rename tooltip */ - SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP: 'shouldSshowSavedSearchRenameTooltip', + SHOULD_SHOW_SAVED_SEARCH_RENAME_TOOLTIP: 'shouldShowSavedSearchRenameTooltip', /** Whether to hide gbr tooltip */ NVP_SHOULD_HIDE_GBR_TOOLTIP: 'nvp_should_hide_gbr_tooltip', From 721978322b2bf228f830677feb8d28fe492cfc19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 23 Sep 2024 15:10:47 +0200 Subject: [PATCH 15/15] safely check saved searches --- src/pages/Search/AdvancedSearchFilters.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/Search/AdvancedSearchFilters.tsx b/src/pages/Search/AdvancedSearchFilters.tsx index 306f33fb9c5f..853f8fad75c2 100644 --- a/src/pages/Search/AdvancedSearchFilters.tsx +++ b/src/pages/Search/AdvancedSearchFilters.tsx @@ -27,6 +27,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {SearchAdvancedFiltersForm} from '@src/types/form'; import type {CardList, PersonalDetailsList, Report} from '@src/types/onyx'; +import {isEmptyObject} from '@src/types/utils/EmptyObject'; const baseFilterConfig = { date: { @@ -250,7 +251,7 @@ function AdvancedSearchFilters() { return; } - if (savedSearches === undefined) { + if (isEmptyObject(savedSearches)) { SearchActions.showSavedSearchRenameTooltip(); }