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.3] [App] Implement Saved Search feature #48566

Merged
merged 109 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
6598982
WIP
lakchote Aug 26, 2024
8da87e9
wip
lakchote Aug 27, 2024
fd83f2a
Merge branch 'main' into lucien/wip-searchv3
lakchote Aug 27, 2024
6391ba4
add onyx key for NVP SAVED_SEARCHES
lakchote Sep 4, 2024
24ff124
add saved search route
lakchote Sep 4, 2024
ef22393
add saved search screens
lakchote Sep 4, 2024
3fe4654
add Onyx types
lakchote Sep 4, 2024
1783ff7
add saved search navigators
lakchote Sep 4, 2024
beb323a
add saved search params and screens
lakchote Sep 4, 2024
e9fa985
add utils for saved search
lakchote Sep 4, 2024
644e4ab
add delete saved search
lakchote Sep 4, 2024
763c985
add delete saved search hook
lakchote Sep 4, 2024
53bd9c7
fix lint
lakchote Sep 4, 2024
a99b9ae
fix lint
lakchote Sep 4, 2024
86e8ed2
handle cancel button
lakchote Sep 4, 2024
5086308
modify component for mobile functionality for saved search
lakchote Sep 4, 2024
bfa7c2e
saved search rename page
lakchote Sep 4, 2024
24c50e2
add translation
lakchote Sep 4, 2024
a60778e
add star icon
lakchote Sep 9, 2024
966c1b8
add missing properties from MenuItem
lakchote Sep 9, 2024
a21b7f7
fix popover menu not closing
lakchote Sep 9, 2024
c8b3d4a
fix default query string
lakchote Sep 9, 2024
3a9daaf
fix renaming for default query string to get the same hash
lakchote Sep 9, 2024
637bb6f
fix popover menu not closing
lakchote Sep 9, 2024
8250b36
add green color and background related styles
lakchote Sep 9, 2024
c5fe7a8
fix tooltip display
lakchote Sep 9, 2024
b2161a0
fix lint and prettier
lakchote Sep 9, 2024
eb283ee
add missing translation key
lakchote Sep 9, 2024
2c28b51
fix tooltip rendering
lakchote Sep 9, 2024
14204f3
Merge branch 'main' into lucien/search-savedSearches
lakchote Sep 9, 2024
6a77450
fix old code relics
lakchote Sep 9, 2024
182e361
improve code using canned query
lakchote Sep 9, 2024
4f4bb07
fix prettier
lakchote Sep 9, 2024
574a584
fix lint
lakchote Sep 9, 2024
aff30f0
fix cancel button not showing on mobile
lakchote Sep 9, 2024
0faec36
fix lint
lakchote Sep 9, 2024
bd4861f
fix form for saved search rename page
lakchote Sep 9, 2024
01c9e96
fix typecheck
lakchote Sep 9, 2024
869e21c
fix prettier
lakchote Sep 9, 2024
8767a59
fix react compiler errors
lakchote Sep 10, 2024
363b574
Merge branch 'main' into lucien/search-savedSearches
lakchote Sep 10, 2024
446265a
improve form
lakchote Sep 10, 2024
cebf87d
add distinct name
lakchote Sep 10, 2024
6776ef3
fix cancel button showing everytime
lakchote Sep 10, 2024
69c1f2a
remove unnecessary params
lakchote Sep 10, 2024
5b090db
remove default value to be consistent with figma file
lakchote Sep 10, 2024
82fcd1e
fix bug
lakchote Sep 10, 2024
29aebb6
fix lint
lakchote Sep 10, 2024
08feb86
fix lint
lakchote Sep 10, 2024
dfdcd24
fix tsc
lakchote Sep 10, 2024
48b45a5
fix spanish translation
lakchote Sep 10, 2024
bf97c8f
Merge branch 'main' into lucien/search-savedSearches
lakchote Sep 11, 2024
0bd6855
remove blank line
lakchote Sep 11, 2024
b54d83c
add the bookmark icon
lakchote Sep 11, 2024
0f2d5e4
use the bookmark icon
lakchote Sep 11, 2024
422e393
make saved searches scrollable
lakchote Sep 11, 2024
06870b0
base64 encode for date
lakchote Sep 11, 2024
15760ea
fix accessing saved searches
lakchote Sep 11, 2024
1273d62
fix style
lakchote Sep 11, 2024
4e0a193
show save search only if there are filters
lakchote Sep 11, 2024
83640a6
fix style
lakchote Sep 11, 2024
06acfd9
add to central pane
lakchote Sep 11, 2024
1d486e3
revert unneeded base64
lakchote Sep 11, 2024
7819448
remove useless query string replacement
lakchote Sep 11, 2024
f85e084
remove draft value
lakchote Sep 11, 2024
aacab14
fix cancel button display
lakchote Sep 11, 2024
dc97d03
fix renaming on iOS
lakchote Sep 11, 2024
b3d24f6
Merge branch 'main' into lucien/search-savedSearches
lakchote Sep 12, 2024
676028c
add fragment
lakchote Sep 12, 2024
8bc0790
fix icon name
lakchote Sep 12, 2024
5aed67c
fix tooltip rendering
lakchote Sep 12, 2024
6b80a66
fix style
lakchote Sep 12, 2024
fde60a4
highlight saved search
lakchote Sep 12, 2024
9a1b74a
add onyx util for save search
lakchote Sep 12, 2024
cd927b8
fix onyx type
lakchote Sep 12, 2024
377d289
fix dependencies
lakchote Sep 12, 2024
1bdb6bb
fix tooltip rendering for renaming a saved search
lakchote Sep 12, 2024
0160485
fix type check
lakchote Sep 12, 2024
de41f4c
fix react compiler error
lakchote Sep 12, 2024
a6a973e
fix icon
lakchote Sep 12, 2024
0ed79b6
Merge branch 'main' into lucien/search-savedSearches
lakchote Sep 12, 2024
7767de6
remove doublon icon
lakchote Sep 12, 2024
0da08e9
fix type check
lakchote Sep 12, 2024
f452a9c
fix typo
lakchote Sep 12, 2024
938133b
fix delete modal not showing on iOS
lakchote Sep 12, 2024
a6b791e
fix lint
lakchote Sep 12, 2024
215bb66
fix style
lakchote Sep 12, 2024
9c7ceea
Merge branch 'main' into lucien/search-savedSearches
lakchote Sep 13, 2024
0fc1098
fix prettier
lakchote Sep 13, 2024
5351e5a
fix saved searches display
lakchote Sep 13, 2024
f897ab4
remove onyx code for saved searches (will be done in polish phase)
lakchote Sep 13, 2024
36936b6
fix condition
lakchote Sep 13, 2024
c04e7a1
make the popover menu scrollable
lakchote Sep 13, 2024
4acd1cc
fix item highlight with saved search
lakchote Sep 13, 2024
6e91abd
hide save search if no filters
lakchote Sep 13, 2024
a157b36
fix style
lakchote Sep 13, 2024
2170426
reset filters when clicking on saved search
lakchote Sep 13, 2024
77488c1
fix console warning
lakchote Sep 13, 2024
a3f2b23
fix lint
lakchote Sep 13, 2024
0231886
proper naming for onyx key
lakchote Sep 13, 2024
30d7a1d
use translation
lakchote Sep 13, 2024
fa5a70f
use proper naming
lakchote Sep 13, 2024
393664f
fix style
lakchote Sep 13, 2024
8b4f4e0
fix default queryJSON
lakchote Sep 13, 2024
2dc08e9
improve code
lakchote Sep 13, 2024
afaa391
Merge branch 'main' into lucien/search-savedSearches
lakchote Sep 13, 2024
0b2b8f0
fix react compiler
lakchote Sep 13, 2024
2f7162d
remove unneeded condition
lakchote Sep 13, 2024
b076f54
fix lint
lakchote Sep 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/images/bookmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ 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 hide gbr tooltip */
NVP_SHOULD_HIDE_GBR_TOOLTIP: 'nvp_should_hide_gbr_tooltip',

