Skip to content

Commit e6e5bfd

Browse files
authored
Merge pull request #89183 from Expensify/alberto-notOptimistic
[Payment due @DylanDylann] Do not create cards/transactions optimistically when importing a CSV feed
2 parents 442336b + 1f65d51 commit e6e5bfd

14 files changed

Lines changed: 39 additions & 96 deletions

File tree

src/components/ImportSpreadsheetConfirmModal.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ function ImportSpreadsheetConfirmModal({isVisible, closeImportPageAndModal, onMo
2828
const promptText = spreadsheet?.importFinalModal?.promptKey
2929
? translate(spreadsheet.importFinalModal.promptKey, spreadsheet.importFinalModal.promptKeyParams as TranslationParameters<typeof spreadsheet.importFinalModal.promptKey>[0])
3030
: '';
31+
const pendingText = spreadsheet?.shouldShowPendingMessage ? translate('spreadsheet.importCompanyCardTransactionsPendingMessage') : '';
32+
const fullPromptText = pendingText ? `${promptText} ${pendingText}` : promptText;
3133

3234
useEffect(() => {
3335
if (!isVisible || !titleText || !promptText || !spreadsheet?.importFinalModal) {
@@ -36,7 +38,7 @@ function ImportSpreadsheetConfirmModal({isVisible, closeImportPageAndModal, onMo
3638
showConfirmModal({
3739
id: 'import-spreadsheet-confirm-modal',
3840
title: titleText,
39-
prompt: promptText,
41+
prompt: fullPromptText,
4042
confirmText: translate('common.buttonConfirm'),
4143
shouldShowCancelButton: false,
4244
shouldHandleNavigationBack,
@@ -48,7 +50,7 @@ function ImportSpreadsheetConfirmModal({isVisible, closeImportPageAndModal, onMo
4850
// We don't need the callbacks as dependencies as they are unstable
4951
// references that cause an infinite re-render loop.
5052
// eslint-disable-next-line react-hooks/exhaustive-deps
51-
}, [isVisible, titleText, promptText, spreadsheet?.importFinalModal, shouldHandleNavigationBack]);
53+
}, [isVisible, titleText, fullPromptText, spreadsheet?.importFinalModal, shouldHandleNavigationBack]);
5254

5355
return null;
5456
}

src/languages/de.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ const translations: TranslationDeepObject<typeof en> = {
11191119
other: (count: number) =>
11201120
`Bitte bestätige die folgenden Details für die ${count} neuen Workspace-Mitglieder, die im Rahmen dieses Uploads hinzugefügt werden. Bestehende Mitglieder erhalten keine Rollenaktualisierungen oder Einladungsnachrichten.`,
11211121
}),
1122+
importCompanyCardTransactionsPendingMessage: 'Neue Karten und Transaktionen können etwas Zeit benötigen, bis sie erscheinen. Bitte haben Sie etwas Geduld.',
11221123
},
11231124
receipt: {
11241125
upload: 'Beleg hochladen',

src/languages/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,7 @@ const translations = {
11401140
},
11411141
importCompanyCardTransactionsSuccessfulDescription: ({transactions}: {transactions: number}) =>
11421142
transactions > 1 ? `${transactions} transactions have been added.` : '1 transaction has been added.',
1143+
importCompanyCardTransactionsPendingMessage: 'New cards and transactions may take some time to appear, please hang tight.',
11431144
importMembersSuccessfulDescription: ({added, updated}: {added: number; updated: number}) => {
11441145
if (!added && !updated) {
11451146
return 'No members have been added or updated.';

src/languages/es.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ const translations: TranslationDeepObject<typeof en> = {
10561056
importTransactionsSuccessfulDescription: ({transactions}) => (transactions > 1 ? `Se han importado ${transactions} transacciones.` : 'Se ha importado 1 transacción.'),
10571057
importCompanyCardTransactionsSuccessfulDescription: ({transactions}: {transactions: number}) =>
10581058
transactions > 1 ? `Se han importado ${transactions} transacciones.` : 'Se ha importado 1 transacción.',
1059+
importCompanyCardTransactionsPendingMessage: 'Las nuevas tarjetas y transacciones pueden tardar un poco en aparecer.',
10591060
importSuccessfulTitle: 'Importar categorías',
10601061
importDescription: 'Elige qué campos mapear desde tu hoja de cálculo haciendo clic en el menú desplegable junto a cada columna importada a continuación.',
10611062
sizeNotMet: 'El archivo adjunto debe ser más grande que 0 bytes.',

src/languages/fr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,7 @@ const translations: TranslationDeepObject<typeof en> = {
11231123
other: (count: number) =>
11241124
`Veuillez confirmer les détails ci-dessous pour les ${count} nouveaux membres de l’espace de travail qui seront ajoutés dans le cadre de ce téléversement. Les membres existants ne recevront aucune mise à jour de rôle ni message d’invitation.`,
11251125
}),
1126+
importCompanyCardTransactionsPendingMessage: 'L’apparition de nouvelles cartes et transactions peut prendre un certain temps, veuillez patienter.',
11261127
},
11271128
receipt: {
11281129
upload: 'Télécharger le reçu',

src/languages/it.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ const translations: TranslationDeepObject<typeof en> = {
11191119
other: (count: number) =>
11201120
`Conferma i dettagli riportati di seguito per i ${count} nuovi membri dello spazio di lavoro che verranno aggiunti come parte di questo caricamento. I membri già esistenti non riceveranno aggiornamenti di ruolo o messaggi di invito.`,
11211121
}),
1122+
importCompanyCardTransactionsPendingMessage: 'Le nuove carte e transazioni potrebbero impiegare un po’ di tempo per apparire, attendi per favore.',
11221123
},
11231124
receipt: {
11241125
upload: 'Carica ricevuta',

src/languages/ja.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ const translations: TranslationDeepObject<typeof en> = {
11021102
other: (count: number) =>
11031103
`このアップロードで追加される${count}人の新しいワークスペースメンバーについて、以下の内容を確認してください。既存のメンバーには、ロールの更新や招待メッセージは送信されません。`,
11041104
}),
1105+
importCompanyCardTransactionsPendingMessage: '新しいカードや取引が表示されるまでに少し時間がかかる場合があります。しばらくお待ちください。',
11051106
},
11061107
receipt: {
11071108
upload: '領収書をアップロード',

src/languages/nl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,7 @@ const translations: TranslationDeepObject<typeof en> = {
11181118
other: (count: number) =>
11191119
`Bevestig hieronder de gegevens voor de ${count} nieuwe werkruimteleden die als onderdeel van deze upload worden toegevoegd. Bestaande leden ontvangen geen rolupdates of uitnodigingsberichten.`,
11201120
}),
1121+
importCompanyCardTransactionsPendingMessage: 'Nieuwe kaarten en transacties kunnen even duren voordat ze verschijnen, even geduld.',
11211122
},
11221123
receipt: {
11231124
upload: 'Bon uploaden',

src/languages/pl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,7 @@ const translations: TranslationDeepObject<typeof en> = {
11171117
other: (count: number) =>
11181118
`Potwierdź poniższe szczegóły dotyczące ${count} nowych członków przestrzeni roboczej, którzy zostaną dodani w ramach tego przesyłania. Istniejący członkowie nie otrzymają żadnych aktualizacji ról ani wiadomości z zaproszeniem.`,
11191119
}),
1120+
importCompanyCardTransactionsPendingMessage: 'Nowe karty i transakcje mogą potrzebować trochę czasu, aby się pojawić, prosimy o cierpliwość.',
11201121
},
11211122
receipt: {
11221123
upload: 'Prześlij paragon',

src/languages/pt-BR.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,7 @@ const translations: TranslationDeepObject<typeof en> = {
11171117
other: (count: number) =>
11181118
`Confirme os detalhes abaixo para os ${count} novos membros do workspace que serão adicionados como parte deste upload. Membros existentes não receberão nenhuma atualização de função nem mensagens de convite.`,
11191119
}),
1120+
importCompanyCardTransactionsPendingMessage: 'Novos cartões e transações podem levar algum tempo para aparecer, aguarde um momento.',
11201121
},
11211122
receipt: {
11221123
upload: 'Carregar recibo',

0 commit comments

Comments
 (0)