Automatically launch E-card enrollment after changing workspace to supported currency - #100667
Automatically launch E-card enrollment after changing workspace to supported currency#100667chuckdries wants to merge 3 commits into
Conversation
|
@Julesssss 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] |
🦜 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 8842d6c3..c7de4b27 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -6255,6 +6255,8 @@ _Für ausführlichere Anweisungen [besuchen Sie unsere Hilfeseite](${CONST.NETSU
csvColumnType: 'Typ',
csvColumnLimitType: 'Limittyp',
csvColumnLimit: 'Limit',
+ noCardFeedsAvailable: 'Keine Kartenfeeds verfügbar',
+ noCardFeedsAvailableDescription: 'Für diesen Workspace sind keine Kartenfeeds verfügbar.',
},
categories: {
deleteCategories: 'Kategorien löschen',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index c5519502..893a82ae 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -6368,6 +6368,8 @@ _Για πιο αναλυτικές οδηγίες, [επισκεφθείτε τ
statusActive: 'Ενεργό',
statusInactive: 'Ανενεργό',
remaining: 'Υπόλοιπο',
+ noCardFeedsAvailable: 'Δεν υπάρχουν διαθέσιμες ροές καρτών',
+ noCardFeedsAvailableDescription: 'Δεν υπάρχουν διαθέσιμες ροές καρτών για αυτόν τον χώρο εργασίας.',
},
categories: {
deleteCategories: 'Διαγραφή κατηγοριών',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 98fcf61d..7d5d40cb 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -6126,6 +6126,8 @@ ${amount} para ${merchant} - ${date}`,
oneMoreStepDescription: 'Parece que tenemos que verificar manualmente tu cuenta bancaria. Dirígete a Concierge, donde te esperan las instrucciones.',
gotIt: 'Entendido',
goToConcierge: 'Ir a Concierge',
+ noCardFeedsAvailable: 'No hay feeds de tarjetas disponibles',
+ noCardFeedsAvailableDescription: 'No hay feeds de tarjetas disponibles para este espacio de trabajo.',
},
categories: {
deleteCategories: 'Eliminar categorías',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 8643d549..8a024958 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -6261,6 +6261,8 @@ _Pour des instructions plus détaillées, [visitez notre site d’aide](${CONST.
csvColumnType: 'Type',
csvColumnLimitType: 'Type de limite',
csvColumnLimit: 'Limite',
+ noCardFeedsAvailable: 'Aucun flux de carte disponible',
+ noCardFeedsAvailableDescription: 'Aucun flux de carte n’est disponible pour cet espace de travail.',
},
categories: {
deleteCategories: 'Supprimer des catégories',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index bc3dfb63..93ffd3ba 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -6213,6 +6213,8 @@ _Per istruzioni più dettagliate, [visita il nostro sito di assistenza](${CONST.
csvColumnType: 'Tipo',
csvColumnLimitType: 'Tipo di limite',
csvColumnLimit: 'Limite',
+ noCardFeedsAvailable: 'Nessun feed carta disponibile',
+ noCardFeedsAvailableDescription: 'Non sono disponibili flussi di carte per questo spazio di lavoro.',
},
categories: {
deleteCategories: 'Elimina categorie',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 4c45895e..c1ae2521 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -6141,6 +6141,8 @@ _詳しい手順については、[ヘルプサイトをご覧ください](${CO
csvColumnType: 'タイプ',
csvColumnLimitType: '限度タイプ',
csvColumnLimit: '限度額',
+ noCardFeedsAvailable: '利用できるカードフィードがありません',
+ noCardFeedsAvailableDescription: 'このワークスペースで利用できるカードフィードはありません。',
},
categories: {
deleteCategories: 'カテゴリを削除',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index c83c320f..3d91f0f9 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -6204,6 +6204,8 @@ _Voor meer gedetailleerde instructies, [bezoek onze help-site](${CONST.NETSUITE_
csvColumnType: 'Type',
csvColumnLimitType: 'Limiettype',
csvColumnLimit: 'Limiet',
+ noCardFeedsAvailable: 'Geen kaartfeeds beschikbaar',
+ noCardFeedsAvailableDescription: 'Er zijn geen kaartfeeds beschikbaar voor deze workspace.',
},
categories: {
deleteCategories: 'Categorieën verwijderen',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 6367f138..563c158e 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -6229,6 +6229,8 @@ _Aby uzyskać bardziej szczegółowe instrukcje, [odwiedź naszą stronę pomocy
csvColumnType: 'Typ',
csvColumnLimitType: 'Typ limitu',
csvColumnLimit: 'Limit',
+ noCardFeedsAvailable: 'Brak dostępnych kanałów kart',
+ noCardFeedsAvailableDescription: 'Dla tego obszaru roboczego nie ma dostępnych żadnych kanałów kart.',
},
categories: {
deleteCategories: 'Usuń kategorie',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index c90c4510..344f3749 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -6204,6 +6204,8 @@ _Para instruções mais detalhadas, [visite nossa central de ajuda](${CONST.NETS
csvColumnType: 'Tipo',
csvColumnLimitType: 'Tipo de limite',
csvColumnLimit: 'Limite',
+ noCardFeedsAvailable: 'Nenhum feed de cartão disponível',
+ noCardFeedsAvailableDescription: 'Não há feeds de cartão disponíveis para este workspace.',
},
categories: {
deleteCategories: 'Excluir categorias',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 3e0c540c..ebf6b7b9 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -5998,6 +5998,8 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
csvColumnType: '类型',
csvColumnLimitType: '限额类型',
csvColumnLimit: '限额',
+ noCardFeedsAvailable: '没有可用的卡片流水',
+ noCardFeedsAvailableDescription: '此工作区暂无可用的卡片流水。',
},
categories: {
deleteCategories: '删除类别',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f77e541ba
ℹ️ 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".
| Navigation.navigate( | ||
| getExpensifyCardEnrollmentRoute(policy.id, policy.outputCurrency, isUkEuCurrencySupported, bankAccountList, supportedCountriesByCurrency, reimbursementAccount?.achData), | ||
| ); |
There was a problem hiding this comment.
Clear stale card form before direct enrollment
When a workspace has no accessible feeds but does have an eligible bank account, this now navigates directly to WorkspaceExpensifyCardBankAccounts without calling clearIssueNewCardFormData(). Previously, the eligible-account path passed through the feed selector and cleared the global ISSUE_NEW_EXPENSIFY_CARD_FORM; the bank-account page's verified handler does not clear it before opening the issue-card flow. Consequently, after abandoning an issue-card form in another workspace, enrolling this workspace can reuse those stale form values. Clear the form before either newly direct enrollment path, or in the bank-account page before it launches the issue flow.
Useful? React with 👍 / 👎.
| <BlockingView | ||
| icon={illustrations.Telescope} | ||
| iconWidth={variables.emptyListIconWidth} | ||
| iconHeight={variables.emptyListIconHeight} | ||
| title={translate('workspace.expensifyCard.noCardFeedsAvailable')} | ||
| subtitle={translate('workspace.expensifyCard.noCardFeedsAvailableDescription')} | ||
| /> |
There was a problem hiding this comment.
Should we add here addBottomSafeAreaPadding?
| let feedListContent = ( | ||
| <BlockingView | ||
| icon={illustrations.Telescope} | ||
| iconWidth={variables.emptyListIconWidth} | ||
| iconHeight={variables.emptyListIconHeight} | ||
| title={translate('workspace.expensifyCard.noCardFeedsAvailable')} | ||
| subtitle={translate('workspace.expensifyCard.noCardFeedsAvailableDescription')} | ||
| /> | ||
| ); | ||
| if (issueNewCardAndOtherFeedsFooter) { | ||
| feedListContent = ( | ||
| <ScrollView | ||
| addBottomSafeAreaPadding | ||
| style={styles.flex1} | ||
| keyboardShouldPersistTaps="handled" | ||
| > | ||
| {issueNewCardAndOtherFeedsFooter} | ||
| </ScrollView> | ||
| ); | ||
| } | ||
| if (primaryFeeds.length > 0) { | ||
| feedListContent = ( | ||
| <SelectionList | ||
| ListItem={SingleSelectListItem} | ||
| onSelectRow={selectFeed} | ||
| data={primaryListData} | ||
| alternateNumberOfSupportedLines={2} | ||
| initiallyFocusedItemKey={lastSelectedExpensifyCardFeedID.toString()} | ||
| addBottomSafeAreaPadding | ||
| listFooterContent={issueNewCardAndOtherFeedsFooter} | ||
| onDismissError={onDismissError} | ||
| /> | ||
| ); | ||
| } | ||
|
|
There was a problem hiding this comment.
The three sequential reassignments read backwards: the case that actually wins (primaryFeeds.length > 0) is written last, so working out what renders means mentally running all three branches. Both the BlockingView and the ScrollView elements are also built on every render and then thrown away. A small renderFeedListContent() with early returns, in priority order, would say the same thing more directly.
| Navigation.navigate( | ||
| getExpensifyCardEnrollmentRoute(policy.id, item.currencyCode, isUkEuCurrencySupported, bankAccountList, supportedCountriesByCurrency, reimbursementAccount?.achData), | ||
| ); |
There was a problem hiding this comment.
The currency page stays on the stack here. getExpensifyCardEnrollmentRoute can return WORKSPACE_EXPENSIFY_CARD_BANK_ACCOUNT, which has no backTo and whose header calls a plain Navigation.goBack(), so backing out of the settlement account screen drops the user onto the currency picker they just used rather than the Expensify Card page. The isForcedToChangeCurrency branch a few lines below already handles this with forceReplace: true.
2026-09-09.12.59.54.mov
Eskalifer1
left a comment
There was a problem hiding this comment.
Let's also complete this Verify that no errors appear in the JS console
There was a problem hiding this comment.
I was able to repro this strange behaviour with input suggestion:
2026-09-09.13.21.56.mov
I think it will be fixed with forceReplace(#100667 (comment))
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp100667-android-native-1.mov100667-android-native-2.mov100667-android-native-3.movAndroid: mWeb Chrome100667-android-web-1.mov100667-android-web-2.mov100667-android-web-3.moviOS: HybridApp100667-ios-native-1.mov100667-ios-native-2.mov100667-ios-native-3.moviOS: mWeb Safari100667-ios-web-1.mov100667-ios-web-2.mov100667-ios-web-3.movMacOS: Chrome / Safari100667-web-1.mov100667-web-2.mov100667-web-3.mov |
Explanation of Change
Fixed Issues
If the user tries to enroll Expensify Card on a workspace with an unsupported currency, and they don't have access to link a feed from a different workspace, the current behavior is to prompt them to change their workspace currency. Then, when they do this, they must click the CTA again to launch the enrollment flow.
This PR adds a
shouldStartExpensifyCardEnrollmentparameter to theworkspaces/:policyID/overview/currencyroute which will, when the user selects a supported Expensify card currency, automatically enter the bank account setup to being the enrollment flow.This PR also adds an empty state to the feed list picker. If the user has access to an existing Expensify card workspace feed, but loses access to that feed while the picker is open, we now show an empty state rather than a blank panel.
$ #99723 (comment)
PROPOSAL:
Tests
Non-USD workspace, has no existing workspace feeds or eligible bank accounts
Non-USD workspace, has no existing workspace feeds, does have eligible bank account
Non-USD workspace, has eligible feed, is removed as admin from existing feed
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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
Non-USD workspace, has no existing workspace feeds or eligible bank accounts
auto.start.e-card.new.VBA.enrollment.after.currency.change.mp4
Non-USD workspace, has no existing workspace feeds, does have eligible bank account
auto-start.e-card.enrollment.after.currency.change.mp4
Non-USD workspace, has eligible feed, is removed as admin from existing feed
e-card.select-feed.empty.state.mp4