Expand Down Expand Up @@ -424,6 +427,9 @@ const ONYXKEYS = {
/** Stores the route to open after changing app permission from settings */
LAST_ROUTE: 'lastRoute',

/** Stores the information about the saved searches */
SAVED_SEARCHES: 'nvp_savedSearches',

/** Stores recently used currencies */
RECENTLY_USED_CURRENCIES: 'nvp_recentlyUsedCurrencies',

Expand Down Expand Up @@ -668,6 +674,8 @@ const ONYXKEYS = {
SAGE_INTACCT_DIMENSION_TYPE_FORM_DRAFT: 'sageIntacctDimensionTypeFormDraft',
SEARCH_ADVANCED_FILTERS_FORM: 'searchAdvancedFiltersForm',
SEARCH_ADVANCED_FILTERS_FORM_DRAFT: 'searchAdvancedFiltersFormDraft',
SEARCH_SAVED_SEARCH_RENAME_FORM: 'searchSavedSearchRenameForm',
SEARCH_SAVED_SEARCH_RENAME_FORM_DRAFT: 'searchSavedSearchRenameFormDraft',
TEXT_PICKER_MODAL_FORM: 'textPickerModalForm',
TEXT_PICKER_MODAL_FORM_DRAFT: 'textPickerModalFormDraft',
RULES_CUSTOM_NAME_MODAL_FORM: 'rulesCustomNameModalForm',
Expand Down Expand Up @@ -777,6 +785,7 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.RULES_REQUIRED_RECEIPT_AMOUNT_FORM]: FormTypes.RulesRequiredReceiptAmountForm;
[ONYXKEYS.FORMS.RULES_MAX_EXPENSE_AMOUNT_FORM]: FormTypes.RulesMaxExpenseAmountForm;
[ONYXKEYS.FORMS.RULES_MAX_EXPENSE_AGE_FORM]: FormTypes.RulesMaxExpenseAgeForm;
[ONYXKEYS.FORMS.SEARCH_SAVED_SEARCH_RENAME_FORM]: FormTypes.SearchSavedSearchRenameForm;
};

