Skip to content

[HOLD] Add travel type and travel platform search filters - #105437

Draft
blimpich wants to merge 6 commits into
mainfrom
blimpich-travelSearchFilters
Draft

blimpich wants to merge 6 commits into
mainfrom
blimpich-travelSearchFilters

Conversation

@blimpich

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds two expense filters to search: Travel type (air, hotel, car rental, rail, hotel block) and Travel platform (Expensify Travel or other). They work in the search bar (travel-type: and travel-platform:, with autocomplete) and in the advanced filters list. Admins can use them to find work travel that wasn't booked through Expensify Travel.

Held by Expensify/Auth#26078, which adds these filters to the search backend. Cannot merge until that PR is merged and deployed. Also held until the design is approved. The labels, copy, filter values, and which workspaces see these filters are still being decided.

One known gap until the filter values are final: multi-word values such as carRental and expensifyTravel show in camelCase in the search bar, not hyphenated like other filters (e.g. per-diem). Hyphenating them needs a parser rule for each value, so it waits until the value list is settled.

Fixed Issues

For https://github.com/Expensify/Expensify/issues/693431
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

– written by Claude on Ben's behalf

@github-actions

Copy link
Copy Markdown
Contributor

It looks like this PR adds a search filter or column. Please double check the following:

  • The filter is available in the Search filters dropdown and returns the expected results.
  • The filter has a matching column that can be shown through Display > Edit columns.
  • The column can be sorted by clicking its header.
  • Export > Current view includes the column in the exported CSV.

@OSBotify

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index c7ea8d0d..dea66ec2 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -10861,6 +10861,19 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
             },
             searchFilters: 'Suchfilter',
             noFiltersSelected: 'Keine Filter ausgewählt',
+            travelType: {
+                label: 'Reiseart',
+                [CONST.SEARCH.TRAVEL_TYPE.AIR]: 'Flug',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL]: 'Hotel',
+                [CONST.SEARCH.TRAVEL_TYPE.CAR_RENTAL]: 'Mietwagen',
+                [CONST.SEARCH.TRAVEL_TYPE.RAIL]: 'Bahn',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL_BLOCK]: 'Hotelkontingent',
+            },
+            travelPlatform: {
+                label: 'Reiseplattform',
+                [CONST.SEARCH.TRAVEL_PLATFORM.EXPENSIFY_TRAVEL]: 'Expensify Travel',
+                [CONST.SEARCH.TRAVEL_PLATFORM.OTHER]: 'Sonstiges',
+            },
         },
         display: {
             label: 'Anzeige',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index 05a4b0d8..7c5b4d93 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -11076,6 +11076,19 @@ ${reportName}`,
             },
             searchFilters: 'Φίλτρα αναζήτησης',
             noFiltersSelected: 'Δεν έχουν επιλεγεί φίλτρα',
+            travelType: {
+                label: 'Τύπος ταξιδιού',
+                [CONST.SEARCH.TRAVEL_TYPE.AIR]: 'Αέρας',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL]: 'Ξενοδοχείο',
+                [CONST.SEARCH.TRAVEL_TYPE.CAR_RENTAL]: 'Ενοικίαση αυτοκινήτου',
+                [CONST.SEARCH.TRAVEL_TYPE.RAIL]: 'Σιδηροδρομική γραμμή',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL_BLOCK]: 'Κρατημένο μπλοκ δωματίων ξενοδοχείου',
+            },
+            travelPlatform: {
+                label: 'Πλατφόρμα ταξιδιών',
+                [CONST.SEARCH.TRAVEL_PLATFORM.EXPENSIFY_TRAVEL]: 'Expensify Travel',
+                [CONST.SEARCH.TRAVEL_PLATFORM.OTHER]: 'Άλλο',
+            },
         },
         display: {
             label: 'Εμφάνιση',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index e2997c44..a31c42e6 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -10714,6 +10714,19 @@ ${reportName}`,
             },
             searchFilters: 'Filtros de búsqueda',
             noFiltersSelected: 'No se han seleccionado filtros',
