-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Create description, merchant and reportID filters #46477
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
Merged
luacmartins
merged 8 commits into
Expensify:main
from
software-mansion-labs:@szymczak/create-description-merchant-reportID-filters
Aug 1, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
20270a8
add merchant, description and reportID to filters form
SzymczakJ a803827
add description, merchant and reportID filter pages
SzymczakJ 08381cd
add spanish translation
SzymczakJ 914688f
fix typos
SzymczakJ cd3187e
fix translations
SzymczakJ 9e3a1e5
fix spanish translations
SzymczakJ 8203284
Merge branch 'main' into @szymczak/create-description-merchant-repor…
SzymczakJ a80c186
add filters screens to CENTRAL_PANE_TO_RHP_MAPPING
SzymczakJ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import {useOnyx} from 'react-native-onyx'; | ||
| import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; | ||
| import FormProvider from '@components/Form/FormProvider'; | ||
| import InputWrapper from '@components/Form/InputWrapper'; | ||
| import type {FormOnyxValues} from '@components/Form/types'; | ||
| import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||
| import ScreenWrapper from '@components/ScreenWrapper'; | ||
| import TextInput from '@components/TextInput'; | ||
| import useAutoFocusInput from '@hooks/useAutoFocusInput'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import {updateAdvancedFilters} from '@libs/actions/Search'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import INPUT_IDS from '@src/types/form/SearchAdvancedFiltersForm'; | ||
|
|
||
| function SearchFiltersDescriptionPage() { | ||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
|
|
||
| const [searchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM); | ||
| const description = searchAdvancedFiltersForm?.[INPUT_IDS.DESCRIPTION]; | ||
| const {inputCallbackRef} = useAutoFocusInput(); | ||
|
|
||
| const updateDescriptionFilter = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM>) => { | ||
| updateAdvancedFilters(values); | ||
| Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS); | ||
| }; | ||
|
|
||
| return ( | ||
| <ScreenWrapper | ||
| testID={SearchFiltersDescriptionPage.displayName} | ||
| shouldShowOfflineIndicatorInWideScreen | ||
| offlineIndicatorStyle={styles.mtAuto} | ||
| > | ||
| <FullPageNotFoundView shouldShow={false}> | ||
| <HeaderWithBackButton | ||
| title={translate('common.description')} | ||
| onBackButtonPress={() => { | ||
| Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS); | ||
| }} | ||
| /> | ||
| <FormProvider | ||
| style={[styles.flex1, styles.ph5]} | ||
| formID={ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM} | ||
| onSubmit={updateDescriptionFilter} | ||
| submitButtonText={translate('common.save')} | ||
| enabledWhenOffline | ||
| > | ||
| <View style={styles.mb4}> | ||
| <InputWrapper | ||
| InputComponent={TextInput} | ||
| inputID={INPUT_IDS.DESCRIPTION} | ||
| name={INPUT_IDS.DESCRIPTION} | ||
| defaultValue={description} | ||
| maxLength={CONST.DESCRIPTION_LIMIT} | ||
| label={translate('common.description')} | ||
| accessibilityLabel={translate('common.description')} | ||
| role={CONST.ROLE.PRESENTATION} | ||
| ref={inputCallbackRef} | ||
| /> | ||
| </View> | ||
| </FormProvider> | ||
| </FullPageNotFoundView> | ||
| </ScreenWrapper> | ||
| ); | ||
| } | ||
|
|
||
| SearchFiltersDescriptionPage.displayName = 'SearchFiltersDescriptionPage'; | ||
|
|
||
| export default SearchFiltersDescriptionPage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import {useOnyx} from 'react-native-onyx'; | ||
| import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; | ||
| import FormProvider from '@components/Form/FormProvider'; | ||
| import InputWrapper from '@components/Form/InputWrapper'; | ||
| import type {FormOnyxValues} from '@components/Form/types'; | ||
| import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||
| import ScreenWrapper from '@components/ScreenWrapper'; | ||
| import TextInput from '@components/TextInput'; | ||
| import useAutoFocusInput from '@hooks/useAutoFocusInput'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import {updateAdvancedFilters} from '@libs/actions/Search'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import INPUT_IDS from '@src/types/form/SearchAdvancedFiltersForm'; | ||
|
|
||
| function SearchFiltersMerchantPage() { | ||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
|
|
||
| const [searchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM); | ||
| const merchant = searchAdvancedFiltersForm?.[INPUT_IDS.MERCHANT]; | ||
| const {inputCallbackRef} = useAutoFocusInput(); | ||
|
|
||
| const updateMerchantFilter = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM>) => { | ||
| updateAdvancedFilters(values); | ||
| Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS); | ||
| }; | ||
|
|
||
| return ( | ||
| <ScreenWrapper | ||
| testID={SearchFiltersMerchantPage.displayName} | ||
| shouldShowOfflineIndicatorInWideScreen | ||
| offlineIndicatorStyle={styles.mtAuto} | ||
| > | ||
| <FullPageNotFoundView shouldShow={false}> | ||
| <HeaderWithBackButton | ||
| title={translate('common.merchant')} | ||
| onBackButtonPress={() => { | ||
| Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS); | ||
| }} | ||
| /> | ||
| <FormProvider | ||
| style={[styles.flex1, styles.ph5]} | ||
| formID={ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM} | ||
| onSubmit={updateMerchantFilter} | ||
| submitButtonText={translate('common.save')} | ||
| enabledWhenOffline | ||
| > | ||
| <View style={styles.mb4}> | ||
| <InputWrapper | ||
| InputComponent={TextInput} | ||
| inputID={INPUT_IDS.MERCHANT} | ||
| name={INPUT_IDS.MERCHANT} | ||
| defaultValue={merchant} | ||
| maxLength={CONST.MERCHANT_NAME_MAX_LENGTH} | ||
| label={translate('common.merchant')} | ||
| accessibilityLabel={translate('common.merchant')} | ||
| role={CONST.ROLE.PRESENTATION} | ||
| ref={inputCallbackRef} | ||
| /> | ||
| </View> | ||
| </FormProvider> | ||
| </FullPageNotFoundView> | ||
| </ScreenWrapper> | ||
| ); | ||
| } | ||
|
|
||
| SearchFiltersMerchantPage.displayName = 'SearchFiltersMerchantPage'; | ||
|
|
||
| export default SearchFiltersMerchantPage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import {useOnyx} from 'react-native-onyx'; | ||
| import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; | ||
| import FormProvider from '@components/Form/FormProvider'; | ||
| import InputWrapper from '@components/Form/InputWrapper'; | ||
| import type {FormOnyxValues} from '@components/Form/types'; | ||
| import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||
| import ScreenWrapper from '@components/ScreenWrapper'; | ||
| import TextInput from '@components/TextInput'; | ||
| import useAutoFocusInput from '@hooks/useAutoFocusInput'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import {updateAdvancedFilters} from '@libs/actions/Search'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import INPUT_IDS from '@src/types/form/SearchAdvancedFiltersForm'; | ||
|
|
||
| function SearchFiltersReportIDPage() { | ||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
|
|
||
| const [searchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM); | ||
| const reportID = searchAdvancedFiltersForm?.[INPUT_IDS.REPORT_ID]; | ||
| const {inputCallbackRef} = useAutoFocusInput(); | ||
|
|
||
| const updateReportIDFilter = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM>) => { | ||
| updateAdvancedFilters(values); | ||
| Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS); | ||
| }; | ||
|
|
||
| return ( | ||
| <ScreenWrapper | ||
| testID={SearchFiltersReportIDPage.displayName} | ||
| shouldShowOfflineIndicatorInWideScreen | ||
| offlineIndicatorStyle={styles.mtAuto} | ||
| > | ||
| <FullPageNotFoundView shouldShow={false}> | ||
| <HeaderWithBackButton | ||
| title={translate('common.reportID')} | ||
| onBackButtonPress={() => { | ||
| Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS); | ||
| }} | ||
| /> | ||
| <FormProvider | ||
| style={[styles.flex1, styles.ph5]} | ||
| formID={ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM} | ||
| onSubmit={updateReportIDFilter} | ||
| submitButtonText={translate('common.save')} | ||
| enabledWhenOffline | ||
| > | ||
| <View style={styles.mb4}> | ||
| <InputWrapper | ||
| InputComponent={TextInput} | ||
| inputID={INPUT_IDS.REPORT_ID} | ||
| name={INPUT_IDS.REPORT_ID} | ||
| defaultValue={reportID} | ||
| label={translate('common.reportID')} | ||
| accessibilityLabel={translate('common.reportID')} | ||
| role={CONST.ROLE.PRESENTATION} | ||
| ref={inputCallbackRef} | ||
| /> | ||
| </View> | ||
| </FormProvider> | ||
| </FullPageNotFoundView> | ||
| </ScreenWrapper> | ||
| ); | ||
| } | ||
|
|
||
| SearchFiltersReportIDPage.displayName = 'SearchFiltersReportIDPage'; | ||
|
|
||
| export default SearchFiltersReportIDPage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