type OnyxFormDraftValuesMapping = {
Expand Down Expand Up @@ -842,6 +851,7 @@ type OnyxValuesMapping = {

// ONYXKEYS.NVP_TRYNEWDOT is HybridApp onboarding data
[ONYXKEYS.NVP_TRYNEWDOT]: OnyxTypes.TryNewDot;
[ONYXKEYS.SAVED_SEARCHES]: OnyxTypes.SaveSearch[];
[ONYXKEYS.RECENTLY_USED_CURRENCIES]: string[];
[ONYXKEYS.ACTIVE_CLIENTS]: string[];
[ONYXKEYS.DEVICE_ID]: string;
Expand Down Expand Up @@ -976,6 +986,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;
};

type OnyxValues = OnyxValuesMapping & OnyxCollectionValuesMapping & OnyxFormValuesMapping & OnyxFormDraftValuesMapping;
Expand Down
4 changes: 4 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const ROUTES = {
route: 'search',
getRoute: ({query}: {query: SearchQueryString}) => `search?q=${encodeURIComponent(query)}` as const,
},
SEARCH_SAVED_SEARCH_RENAME: {
route: 'search/saved-search/rename',
getRoute: ({name, jsonQuery}: {name: string; jsonQuery: SearchQueryString}) => `search/saved-search/rename?name=${name}&q=${jsonQuery}` as const,
},
SEARCH_ADVANCED_FILTERS: 'search/filters',
SEARCH_ADVANCED_FILTERS_DATE: 'search/filters/date',
SEARCH_ADVANCED_FILTERS_CURRENCY: 'search/filters/currency',
Expand Down
2 changes: 2 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const SCREENS = {
ADVANCED_FILTERS_TAG_RHP: 'Search_Advanced_Filters_Tag_RHP',
ADVANCED_FILTERS_FROM_RHP: 'Search_Advanced_Filters_From_RHP',
ADVANCED_FILTERS_TO_RHP: 'Search_Advanced_Filters_To_RHP',
SAVED_SEARCH_RENAME_RHP: 'Search_Saved_Search_Rename_RHP',
lakchote marked this conversation as resolved.
Show resolved Hide resolved
ADVANCED_FILTERS_IN_RHP: 'Search_Advanced_Filters_In_RHP',
TRANSACTION_HOLD_REASON_RHP: 'Search_Transaction_Hold_Reason_RHP',
BOTTOM_TAB: 'Search_Bottom_Tab',
Expand Down Expand Up @@ -172,6 +173,7 @@ const SCREENS = {
TRAVEL: 'Travel',
SEARCH_REPORT: 'SearchReport',
SEARCH_ADVANCED_FILTERS: 'SearchAdvancedFilters',
SEARCH_SAVED_SEARCH: 'SearchSavedSearch',
SETTINGS_CATEGORIES: 'SettingsCategories',
RESTRICTED_ACTION: 'RestrictedAction',
REPORT_EXPORT: 'Report_Export',
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Expensicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Bell from '@assets/images/bell.svg';
import BellSlash from '@assets/images/bellSlash.svg';
import Bill from '@assets/images/bill.svg';
import Bolt from '@assets/images/bolt.svg';
import Bookmark from '@assets/images/bookmark.svg';
import Box from '@assets/images/box.svg';
import Briefcase from '@assets/images/briefcase.svg';
import Bug from '@assets/images/bug.svg';
Expand Down Expand Up @@ -397,5 +398,6 @@ export {
Feed,
Table,
SpreadsheetComputer,
Bookmark,
Star,
};
33 changes: 31 additions & 2 deletions src/components/MenuItemList.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, {useRef} from 'react';
import type {GestureResponderEvent, View} from 'react-native';
import type {GestureResponderEvent, StyleProp, View, ViewStyle} from 'react-native';
import useSingleExecution from '@hooks/useSingleExecution';
import * as ReportActionContextMenu from '@pages/home/report/ContextMenu/ReportActionContextMenu';
import CONST from '@src/CONST';
import type * as OnyxCommon from '@src/types/onyx/OnyxCommon';
import type IconAsset from '@src/types/utils/IconAsset';
import type {MenuItemProps} from './MenuItem';
import MenuItem from './MenuItem';
import OfflineWithFeedback from './OfflineWithFeedback';
Expand Down Expand Up @@ -36,9 +37,32 @@ type MenuItemListProps = {

/** Whether or not to use the single execution hook */
shouldUseSingleExecution?: boolean;

/** Any additional styles to apply for each item */
wrapperStyle?: StyleProp<ViewStyle>;

/** Icon to display on the left side of each item */
icon?: IconAsset;

/** Icon Width */
iconWidth?: number;

/** Icon Height */
iconHeight?: number;

/** Is this in the Pane */
isPaneMenu?: boolean;
};

function MenuItemList({menuItems = [], shouldUseSingleExecution = false}: MenuItemListProps) {
function MenuItemList({
menuItems = [],
shouldUseSingleExecution = false,
wrapperStyle = {},
icon = undefined,
iconWidth = undefined,
iconHeight = undefined,
isPaneMenu = false,
}: MenuItemListProps) {
const popoverAnchor = useRef<View>(null);
const {isExecuting, singleExecution} = useSingleExecution();

Expand Down Expand Up @@ -67,9 +91,14 @@ function MenuItemList({menuItems = [], shouldUseSingleExecution = false}: MenuIt
>
<MenuItem
key={menuItemProps.key ?? menuItemProps.title}
wrapperStyle={wrapperStyle}
onSecondaryInteraction={menuItemProps.link !== undefined ? (e) => secondaryInteraction(menuItemProps.link, e) : undefined}
ref={popoverAnchor}
shouldBlockSelection={!!menuItemProps.link}
icon={icon}
iconWidth={iconWidth}
iconHeight={iconHeight}
isPaneMenu={isPaneMenu}
// eslint-disable-next-line react/jsx-props-no-spreading
{...menuItemProps}
disabled={!!menuItemProps.disabled || isExecuting}
Expand Down
23 changes: 17 additions & 6 deletions src/components/PopoverMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import lodashIsEqual from 'lodash/isEqual';
import type {RefObject} from 'react';
import React, {useLayoutEffect, useState} from 'react';
import {StyleSheet, View} from 'react-native';
import {StyleSheet} from 'react-native';
import type {View} from 'react-native';
import type {ModalProps} from 'react-native-modal';
import useArrowKeyFocusManager from '@hooks/useArrowKeyFocusManager';
import useKeyboardShortcut from '@hooks/useKeyboardShortcut';
Expand All @@ -20,6 +21,7 @@ import type {MenuItemProps} from './MenuItem';
import MenuItem from './MenuItem';
import type BaseModalProps from './Modal/types';
import PopoverWithMeasuredContent from './PopoverWithMeasuredContent';
import ScrollView from './ScrollView';
import Text from './Text';

type PopoverMenuItem = MenuItemProps & {
Expand All @@ -42,6 +44,9 @@ type PopoverMenuItem = MenuItemProps & {
* It is meant to be used in situations where, after clicking on the modal, another one is opened.
*/
shouldCallAfterModalHide?: boolean;

/** Whether to close all modals */
shouldCloseAllModals?: boolean;
};

type PopoverModalProps = Pick<ModalProps, 'animationIn' | 'animationOut' | 'animationInTiming'>;
Expand Down Expand Up @@ -142,9 +147,13 @@ function PopoverMenu({
setFocusedIndex(selectedSubMenuItemIndex);
} else if (selectedItem.shouldCallAfterModalHide && !Browser.isSafari()) {
onItemSelected(selectedItem, index);
Modal.close(() => {
selectedItem.onSelected?.();
});
Modal.close(
() => {
selectedItem.onSelected?.();
},
undefined,
selectedItem.shouldCloseAllModals,
);
} else {
onItemSelected(selectedItem, index);
selectedItem.onSelected?.();
Expand Down Expand Up @@ -247,7 +256,7 @@ function PopoverMenu({
restoreFocusType={restoreFocusType}
>
<FocusTrapForModal active={isVisible}>
<View style={isSmallScreenWidth ? {} : styles.createMenuContainer}>
<ScrollView style={isSmallScreenWidth ? {} : styles.createMenuContainer}>
Copy link
Contributor

Choose a reason for hiding this comment

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

We are looking to do something similar here but we want the scrollview to exclude the title (title should be fixed). We will move this ScrollView to wrap only currentMenuItems. Let us know if you see a reason not to do so.

{renderHeaderText()}
{enteredSubMenuIndexes.length > 0 && renderBackButtonItem()}
{currentMenuItems.map((item, menuIndex) => (
Expand All @@ -269,7 +278,9 @@ function PopoverMenu({
focused={focusedIndex === menuIndex}
displayInDefaultIconColor={item.displayInDefaultIconColor}
shouldShowRightIcon={item.shouldShowRightIcon}
shouldShowRightComponent={item.shouldShowRightComponent}
iconRight={item.iconRight}
rightComponent={item.rightComponent}
shouldPutLeftPaddingWhenNoIcon={item.shouldPutLeftPaddingWhenNoIcon}
label={item.label}
style={{backgroundColor: item.isSelected ? theme.activeComponentBG : undefined}}
Expand All @@ -293,7 +304,7 @@ function PopoverMenu({
badgeText={item.badgeText}
/>
))}
</View>
</ScrollView>
</FocusTrapForModal>
</PopoverWithMeasuredContent>
);
Expand Down
47 changes: 47 additions & 0 deletions src/hooks/useDeleteSavedSearch.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React, {useState} from 'react';
import ConfirmModal from '@components/ConfirmModal';
import Navigation from '@libs/Navigation/Navigation';
import * as SearchUtils from '@libs/SearchUtils';
import * as SearchActions from '@userActions/Search';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import useLocalize from './useLocalize';

export default function useDeleteSavedSearch() {
const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false);
const [hashToDelete, setHashToDelete] = useState(0);
const {translate} = useLocalize();

const showDeleteModal = (hash: number) => {
setIsDeleteModalVisible(true);
setHashToDelete(hash);
};

const handleDelete = () => {
SearchActions.deleteSavedSearch(hashToDelete);
setIsDeleteModalVisible(false);
SearchActions.clearAdvancedFilters();
Navigation.navigate(
ROUTES.SEARCH_CENTRAL_PANE.getRoute({
query: SearchUtils.buildCannedSearchQuery(CONST.SEARCH.DATA_TYPES.EXPENSE, CONST.SEARCH.STATUS.EXPENSE.ALL),
}),
);
};

function DeleteConfirmModal() {
return (
<ConfirmModal
title={translate('search.deleteSavedSearch')}
onConfirm={handleDelete}
onCancel={() => setIsDeleteModalVisible(false)}
isVisible={isDeleteModalVisible}
prompt={translate('search.deleteSavedSearchConfirm')}
confirmText={translate('common.delete')}
cancelText={translate('common.cancel')}
danger
/>
);
}

return {showDeleteModal, DeleteConfirmModal};
}
7 changes: 7 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ export default {
sent: 'Sent',
links: 'Links',
days: 'days',
rename: 'Rename',
},
location: {
useCurrent: 'Use current location',
Expand Down Expand Up @@ -4005,6 +4006,12 @@ export default {
buttonText: 'Book a trip',
},
},
saveSearch: 'Save search',
saveSearchTooltipText: 'You can rename your saved search',
deleteSavedSearch: 'Delete saved search',
deleteSavedSearchConfirm: 'Are you sure you want to delete this search?',
searchName: 'Search name',
savedSearchesMenuItemTitle: 'Saved',
groupedExpenses: 'grouped expenses',
bulkActions: {
delete: 'Delete',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export default {
comma: 'la coma',
semicolon: 'el punto y coma',
please: 'Por favor',
rename: 'Renombrar',
contactUs: 'contáctenos',
pleaseEnterEmailOrPhoneNumber: 'Por favor, escribe un email o número de teléfono',
fixTheErrors: 'corrige los errores',
Expand Down Expand Up @@ -4056,6 +4057,12 @@ export default {
buttonText: 'Reserva un viaje',
},
},
saveSearch: 'Guardar búsqueda',
saveSearchTooltipText: 'Puedes cambiar el nombre de tu búsqueda guardada',
savedSearchesMenuItemTitle: 'Guardadas',
searchName: 'Nombre de la búsqueda',
deleteSavedSearch: 'Eliminar búsqueda guardada',
deleteSavedSearchConfirm: '¿Estás seguro de que quieres eliminar esta búsqueda?',
groupedExpenses: 'gastos agrupados',
bulkActions: {
delete: 'Eliminar',
Expand Down
5 changes: 5 additions & 0 deletions src/libs/API/parameters/DeleteSavedSearch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type DeleteSavedSearchParams = {
hash: number;
};

export default DeleteSavedSearchParams;
8 changes: 8 additions & 0 deletions src/libs/API/parameters/SaveSearch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type {SearchQueryString} from '@components/Search/types';

type SaveSearchParams = {
jsonQuery: SearchQueryString;
name?: string;
};

export default SaveSearchParams;
2 changes: 2 additions & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ export type {default as EnablePolicyCompanyCardsParams} from './EnablePolicyComp
export type {default as ToggleCardContinuousReconciliationParams} from './ToggleCardContinuousReconciliationParams';
export type {default as CardDeactivateParams} from './CardDeactivateParams';
export type {default as UpdateExpensifyCardLimitTypeParams} from './UpdateExpensifyCardLimitTypeParams';
export type {default as SaveSearchParams} from './SaveSearch';
export type {default as DeleteSavedSearchParams} from './DeleteSavedSearch';
export type {default as SetPolicyCategoryReceiptsRequiredParams} from './SetPolicyCategoryReceiptsRequiredParams';
export type {default as RemovePolicyCategoryReceiptsRequiredParams} from './RemovePolicyCategoryReceiptsRequiredParams';
export type {default as UpdateQuickbooksOnlineAutoCreateVendorParams} from './UpdateQuickbooksOnlineAutoCreateVendorParams';
Expand Down
4 changes: 4 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ const WRITE_COMMANDS = {
CREATE_ADMIN_ISSUED_VIRTUAL_CARD: 'CreateAdminIssuedVirtualCard',
ADD_DELEGATE: 'AddDelegate',
TOGGLE_CARD_CONTINUOUS_RECONCILIATION: 'ToggleCardContinuousReconciliation',
SAVE_SEARCH: 'SaveSearch',
DELETE_SAVED_SEARCH: 'DeleteSavedSearch',
UPDATE_CARD_SETTLEMENT_FREQUENCY: 'UpdateCardSettlementFrequency',
UPDATE_CARD_SETTLEMENT_ACCOUNT: 'UpdateCardSettlementAccount',
UPDATE_XERO_IMPORT_TRACKING_CATEGORIES: 'UpdateXeroImportTrackingCategories',
Expand Down Expand Up @@ -775,6 +777,8 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.CREATE_ADMIN_ISSUED_VIRTUAL_CARD]: Omit<Parameters.CreateExpensifyCardParams, 'feedCountry'>;
[WRITE_COMMANDS.ADD_DELEGATE]: Parameters.AddDelegateParams;
[WRITE_COMMANDS.TOGGLE_CARD_CONTINUOUS_RECONCILIATION]: Parameters.ToggleCardContinuousReconciliationParams;
[WRITE_COMMANDS.SAVE_SEARCH]: Parameters.SaveSearchParams;
[WRITE_COMMANDS.DELETE_SAVED_SEARCH]: Parameters.DeleteSavedSearchParams;
[WRITE_COMMANDS.UPDATE_CARD_SETTLEMENT_FREQUENCY]: Parameters.UpdateCardSettlementFrequencyParams;
[WRITE_COMMANDS.UPDATE_CARD_SETTLEMENT_ACCOUNT]: Parameters.UpdateCardSettlementAccountParams;
[WRITE_COMMANDS.SET_MISSING_PERSONAL_DETAILS_AND_SHIP_EXPENSIFY_CARD]: Parameters.SetMissingPersonalDetailsAndShipExpensifyCardParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
RoomMembersNavigatorParamList,
SearchAdvancedFiltersParamList,
SearchReportParamList,
SearchSavedSearchParamList,
SettingsNavigatorParamList,
SignInNavigatorParamList,
SplitDetailsNavigatorParamList,
Expand Down Expand Up @@ -557,6 +558,10 @@ const SearchAdvancedFiltersModalStackNavigator = createModalStackNavigator<Searc
[SCREENS.SEARCH.ADVANCED_FILTERS_IN_RHP]: () => require<ReactComponentModule>('@pages/Search/SearchAdvancedFiltersPage/SearchFiltersInPage').default,
});

const SearchSavedSearchModalStackNavigator = createModalStackNavigator<SearchSavedSearchParamList>({
[SCREENS.SEARCH.SAVED_SEARCH_RENAME_RHP]: () => require<ReactComponentModule>('../../../../pages/Search/SavedSearchRenamePage').default,
});

const RestrictedActionModalStackNavigator = createModalStackNavigator<SearchReportParamList>({
[SCREENS.RESTRICTED_ACTION_ROOT]: () => require<ReactComponentModule>('../../../../pages/RestrictedAction/Workspace/WorkspaceRestrictedActionPage').default,
});
Expand Down Expand Up @@ -595,5 +600,6 @@ export {
SearchReportModalStackNavigator,
RestrictedActionModalStackNavigator,
SearchAdvancedFiltersModalStackNavigator,
SearchSavedSearchModalStackNavigator,
MissingPersonalDetailsModalStackNavigator,
};
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ function RightModalNavigator({navigation, route}: RightModalNavigatorProps) {
name={SCREENS.RIGHT_MODAL.SEARCH_ADVANCED_FILTERS}
component={ModalStackNavigators.SearchAdvancedFiltersModalStackNavigator}
/>
<Stack.Screen
name={SCREENS.RIGHT_MODAL.SEARCH_SAVED_SEARCH}
component={ModalStackNavigators.SearchSavedSearchModalStackNavigator}
/>
<Stack.Screen
name={SCREENS.RIGHT_MODAL.MISSING_PERSONAL_DETAILS}
component={ModalStackNavigators.MissingPersonalDetailsModalStackNavigator}
Expand Down
Loading
Loading