+            travelType: {
+                label: 'Tipo de viaje',
+                [CONST.SEARCH.TRAVEL_TYPE.AIR]: 'Aire',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL]: 'Hotel',
+                [CONST.SEARCH.TRAVEL_TYPE.CAR_RENTAL]: 'Alquiler de coche',
+                [CONST.SEARCH.TRAVEL_TYPE.RAIL]: 'Riel',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL_BLOCK]: 'Bloque de habitaciones de hotel',
+            },
+            travelPlatform: {
+                label: 'Plataforma de viajes',
+                [CONST.SEARCH.TRAVEL_PLATFORM.EXPENSIFY_TRAVEL]: 'Expensify Travel',
+                [CONST.SEARCH.TRAVEL_PLATFORM.OTHER]: 'Otro',
+            },
         },
         chartTitles: {
             [CONST.SEARCH.GROUP_BY.FROM]: 'De',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 50358123..a4cf15de 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -10888,6 +10888,19 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
             },
             searchFilters: 'Filtres de recherche',
             noFiltersSelected: 'Aucun filtre sélectionné',
+            travelType: {
+                label: 'Type de déplacement',
+                [CONST.SEARCH.TRAVEL_TYPE.AIR]: 'Air',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL]: 'Hôtel',
+                [CONST.SEARCH.TRAVEL_TYPE.CAR_RENTAL]: 'Location de voiture',
+                [CONST.SEARCH.TRAVEL_TYPE.RAIL]: 'Rail',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL_BLOCK]: 'Bloc de chambres d’hôtel',
+            },
+            travelPlatform: {
+                label: 'Plateforme de voyage',
+                [CONST.SEARCH.TRAVEL_PLATFORM.EXPENSIFY_TRAVEL]: 'Expensify Travel',
+                [CONST.SEARCH.TRAVEL_PLATFORM.OTHER]: 'Autre',
+            },
         },
         display: {
             label: 'Affichage',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index c9a293f0..7af7bafc 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -10814,6 +10814,19 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
             },
             searchFilters: 'Filtri di ricerca',
             noFiltersSelected: 'Nessun filtro selezionato',
