Show Smart Limit card option disabled when approvals are optional#96567
Show Smart Limit card option disabled when approvals are optional#96567MelvinBot wants to merge 3 commits into
Conversation
Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
🤖 I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can push follow-up commits from your fork. Note: Translations for locales other than English will be added automatically by the Polyglot Parrot workflow (it runs because |
🦜 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 diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index 38a5c417ff7..c762b57ea87 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -6657,6 +6657,7 @@ Der Control-Tarif beginnt bei 9 $ pro aktivem Mitglied und Monat.`,
createNew: 'Neu erstellen',
spendRulesEmptyStateTitle: 'Keine Regeln zur Auswahl',
spendRulesEmptyStateSubtitle: 'Noch keine Regeln. Sie können eine auf dem vorherigen Bildschirm erstellen.',
+ smartLimitDisabledDescription: 'Aktivieren Sie einen Genehmigungsworkflow für diesen Workspace, um Smart Limit zu verwenden',
},
deactivateCardModal: {
deactivate: 'Deaktivieren',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 2e2751fa125..cb8d2004ece 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -6781,6 +6781,7 @@ El plan Controlar empieza en 9 $ por miembro activo al mes.`,
createNew: 'Crear nuevo',
spendRulesEmptyStateTitle: 'No hay reglas para elegir',
spendRulesEmptyStateSubtitle: 'Todavía no hay reglas. Puedes crear una desde la pantalla anterior.',
+ smartLimitDisabledDescription: 'Habilita un flujo de aprobación para este espacio de trabajo para usar Smart Limit',
},
deactivateCardModal: {
deactivate: 'Desactivar',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index c629abc9b71..88b9b5d70dc 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -6684,6 +6684,7 @@ Le forfait Control commence à 9 $ par Membre actif et par mois.`,
createNew: 'Créer nouveau',
spendRulesEmptyStateTitle: 'Aucune règle à sélectionner',
spendRulesEmptyStateSubtitle: 'Aucune règle pour le moment. Vous pouvez en créer une depuis l’écran précédent.',
+ smartLimitDisabledDescription: 'Activez un flux d’approbation pour cet espace de travail afin d’utiliser Smart Limit',
},
deactivateCardModal: {
deactivate: 'Désactiver',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 6d0e525d96f..f554ffe04cb 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -6642,6 +6642,7 @@ Il piano Control parte da 9 $ al mese per ogni membro attivo.`,
createNew: 'Crea nuovo',
spendRulesEmptyStateTitle: 'Nessuna regola tra cui scegliere',
spendRulesEmptyStateSubtitle: 'Ancuna nessuna regola. Puoi crearne una dalla schermata precedente.',
+ smartLimitDisabledDescription: 'Abilita un flusso di approvazione per questo spazio di lavoro per usare Smart Limit',
},
deactivateCardModal: {
deactivate: 'Disattiva',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index fa6dd6c61c4..c019fdc6da9 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -6561,6 +6561,7 @@ Control プランは、アクティブメンバー1人あたり月額 $9 から
createNew: '新規作成',
spendRulesEmptyStateTitle: '選択できるルールがありません',
spendRulesEmptyStateSubtitle: 'まだルールがありません。前の画面から作成できます。',
+ smartLimitDisabledDescription: 'このワークスペースで Smart Limit を利用するには、承認ワークフローを有効にしてください',
},
deactivateCardModal: {
deactivate: '無効化',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 48358b1a042..a5166513316 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -6625,6 +6625,7 @@ Het Control-abonnement begint bij $9 per actieve deelnemer per maand.`,
createNew: 'Nieuw maken',
spendRulesEmptyStateTitle: 'Geen regels om uit te kiezen',
spendRulesEmptyStateSubtitle: 'Nog geen regels. Je kunt er een aanmaken vanaf het vorige scherm.',
+ smartLimitDisabledDescription: 'Schakel een goedkeuringsworkflow in voor deze werkruimte om Smart Limit te gebruiken',
},
deactivateCardModal: {
deactivate: 'Deactiveren',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 15aeecbc355..59efcbc3905 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -6607,6 +6607,7 @@ Plan Control zaczyna się od 9 USD za aktywnego członka miesięcznie.`,
createNew: 'Utwórz nowy',
spendRulesEmptyStateTitle: 'Brak reguł do wyboru',
spendRulesEmptyStateSubtitle: 'Brak jeszcze żadnych reguł. Możesz utworzyć jedną na poprzednim ekranie.',
+ smartLimitDisabledDescription: 'Włącz proces zatwierdzania dla tego obszaru roboczego, aby używać Smart Limit',
},
deactivateCardModal: {
deactivate: 'Dezaktywuj',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index e4c7ecd38a2..7e2cf4c0b65 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -6618,6 +6618,7 @@ O plano Control começa em US$ 9 por membro ativo por mês.`,
createNew: 'Criar novo',
spendRulesEmptyStateTitle: 'Nenhuma regra para escolher',
spendRulesEmptyStateSubtitle: 'Ainda não há regras. Você pode criar uma a partir da tela anterior.',
+ smartLimitDisabledDescription: 'Ative um fluxo de aprovação para este workspace para usar o Smart Limit',
},
deactivateCardModal: {
deactivate: 'Desativar',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 99fdc6e7084..d700af06953 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -6424,6 +6424,7 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
createNew: '新建',
spendRulesEmptyStateTitle: '没有可供选择的规则',
spendRulesEmptyStateSubtitle: '尚未创建规则。您可以在上一屏创建一个。',
+ smartLimitDisabledDescription: '为此工作区启用审批流程以使用智能额度',
},
deactivateCardModal: {
deactivate: '停用',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
Fixed the failing Oxfmt check and pushed to the branch. Cause: In Fix: Wrapped the object literal across multiple lines (one property per line with a trailing comma), matching what The only other failing check, |
|
The Oxfmt check is now passing after my fix in The only remaining failing check is |
Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
Fixed the remaining failures ( Cause: The new key Fix: Added This is on top of the earlier Oxfmt fix. The only remaining failure, |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Explanation of Change
The Smart Limit limit type was completely hidden from the Expensify Card limit type selector whenever the workspace's approval workflow was Optional. Both the edit-existing-card flow (
DynamicExpensifyCardLimitTypePage) and the issue-new-card flow (LimitTypeStep) only pushed the Smart Limit option into the list whenareApprovalsConfiguredwastrue, so admins on Optional-approvals workspaces never saw it and had no indication of how to enable it.Per the approved proposal, instead of hiding the option we now always display Smart Limit and keep it disabled when the workspace uses Optional approvals, with a description explaining that an approval workflow must be enabled to use it.
Changes:
DynamicExpensifyCardLimitTypePage.tsxandissueNew/LimitTypeStep.tsx: always add the Smart Limit option; setisDisabled: !areApprovalsConfiguredand swap the description to an explanatory string when approvals aren't configured.ValueSelectionList.tsx: forward theisDisabledflag through the item mapping (it was previously dropped), soSelectionListrenders the row as a non-pressable, greyed option.ValuePicker/types.ts: add optionalisDisabledtoValuePickerItem.en.ts: addsmartLimitDisabledDescription. Translations for other locales are generated automatically by the Polyglot Parrot workflow.Since
getDefaultExpensifyCardLimitTypereturnsMONTHLY(notSMART) when approvals are Optional, the disabled option is never pre-selected.Fixed Issues
$ #94072
PROPOSAL: #94072 (comment)
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari