Skip to content

Lock workspace Travel toggle while Travel Invoicing is enabled#92116

Open
blimpich wants to merge 3 commits into
mainfrom
blimpich-lockTravelToggleWhenInvoicingEnabled
Open

Lock workspace Travel toggle while Travel Invoicing is enabled#92116
blimpich wants to merge 3 commits into
mainfrom
blimpich-lockTravelToggleWhenInvoicingEnabled

Conversation

@blimpich
Copy link
Copy Markdown
Contributor

@blimpich blimpich commented May 29, 2026

Explanation of Change

Travel Invoicing depends on the workspace Travel feature being on. Previously, an admin could turn Travel off in Workspace → More features while Travel Invoicing was still enabled, leaving the workspace in an inconsistent state.

This locks the Travel toggle whenever Travel Invoicing is enabled for the workspace. Pressing the locked toggle opens a modal explaining that Travel Invoicing must be turned off first, with a button that takes the admin to the Travel settings page where they can do so. The enforcement also exists server-side (sibling Auth PR: https://github.com/Expensify/Auth/pull/21947); they ship together.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/642820
PROPOSAL:

Tests

  1. Open a workspace where Travel is enabled and Travel Invoicing is turned on.
  2. Go to Workspace settings → More features.
  3. Verify the Travel toggle shows a lock icon and cannot be switched off directly.
  4. Press the locked Travel toggle.
  5. Verify a modal appears explaining Travel Invoicing must be turned off first.
  6. Press the modal's button and verify it navigates to the workspace Travel settings page.
  7. Turn Travel Invoicing off, return to More features, and verify the Travel toggle is now interactive and can be turned off.
  • Verify that no errors appear in the JS console

Offline tests

  1. With Travel Invoicing enabled, go offline.
  2. Open Workspace → More features and verify the Travel toggle still shows as locked and the explanatory modal still appears on press (the lock state is driven by already-synced Onyx data, so it works offline).

QA Steps

  1. On https://staging.new.expensify.com, open a workspace with Travel enabled and Travel Invoicing turned on.
  2. Go to Workspace settings → More features.
  3. Verify the Travel toggle is locked and cannot be turned off directly.
  4. Press the locked toggle and verify the modal explains Travel Invoicing must be turned off first.
  5. Press the modal button and verify navigation to the Travel settings page.
  6. Turn Travel Invoicing off and verify the Travel toggle becomes interactive again.
  • 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 followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Screen.Recording.2026-05-29.at.2.22.02.PM.mov

– written by Claude on Ben's behalf

@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 0ee96e9b5f5..be42824abae 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -5633,8 +5633,8 @@ _Für ausführlichere Anweisungen [besuchen Sie unsere Hilfeseite](${CONST.NETSU
                 title: 'Reisen',
                 subtitle: 'Buchen, verwalten und abstimmen Sie all Ihre Geschäftsreisen.',
                 disableTravelTitle: 'Deaktivieren Sie zuerst die Reiseabrechnung',
-                disableTravelPrompt: 'Die Reiseabrechnung ist für diesen Arbeitsbereich aktiviert. Deaktivieren Sie sie, bevor Sie Reisen deaktivieren können.',
-                disableTravelButton: 'Zu den Reiseeinstellungen',
+                disableTravelPrompt: 'Reiseabrechnung ist für diesen Workspace aktiviert. Schalten Sie sie aus, bevor Sie Reisen deaktivieren können.',
+                disableTravelButton: 'Zu den Reiseeinstellungen gehen',
                 getStarted: {
                     title: 'Los geht’s mit Expensify Travel',
                     subtitle: 'Wir brauchen nur noch ein paar weitere Informationen zu deinem Unternehmen, dann bist du startklar.',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 876ac9d33be..985d0f022c8 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -5466,8 +5466,8 @@ ${amount} para ${merchant} - ${date}`,
                 title: 'Viajes',
                 subtitle: 'Reserva, gestiona y concilia todos tus viajes de negocios.',
                 disableTravelTitle: 'Desactiva primero la facturación de viajes',
-                disableTravelPrompt: 'La facturación de viajes está activada para este espacio de trabajo. Desactívala antes de poder desactivar Viajes.',
-                disableTravelButton: 'Ir a la configuración de Viajes',
+                disableTravelPrompt: 'La facturación de viajes está habilitada para este espacio de trabajo. Desactívala antes de poder deshabilitar Viajes.',
+                disableTravelButton: 'Ve a la configuración de Viajes',
                 getStarted: {
                     title: 'Comienza con Expensify Travel',
                     subtitle: 'Solo necesitamos algunos datos más sobre tu empresa y estarás listo para despegar.',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 0c79e98d83c..40a977a071e 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -2976,7 +2976,7 @@ ${amount} pour ${merchant} - ${date}`,
         phoneOrEmail: 'Téléphone ou e-mail',
         error: {
             agentSignInBlocked:
-                'Les comptes d\u2019agent ne permettent pas de se connecter directement. Pour utiliser un agent, connectez-vous avec votre propre compte et accédez-y via Copilot.',
+                'Les comptes d’agent ne permettent pas de se connecter directement. Pour utiliser un agent, connectez-vous avec votre propre compte et accédez-y via Copilot.',
             invalidFormatEmailLogin: 'L’adresse e-mail saisie est invalide. Veuillez corriger le format et réessayer.',
         },
         cannotGetAccountDetails: 'Impossible de récupérer les détails du compte. Veuillez essayer de vous reconnecter.',
@@ -5644,9 +5644,9 @@ _Pour des instructions plus détaillées, [visitez notre site d’aide](${CONST.
             travel: {
                 title: 'Déplacements',
                 subtitle: 'Réservez, gérez et rapprochez tous vos déplacements professionnels.',
-                disableTravelTitle: "Désactivez d'abord la facturation des déplacements",
-                disableTravelPrompt: 'La facturation des déplacements est activée pour cet espace de travail. Désactivez-la avant de pouvoir désactiver Déplacements.',
-                disableTravelButton: 'Aller aux paramètres de déplacement',
+                disableTravelTitle: 'Désactivez d’abord la facturation des déplacements',
+                disableTravelPrompt: 'La facturation de voyage est activée pour cet espace de travail. Désactivez-la avant de pouvoir désactiver Travel.',
+                disableTravelButton: 'Accéder aux paramètres de voyage',
                 getStarted: {
                     title: 'Commencez avec Expensify Travel',
                     subtitle: 'Nous avons simplement besoin de quelques informations supplémentaires sur votre entreprise, puis vous serez prêt à décoller.',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index b074d28414b..dfb0adb25a6 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -5614,8 +5614,8 @@ _Per istruzioni più dettagliate, [visita il nostro sito di assistenza](${CONST.
                 title: 'Viaggi',
                 subtitle: 'Prenota, gestisci e riconcilia tutti i viaggi di lavoro.',
                 disableTravelTitle: 'Disattiva prima la fatturazione viaggi',
-                disableTravelPrompt: 'La fatturazione viaggi è attiva per questo spazio di lavoro. Disattivala prima di poter disattivare Viaggi.',
-                disableTravelButton: 'Vai alle impostazioni di Viaggi',
+                disableTravelPrompt: 'La fatturazione Viaggi è abilitata per questo spazio di lavoro. Disattivala prima di poter disabilitare Viaggi.',
+                disableTravelButton: 'Vai alle impostazioni Viaggio',
                 getStarted: {
                     title: 'Inizia con Expensify Travel',
                     subtitle: 'Ci servono solo ancora alcune informazioni sulla tua attività, poi sarai pronto al decollo.',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 15c6f3ce488..79876ab4131 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -5564,9 +5564,9 @@ _詳しい手順については、[ヘルプサイトをご覧ください](${CO
             travel: {
                 title: '出張',
                 subtitle: '出張の予約、管理、精算をすべて一元管理。',
-                disableTravelTitle: '先に出張請求をオフにしてください',
-                disableTravelPrompt: 'このワークスペースでは出張請求が有効になっています。出張をオフにする前に、出張請求をオフにしてください。',
-                disableTravelButton: '出張設定に移動',
+                disableTravelTitle: '先に Travel Invoicing をオフにしてください',
+                disableTravelPrompt: 'このワークスペースでは旅行請求書作成が有効になっています。Travel を無効にする前にオフにしてください。',
+                disableTravelButton: '出張設定に移動します',
                 getStarted: {
                     title: 'Expensify Travel を使い始める',
                     subtitle: 'ビジネスについてあと少しだけ情報を教えてください。準備が整い次第、すぐに開始できます。',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 62475ad5626..fa4b720a703 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -5602,9 +5602,9 @@ _Voor meer gedetailleerde instructies, [bezoek onze help-site](${CONST.NETSUITE_
             travel: {
                 title: 'Reizen',
                 subtitle: 'Boek, beheer en reconcilieer al je zakelijke reizen.',
-                disableTravelTitle: 'Schakel eerst reisfacturering uit',
-                disableTravelPrompt: 'Reisfacturering is ingeschakeld voor deze werkruimte. Schakel het uit voordat je Reizen kunt uitschakelen.',
-                disableTravelButton: 'Ga naar reisinstellingen',
+                disableTravelTitle: 'Schakel eerst Reisfacturatie uit',
+                disableTravelPrompt: 'Reisfacturatie is ingeschakeld voor deze workspace. Schakel dit uit voordat je Reis kunt uitschakelen.',
+                disableTravelButton: 'Ga naar Reisinstellingen',
                 getStarted: {
                     title: 'Aan de slag met Expensify Travel',
                     subtitle: 'We hebben nog maar een paar extra gegevens over je bedrijf nodig, dan ben je klaar voor vertrek.',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 3e33a593554..e795407db7d 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -5591,8 +5591,8 @@ _Aby uzyskać bardziej szczegółowe instrukcje, [odwiedź naszą stronę pomocy
                 title: 'Podróże',
                 subtitle: 'Rezerwuj, zarządzaj i uzgadniaj wszystkie wyjazdy służbowe.',
                 disableTravelTitle: 'Najpierw wyłącz fakturowanie podróży',
-                disableTravelPrompt: 'Fakturowanie podróży jest włączone dla tego obszaru roboczego. Wyłącz je, zanim będzie można wyłączyć Podróże.',
-                disableTravelButton: 'Przejdź do ustawień podróży',
+                disableTravelPrompt: 'Fakturowanie podróży jest włączone dla tego obszaru roboczego. Wyłącz je, zanim będziesz mógł wyłączyć funkcję Podróże.',
+                disableTravelButton: 'Przejdź do ustawień Podróży',
                 getStarted: {
                     title: 'Pierwsze kroki z Expensify Travel',
                     subtitle: 'Potrzebujemy jeszcze tylko kilku informacji o Twojej firmie, a potem będziesz gotowy do startu.',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index c675e0d93e8..47411989db5 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -5595,8 +5595,8 @@ _Para instruções mais detalhadas, [visite nossa central de ajuda](${CONST.NETS
                 title: 'Viagens',
                 subtitle: 'Reserve, gerencie e reconcilie todas as viagens de negócios da sua empresa.',
                 disableTravelTitle: 'Desative primeiro o faturamento de viagens',
-                disableTravelPrompt: 'O faturamento de viagens está ativado para este espaço de trabalho. Desative-o antes de poder desativar Viagens.',
-                disableTravelButton: 'Ir para as configurações de Viagens',
+                disableTravelPrompt: 'O faturamento de viagens está ativado para este workspace. Desative-o antes de desativar o Travel.',
+                disableTravelButton: 'Ir para as configurações de Viagem',
                 getStarted: {
                     title: 'Comece a usar o Expensify Travel',
                     subtitle: 'Só precisamos de mais algumas informações sobre sua empresa e você estará pronto para decolar.',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 937455e5ab3..13871547b63 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -5467,7 +5467,7 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
                 title: '差旅',
                 subtitle: '预订、管理并对账您所有的商务差旅。',
                 disableTravelTitle: '请先关闭差旅开票',
-                disableTravelPrompt: '此工作区已启用差旅开票。请先将其关闭,然后才能关闭差旅功能。',
+                disableTravelPrompt: '此工作区已启用差旅开票。要禁用差旅功能,请先将其关闭。',
                 disableTravelButton: '前往差旅设置',
                 getStarted: {
                     title: '开始使用 Expensify Travel',

Note

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

View workflow run

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
...ages/workspace/WorkspaceMoreFeaturesPage/index.tsx 66.33% <83.33%> (+0.34%) ⬆️
... and 17 files with indirect coverage changes

@blimpich blimpich marked this pull request as ready for review May 29, 2026 23:50
@blimpich blimpich requested review from a team as code owners May 29, 2026 23:50
@melvin-bot melvin-bot Bot requested review from heyjennahay and truph01 and removed request for a team May 29, 2026 23:50
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 29, 2026

@truph01 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot Bot removed the request for review from a team May 29, 2026 23:50
@blimpich
Copy link
Copy Markdown
Contributor Author

@truph01 if you aren't able to enable travel invoicing locally feel free to login to my local backend on user netsuite@testv22.com using my ngrok credentials. You'll be able to test from there.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8fa6c820d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/pages/workspace/WorkspaceMoreFeaturesPage/index.tsx
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