+            travelType: {
+                label: 'Tipo di viaggio',
+                [CONST.SEARCH.TRAVEL_TYPE.AIR]: 'Aria',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL]: 'Hotel',
+                [CONST.SEARCH.TRAVEL_TYPE.CAR_RENTAL]: 'Noleggio auto',
+                [CONST.SEARCH.TRAVEL_TYPE.RAIL]: 'Rail',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL_BLOCK]: 'Blocco hotel',
+            },
+            travelPlatform: {
+                label: 'Piattaforma di viaggio',
+                [CONST.SEARCH.TRAVEL_PLATFORM.EXPENSIFY_TRAVEL]: 'Expensify Travel',
+                [CONST.SEARCH.TRAVEL_PLATFORM.OTHER]: 'Altro',
+            },
         },
         display: {
             label: 'Visualizza',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index a2f6cc60..3ac475fd 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -7454,7 +7454,6 @@ _詳しい手順については、[ヘルプサイトをご覧ください](${CO
                 title: 'メンバーをコピー',
                 prompt: ({count, targetWorkspaceName}: {count: number; targetWorkspaceName: string}) => ({
                     one: `${targetWorkspaceName}のメンバーをこのワークスペースのメンバーで置き換えてもよろしいですか?`,
-                    // Japanese has no "one" plural category, so handle the single-workspace case here
                     other:
                         count === 1
                             ? `${targetWorkspaceName}のメンバーをこのワークスペースのメンバーで置き換えてもよろしいですか?`
@@ -10658,6 +10657,19 @@ ${reportName}`,
             },
             searchFilters: '検索フィルター',
             noFiltersSelected: 'フィルターが選択されていません',
+            travelType: {
+                label: '出張の種類',
+                [CONST.SEARCH.TRAVEL_TYPE.AIR]: '航空',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL]: 'ホテル',
+                [CONST.SEARCH.TRAVEL_TYPE.CAR_RENTAL]: 'レンタカー',
+                [CONST.SEARCH.TRAVEL_TYPE.RAIL]: '鉄道',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL_BLOCK]: 'ホテルブロック',
+            },
+            travelPlatform: {
+                label: '出張プラットフォーム',
+                [CONST.SEARCH.TRAVEL_PLATFORM.EXPENSIFY_TRAVEL]: 'Expensify トラベル',
+                [CONST.SEARCH.TRAVEL_PLATFORM.OTHER]: 'その他',
+            },
         },
         display: {
             label: '表示',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 9723637e..07b01f37 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -10783,6 +10783,19 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
             },
             searchFilters: 'Zoekfilters',
             noFiltersSelected: 'Geen filters geselecteerd',
+            travelType: {
+                label: 'Reistype',
+                [CONST.SEARCH.TRAVEL_TYPE.AIR]: 'Lucht',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL]: 'Hotel',
+                [CONST.SEARCH.TRAVEL_TYPE.CAR_RENTAL]: 'Autoverhuur',
+                [CONST.SEARCH.TRAVEL_TYPE.RAIL]: 'Trein',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL_BLOCK]: 'Hotelblok',
+            },
+            travelPlatform: {
+                label: 'Reisplatform',
+                [CONST.SEARCH.TRAVEL_PLATFORM.EXPENSIFY_TRAVEL]: 'Expensify Travel',
+                [CONST.SEARCH.TRAVEL_PLATFORM.OTHER]: 'Anders',
+            },
         },
         display: {
             label: 'Weergave',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index acac974e..4ca396bb 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -10805,6 +10805,19 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
             },
             searchFilters: 'Filtry wyszukiwania',
             noFiltersSelected: 'Nie wybrano filtrów',
+            travelType: {
+                label: 'Rodzaj podróży',
+                [CONST.SEARCH.TRAVEL_TYPE.AIR]: 'Powietrze',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL]: 'Hotel',
+                [CONST.SEARCH.TRAVEL_TYPE.CAR_RENTAL]: 'Wypożyczenie samochodu',
+                [CONST.SEARCH.TRAVEL_TYPE.RAIL]: 'Kolej',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL_BLOCK]: 'Blok hotelowy',
+            },
+            travelPlatform: {
+                label: 'Platforma podróżnicza',
+                [CONST.SEARCH.TRAVEL_PLATFORM.EXPENSIFY_TRAVEL]: 'Expensify Travel',
+                [CONST.SEARCH.TRAVEL_PLATFORM.OTHER]: 'Inne',
+            },
         },
         display: {
             label: 'Wyświetl',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 72d4ca61..f72115a3 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -10785,6 +10785,19 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
             },
             searchFilters: 'Filtros de busca',
             noFiltersSelected: 'Nenhum filtro selecionado',
+            travelType: {
+                label: 'Tipo de viagem',
+                [CONST.SEARCH.TRAVEL_TYPE.AIR]: 'Aéreo',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL]: 'Hotel',
+                [CONST.SEARCH.TRAVEL_TYPE.CAR_RENTAL]: 'Aluguel de carro',
+                [CONST.SEARCH.TRAVEL_TYPE.RAIL]: 'Ferrovia',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL_BLOCK]: 'Bloco de hotel',
+            },
+            travelPlatform: {
+                label: 'Plataforma de viagens',
+                [CONST.SEARCH.TRAVEL_PLATFORM.EXPENSIFY_TRAVEL]: 'Expensify Travel',
+                [CONST.SEARCH.TRAVEL_PLATFORM.OTHER]: 'Outro',
+            },
         },
         display: {
             label: 'Exibir',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index d853af9d..f261f6ac 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -7281,7 +7281,6 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
                 title: '复制成员',
                 prompt: ({count, targetWorkspaceName}: {count: number; targetWorkspaceName: string}) => ({
                     one: `确定要用此工作区的成员替换 ${targetWorkspaceName} 的成员吗?`,
-                    // Chinese has no "one" plural category, so handle the single-workspace case here
                     other: count === 1 ? `确定要用此工作区的成员替换 ${targetWorkspaceName} 的成员吗?` : `确定要用此工作区的成员替换 ${count} 个工作区的成员吗?`,
                 }),
             },
@@ -10387,6 +10386,19 @@ ${reportName}`,
             },
             searchFilters: '搜索筛选条件',
             noFiltersSelected: '未选择任何筛选器',
+            travelType: {
+                label: '差旅类型',
+                [CONST.SEARCH.TRAVEL_TYPE.AIR]: '航空',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL]: '酒店',
+                [CONST.SEARCH.TRAVEL_TYPE.CAR_RENTAL]: '租车',
+                [CONST.SEARCH.TRAVEL_TYPE.RAIL]: '铁道',
+                [CONST.SEARCH.TRAVEL_TYPE.HOTEL_BLOCK]: '酒店房源预留',
+            },
+            travelPlatform: {
+                label: '差旅平台',
+                [CONST.SEARCH.TRAVEL_PLATFORM.EXPENSIFY_TRAVEL]: 'Expensify 差旅',
+                [CONST.SEARCH.TRAVEL_PLATFORM.OTHER]: '其他',
+            },
         },
         display: {
             label: '显示',

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants