From 8fd23a6da23d051a537500d77cc88428beae63ac Mon Sep 17 00:00:00 2001 From: Wiktor Gut Date: Wed, 17 Jul 2024 14:27:50 +0200 Subject: [PATCH 1/3] date advanced filter rhp, empty --- src/ROUTES.ts | 5 +++ src/SCREENS.ts | 1 + src/languages/en.ts | 7 ++++ src/languages/es.ts | 7 ++++ .../ModalStackNavigators/index.tsx | 2 +- src/libs/Navigation/linkingConfig/config.ts | 1 + src/pages/Search/SearchAdvancedFilterDate.tsx | 32 +++++++++++++++++++ 7 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/pages/Search/SearchAdvancedFilterDate.tsx diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 3189affe7c33..9ed150537263 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -54,6 +54,11 @@ const ROUTES = { getRoute: (query: string) => `search/${query}/filters` as const, }, + SEARCH_ADVANCED_FILTERS_DATE: { + route: '/search/filters/date', + getRoute: () => `search/filters/date` as const, + }, + SEARCH_REPORT: { route: '/search/:query/view/:reportID', getRoute: (query: string, reportID: string) => `search/${query}/view/${reportID}` as const, diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 60760d655f22..c188e57f862a 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -147,6 +147,7 @@ const SCREENS = { TRAVEL: 'Travel', SEARCH_REPORT: 'SearchReport', SEARCH_ADVANCED_FILTERS: 'SearchAdvancedFilters', + SEARCH_ADVANCES_FILTER_DATE: 'SearchAdvancedFilterDate', SETTINGS_CATEGORIES: 'SettingsCategories', RESTRICTED_ACTION: 'RestrictedAction', }, diff --git a/src/languages/en.ts b/src/languages/en.ts index 01313d9ec0fd..15fa37b88f05 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3479,6 +3479,13 @@ export default { noOptionsAvailable: 'No options available for the selected group of expenses.', }, filtersHeader: 'Filters', + filters: { + date: { + header: 'Date', + before: 'Before', + after: 'After', + }, + }, }, genericErrorPage: { title: 'Uh-oh, something went wrong!', diff --git a/src/languages/es.ts b/src/languages/es.ts index 72128b43842a..e65019ab4275 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3530,6 +3530,13 @@ export default { noOptionsAvailable: 'No hay opciones disponibles para el grupo de gastos seleccionado.', }, filtersHeader: 'Filtros', + filters: { + date: { + header: 'Fecha', + before: 'Antes', + after: 'Después', + }, + }, }, genericErrorPage: { title: '¡Oh-oh, algo salió mal!', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index ac6b104465ad..af2412600aa6 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -31,7 +31,6 @@ import type { TravelNavigatorParamList, WalletStatementNavigatorParamList, } from '@navigation/types'; -import SearchAdvancedFiltersPage from '@pages/Search/SearchAdvancedFiltersPage'; import type {ThemeStyles} from '@styles/index'; import type {Screen} from '@src/SCREENS'; import SCREENS from '@src/SCREENS'; @@ -494,6 +493,7 @@ const SearchReportModalStackNavigator = createModalStackNavigator({ [SCREENS.SEARCH.ADVANCED_FILTERS_RHP]: () => require('../../../../pages/Search/SearchAdvancedFiltersPage').default, + [SCREENS.RIGHT_MODAL.SEARCH_ADVANCES_FILTER_DATE]: () => require('../../../../pages/Search/SearchAdvancedFilterDate').default, }); const RestrictedActionModalStackNavigator = createModalStackNavigator({ diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index aea87f40e6e0..5cdfb146831a 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -959,6 +959,7 @@ const config: LinkingOptions['config'] = { [SCREENS.RIGHT_MODAL.SEARCH_ADVANCED_FILTERS]: { screens: { [SCREENS.SEARCH.ADVANCED_FILTERS_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS.route, + [SCREENS.RIGHT_MODAL.SEARCH_ADVANCES_FILTER_DATE]: ROUTES.SEARCH_ADVANCED_FILTERS_DATE.route, }, }, [SCREENS.RIGHT_MODAL.RESTRICTED_ACTION]: { diff --git a/src/pages/Search/SearchAdvancedFilterDate.tsx b/src/pages/Search/SearchAdvancedFilterDate.tsx new file mode 100644 index 000000000000..30d7ddd95eec --- /dev/null +++ b/src/pages/Search/SearchAdvancedFilterDate.tsx @@ -0,0 +1,32 @@ +import React from 'react'; +import {View} from 'react-native'; +import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; +import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import ScreenWrapper from '@components/ScreenWrapper'; +import useLocalize from '@hooks/useLocalize'; +import useThemeStyles from '@hooks/useThemeStyles'; +import Text from '@src/components/Text'; + +function SearchAdvancedFilterDate() { + const styles = useThemeStyles(); + const {translate} = useLocalize(); + + return ( + + + + + Here will be search advanced filter: Date + + + + ); +} + +SearchAdvancedFilterDate.displayName = 'SearchAdvancedFilterDate'; + +export default SearchAdvancedFilterDate; From a141d0eb742141f4ed33cbb651f394afc2fffc2d Mon Sep 17 00:00:00 2001 From: Wiktor Gut Date: Wed, 17 Jul 2024 16:04:14 +0200 Subject: [PATCH 2/3] updating pr with resolving comments --- src/SCREENS.ts | 2 +- src/languages/en.ts | 1 - src/languages/es.ts | 1 - .../AppNavigator/ModalStackNavigators/index.tsx | 2 +- src/libs/Navigation/linkingConfig/config.ts | 9 +++++---- ...dvancedFilterDate.tsx => SearchFiltersDatePage.tsx} | 10 +++++----- tsconfig.json | 1 + 7 files changed, 13 insertions(+), 13 deletions(-) rename src/pages/Search/{SearchAdvancedFilterDate.tsx => SearchFiltersDatePage.tsx} (75%) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index c188e57f862a..5844cb2a58e9 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -31,6 +31,7 @@ const SCREENS = { CENTRAL_PANE: 'Search_Central_Pane', REPORT_RHP: 'Search_Report_RHP', ADVANCED_FILTERS_RHP: 'Search_Advanced_Filters_RHP', + ADVANCED_FILTERS_DATE_RHP: 'SearchFiltersDatePage', TRANSACTION_HOLD_REASON_RHP: 'Search_Transaction_Hold_Reason_RHP', BOTTOM_TAB: 'Search_Bottom_Tab', }, @@ -147,7 +148,6 @@ const SCREENS = { TRAVEL: 'Travel', SEARCH_REPORT: 'SearchReport', SEARCH_ADVANCED_FILTERS: 'SearchAdvancedFilters', - SEARCH_ADVANCES_FILTER_DATE: 'SearchAdvancedFilterDate', SETTINGS_CATEGORIES: 'SettingsCategories', RESTRICTED_ACTION: 'RestrictedAction', }, diff --git a/src/languages/en.ts b/src/languages/en.ts index 15fa37b88f05..7c525563de6f 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3481,7 +3481,6 @@ export default { filtersHeader: 'Filters', filters: { date: { - header: 'Date', before: 'Before', after: 'After', }, diff --git a/src/languages/es.ts b/src/languages/es.ts index e65019ab4275..084ecd64d663 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3532,7 +3532,6 @@ export default { filtersHeader: 'Filtros', filters: { date: { - header: 'Fecha', before: 'Antes', after: 'Después', }, diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index af2412600aa6..4d2f970a967a 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -493,7 +493,7 @@ const SearchReportModalStackNavigator = createModalStackNavigator({ [SCREENS.SEARCH.ADVANCED_FILTERS_RHP]: () => require('../../../../pages/Search/SearchAdvancedFiltersPage').default, - [SCREENS.RIGHT_MODAL.SEARCH_ADVANCES_FILTER_DATE]: () => require('../../../../pages/Search/SearchAdvancedFilterDate').default, + [SCREENS.SEARCH.ADVANCED_FILTERS_DATE_RHP]: () => require('../../../../pages/Search/SearchFiltersDatePage').default, }); const RestrictedActionModalStackNavigator = createModalStackNavigator({ diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 5cdfb146831a..30c89cc9a62d 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -1,10 +1,11 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import type {LinkingOptions} from '@react-navigation/native'; -import type {RootStackParamList} from '@navigation/types'; +import type { LinkingOptions } from '@react-navigation/native'; +import type { RootStackParamList } from '@navigation/types'; import NAVIGATORS from '@src/NAVIGATORS'; import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; + // Moved to a separate file to avoid cyclic dependencies. const config: LinkingOptions['config'] = { initialRouteName: NAVIGATORS.BOTTOM_TAB_NAVIGATOR, @@ -959,7 +960,7 @@ const config: LinkingOptions['config'] = { [SCREENS.RIGHT_MODAL.SEARCH_ADVANCED_FILTERS]: { screens: { [SCREENS.SEARCH.ADVANCED_FILTERS_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS.route, - [SCREENS.RIGHT_MODAL.SEARCH_ADVANCES_FILTER_DATE]: ROUTES.SEARCH_ADVANCED_FILTERS_DATE.route, + [SCREENS.SEARCH.ADVANCED_FILTERS_DATE_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS_DATE.route, }, }, [SCREENS.RIGHT_MODAL.RESTRICTED_ACTION]: { @@ -1026,4 +1027,4 @@ const config: LinkingOptions['config'] = { }, }; -export default config; +export default config; \ No newline at end of file diff --git a/src/pages/Search/SearchAdvancedFilterDate.tsx b/src/pages/Search/SearchFiltersDatePage.tsx similarity index 75% rename from src/pages/Search/SearchAdvancedFilterDate.tsx rename to src/pages/Search/SearchFiltersDatePage.tsx index 30d7ddd95eec..570de3ab5481 100644 --- a/src/pages/Search/SearchAdvancedFilterDate.tsx +++ b/src/pages/Search/SearchFiltersDatePage.tsx @@ -7,18 +7,18 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import Text from '@src/components/Text'; -function SearchAdvancedFilterDate() { +function SearchFiltersDatePage() { const styles = useThemeStyles(); const {translate} = useLocalize(); return ( - + Here will be search advanced filter: Date @@ -27,6 +27,6 @@ function SearchAdvancedFilterDate() { ); } -SearchAdvancedFilterDate.displayName = 'SearchAdvancedFilterDate'; +SearchFiltersDatePage.displayName = 'SearchFiltersDatePage'; -export default SearchAdvancedFilterDate; +export default SearchFiltersDatePage; diff --git a/tsconfig.json b/tsconfig.json index 16497c29b8cb..2967e0f3154b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "expo/tsconfig.base", "compilerOptions": { + "jsx": "react", "module": "commonjs", "types": ["react-native", "jest"], "lib": ["DOM", "DOM.Iterable", "ESNext"], From 27b47692aed88e56e148f3a271dd958e6c101f72 Mon Sep 17 00:00:00 2001 From: Wiktor Gut Date: Wed, 17 Jul 2024 16:13:48 +0200 Subject: [PATCH 3/3] undo the tsconfig.json change --- tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 2967e0f3154b..16497c29b8cb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "expo/tsconfig.base", "compilerOptions": { - "jsx": "react", "module": "commonjs", "types": ["react-native", "jest"], "lib": ["DOM", "DOM.Iterable", "ESNext"],