Skip to content

Commit 2cbefdd

Browse files
authored
Merge pull request Expensify#85295 from ReaperOAK/fix/merchant-rules-quick-filter
Add quick filter search bar for workspace merchant rules
2 parents cc68ab5 + eb4ed17 commit 2cbefdd

14 files changed

Lines changed: 48 additions & 7 deletions

File tree

src/CONST/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4513,7 +4513,7 @@ const CONST = {
45134513
FORM_CHARACTER_LIMIT: 50,
45144514
STANDARD_LENGTH_LIMIT: 100,
45154515
STANDARD_LIST_ITEM_LIMIT: 12,
4516-
APPROVAL_WORKFLOW_SEARCH_LIMIT: 3,
4516+
SEARCH_BAR_THRESHOLD: 3,
45174517
LEGAL_NAMES_CHARACTER_LIMIT: 150,
45184518
LOGIN_CHARACTER_LIMIT: 254,
45194519
CATEGORY_NAME_LIMIT: 256,

src/components/SearchBar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ type SearchBarProps = {
1919
onSubmitEditing?: (text: string) => void;
2020
style?: StyleProp<ViewStyle>;
2121
shouldShowEmptyState?: boolean;
22+
emptyStateContainerStyle?: StyleProp<ViewStyle>;
2223
};
2324

24-
function SearchBar({label, style, icon, inputValue, onChangeText, onSubmitEditing, shouldShowEmptyState}: SearchBarProps) {
25+
function SearchBar({label, style, icon, inputValue, onChangeText, onSubmitEditing, shouldShowEmptyState, emptyStateContainerStyle}: SearchBarProps) {
2526
const styles = useThemeStyles();
2627
const {shouldUseNarrowLayout} = useResponsiveLayout();
2728
const {translate} = useLocalize();
@@ -51,7 +52,7 @@ function SearchBar({label, style, icon, inputValue, onChangeText, onSubmitEditin
5152
/>
5253
</View>
5354
{shouldAnnounceNoResults && (
54-
<View style={[styles.ph5, styles.pt3, styles.pb5]}>
55+
<View style={[styles.ph5, styles.pt3, styles.pb5, emptyStateContainerStyle]}>
5556
<Text
5657
style={[styles.textNormal, styles.colorMuted]}
5758
aria-hidden

src/languages/de.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6692,6 +6692,7 @@ Fordern Sie Spesendetails wie Belege und Beschreibungen an, legen Sie Limits und
66926692
duplicateRulePrompt: (merchantName: string) => `Ihre bestehende Regel für „${merchantName}“ hat Vorrang vor dieser. Trotzdem speichern?`,
66936693
saveAnyway: 'Trotzdem speichern',
66946694
applyToExistingUnsubmittedExpenses: 'Auf bestehende nicht eingereichte Ausgaben anwenden',
6695+
findRule: 'Händlerregel finden',
66956696
},
66966697
categoryRules: {
66976698
title: 'Kategorienregeln',

src/languages/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6649,6 +6649,7 @@ const translations = {
66496649
title: 'Merchant',
66506650
subtitle: 'Set the merchant rules so expenses arrive correctly coded and require less cleanup.',
66516651
addRule: 'Add merchant rule',
6652+
findRule: 'Find merchant rule',
66526653
addRuleTitle: 'Add rule',
66536654
editRuleTitle: 'Edit rule',
66546655
expensesWith: 'For expenses with:',

src/languages/es.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6561,6 +6561,7 @@ ${amount} para ${merchant} - ${date}`,
65616561
title: 'Comerciante',
65626562
subtitle: 'Configura las reglas de comerciante para que los gastos lleguen correctamente codificados y requieran menos limpieza.',
65636563
addRule: 'Añadir regla de comerciante',
6564+
findRule: 'Buscar regla de comerciante',
65646565
addRuleTitle: 'Añadir regla',
65656566
editRuleTitle: 'Editar regla',
65666567
expensesWith: 'Para gastos con:',

src/languages/fr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6714,6 +6714,7 @@ Rendez obligatoires des informations de dépense comme les reçus et les descrip
67146714
duplicateRulePrompt: (merchantName: string) => `Votre règle existante pour « ${merchantName} » aura la priorité sur celle-ci. Enregistrer quand même ?`,
67156715
saveAnyway: 'Enregistrer quand même',
67166716
applyToExistingUnsubmittedExpenses: 'Appliquer aux dépenses non soumises existantes',
6717+
findRule: 'Règle de recherche de commerçant',
67176718
},
67186719
categoryRules: {
67196720
title: 'Règles de catégorie',

src/languages/it.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6679,6 +6679,7 @@ Richiedi dettagli sulle spese come ricevute e descrizioni, imposta limiti e valo
66796679
duplicateRulePrompt: (merchantName: string) => `La regola esistente per "${merchantName}" avrà la priorità su questa. Salvare comunque?`,
66806680
saveAnyway: 'Salva comunque',
66816681
applyToExistingUnsubmittedExpenses: 'Applica alle spese esistenti non inviate',
6682+
findRule: 'Trova regola esercente',
66826683
},
66836684
categoryRules: {
66846685
title: 'Regole di categoria',

src/languages/ja.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6608,6 +6608,7 @@ ${reportName}
66086608
duplicateRulePrompt: (merchantName: string) => `「${merchantName}」に対する既存のルールが、このルールよりも優先されます。保存しますか?`,
66096609
saveAnyway: 'とにかく保存',
66106610
applyToExistingUnsubmittedExpenses: '既存の未提出経費に適用',
6611+
findRule: '加盟店ルールを検索',
66116612
},
66126613
categoryRules: {
66136614
title: 'カテゴリルール',

src/languages/nl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6661,6 +6661,7 @@ Vereis onkostendetails zoals bonnen en beschrijvingen, stel limieten en standaar
66616661
duplicateRulePrompt: (merchantName: string) => `Je bestaande regel voor ‘${merchantName}’ krijgt voorrang op deze regel. Toch opslaan?`,
66626662
saveAnyway: 'Toch opslaan',
66636663
applyToExistingUnsubmittedExpenses: 'Toepassen op bestaande niet-ingediende uitgaven',
6664+
findRule: 'Zoek handelsregel',
66646665
},
66656666
categoryRules: {
66666667
title: 'Categorisatieregels',

src/languages/pl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6653,6 +6653,7 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i
66536653
duplicateRulePrompt: (merchantName: string) => `Twoja istniejąca reguła dla „${merchantName}” będzie mieć pierwszeństwo przed tą. Zapisać mimo to?`,
66546654
saveAnyway: 'Zapisz mimo to',
66556655
applyToExistingUnsubmittedExpenses: 'Zastosuj do istniejących niewysłanych wydatków',
6656+
findRule: 'Znajdź regułę sprzedawcy',
66566657
},
66576658
categoryRules: {
66586659
title: 'Reguły kategorii',

0 commit comments

Comments
 (0)