diff --git a/src/components/Tables/WorkspaceCompanyCardsTable/index.tsx b/src/components/Tables/WorkspaceCompanyCardsTable/index.tsx
index 5b72376e23a1..e5f20e20dc8d 100644
--- a/src/components/Tables/WorkspaceCompanyCardsTable/index.tsx
+++ b/src/components/Tables/WorkspaceCompanyCardsTable/index.tsx
@@ -393,7 +393,7 @@ function WorkspaceCompanyCardsTable({
subtitleStyle={styles.textSupporting}
/>
diff --git a/src/languages/de.ts b/src/languages/de.ts
index 6b8c6f2eadb6..300818e3a89c 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -518,7 +518,6 @@ const translations: TranslationDeepObject = {
avatar: 'Avatar',
editor: 'Editor',
restrictions: 'Beschränkungen',
- tryAgain: 'Erneut versuchen',
tagGLCode: 'GL-Code taggen',
off: 'Aus',
noResultsFoundSubtitle: 'Keine Ergebnisse. Bitte passen Sie Ihre Filter oder Suchanfrage an',
@@ -3756,6 +3755,7 @@ ${amount} für ${merchant} – ${date}`,
facialScan: 'Richtlinie und Einverständniserklärung zur Gesichtserfassung von Onfido',
onfidoLinks: (onfidoTitle: string) =>
`${onfidoTitle} Onfidos Richtlinie und Einverständniserklärung zur Gesichtserkennung, Datenschutz und Nutzungsbedingungen.`,
+ tryAgain: 'Erneut versuchen',
verifyIdentity: 'Identität bestätigen',
letsVerifyIdentity: 'Lass uns deine Identität bestätigen',
butFirst: `Aber zuerst das Langweilige. Lies dir im nächsten Schritt den Rechtstext durch und klicke auf „Akzeptieren“, wenn du bereit bist.`,
@@ -5629,6 +5629,7 @@ _Für ausführlichere Anweisungen [besuchen Sie unsere Hilfeseite](${CONST.NETSU
feedCouldNotBeLoadedTitle: 'Dieser Feed konnte nicht geladen werden',
feedCouldNotBeLoadedMessage:
'Beim Laden dieses Feeds ist ein Fehler aufgetreten. Bitte versuche es erneut oder wende dich an deine Administratorin bzw. deinen Administrator.',
+ tryAgain: 'Erneut versuchen',
},
addNewCard: {
other: 'Sonstiges',
@@ -6423,7 +6424,6 @@ _Für ausführlichere Anweisungen [besuchen Sie unsere Hilfeseite](${CONST.NETSU
conciergeNotificationTitle: 'Concierge wird Sie benachrichtigen',
conciergeNotificationDescription: 'Wenn der Vorgang abgeschlossen ist, sendet Concierge Ihnen eine Nachricht.',
copyCompleted: 'Ihre Workspace-Einstellungen wurden kopiert.',
- copyFailedTitle: 'Kopieren fehlgeschlagen',
},
upgrade: {
title: 'Einige Funktionen erfordern einen Control-Tarif',
diff --git a/src/languages/en.ts b/src/languages/en.ts
index 216a3d60c119..acb5a9036a76 100644
--- a/src/languages/en.ts
+++ b/src/languages/en.ts
@@ -157,7 +157,6 @@ const translations = {
signInWithApple: 'Sign in with Apple',
signInWith: 'Sign in with',
continue: 'Continue',
- tryAgain: 'Try again',
firstName: 'First name',
lastName: 'Last name',
scanning: 'Scanning',
@@ -3852,6 +3851,7 @@ const translations = {
facialScan: 'Onfido’s Facial Scan Policy and Release',
onfidoLinks: (onfidoTitle: string) =>
`${onfidoTitle} Onfido’s Facial Scan Policy and Release, Privacy and Terms of Service.`,
+ tryAgain: 'Try again',
verifyIdentity: 'Verify identity',
letsVerifyIdentity: "Let's verify your identity",
butFirst: `But first, the boring stuff. Read up on the legalese in the next step and click "Accept" when you're ready.`,
@@ -5726,6 +5726,7 @@ const translations = {
workspaceFeedsCouldNotBeLoadedMessage: 'An error occurred while loading workspace card feeds. Please try again or contact your administrator.',
feedCouldNotBeLoadedTitle: "Couldn't load this feed",
feedCouldNotBeLoadedMessage: 'An error occurred while loading this feed. Please try again or contact your administrator.',
+ tryAgain: 'Try again',
},
addNewCard: {
other: 'Other',
@@ -6524,7 +6525,6 @@ const translations = {
conciergeNotificationTitle: 'Concierge will let you know',
conciergeNotificationDescription: 'When the process is completed, Concierge will send you a message.',
copyCompleted: 'Your workspace settings have been copied.',
- copyFailedTitle: 'Copy failed',
},
},
emptyWorkspace: {
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 9bf1359733ee..a7cc398e5dd9 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -470,7 +470,6 @@ const translations: TranslationDeepObject = {
apiKey: 'Clave API',
editor: 'Editor',
restrictions: 'Restricciones',
- tryAgain: 'Inténtalo de nuevo',
tagGLCode: 'Etiquetar código GL',
off: 'Desactivado',
noResultsFoundSubtitle: 'Sin resultados. Intenta ajustar tus filtros o la búsqueda.',
@@ -3627,6 +3626,7 @@ ${amount} para ${merchant} - ${date}`,
facialScan: 'Política y lanzamiento de la exploración facial de Onfido',
onfidoLinks: (onfidoTitle: string) =>
`${onfidoTitle} Política y lanzamiento de la exploración facial de Onfido, Privacidad y Términos de Servicio.`,
+ tryAgain: 'Intentar otra vez',
verifyIdentity: 'Verificar identidad',
letsVerifyIdentity: '¡Vamos a verificar tu identidad!',
butFirst: 'Pero primero, lo aburrido. Lee la jerga legal en el siguiente paso y haz clic en "Aceptar" cuando estés listo.',
@@ -5473,6 +5473,7 @@ ${amount} para ${merchant} - ${date}`,
'Ocurrió un error al cargar las fuentes de tarjetas del espacio de trabajo. Por favor, inténtelo de nuevo o contacte a su administrador.',
feedCouldNotBeLoadedTitle: 'Error al cargar esta fuente de tarjetas',
feedCouldNotBeLoadedMessage: 'Ocurrió un error al cargar esta fuente de tarjetas. Por favor, inténtelo de nuevo o contacte a su administrador.',
+ tryAgain: 'Inténtalo de nuevo',
},
addNewCard: {
other: 'Otros',
@@ -6259,7 +6260,6 @@ ${amount} para ${merchant} - ${date}`,
conciergeNotificationTitle: 'Concierge te avisará',
conciergeNotificationDescription: 'Cuando el proceso se complete, Concierge te enviará un mensaje.',
copyCompleted: 'Se han copiado la configuración de tu espacio de trabajo.',
- copyFailedTitle: 'Error al copiar',
},
upgrade: {
title: 'Algunas funciones requieren un plan Controlar',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 2f9ae12fa815..89d31b754788 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -518,7 +518,6 @@ const translations: TranslationDeepObject = {
avatar: 'Avatar',
editor: 'Éditeur',
restrictions: 'Restrictions',
- tryAgain: 'Réessayer',
tagGLCode: 'Taguer le code GL',
off: 'Désactivé',
noResultsFoundSubtitle: 'Aucun résultat. Veuillez essayer de modifier vos filtres ou votre requête de recherche',
@@ -3766,6 +3765,7 @@ ${amount} pour ${merchant} - ${date}`,
facialScan: 'Politique et autorisation relatives à la reconnaissance faciale d’Onfido',
onfidoLinks: (onfidoTitle: string) =>
`${onfidoTitle} Politique et autorisation de numérisation faciale d’Onfido, Confidentialité et Conditions d’utilisation.`,
+ tryAgain: 'Réessayer',
verifyIdentity: 'Vérifier l’identité',
letsVerifyIdentity: 'Vérifions votre identité',
butFirst: `Mais d’abord, les choses ennuyeuses. Lisez le jargon juridique à l’étape suivante et cliquez sur « Accepter » quand vous êtes prêt.`,
@@ -5642,6 +5642,7 @@ _Pour des instructions plus détaillées, [visitez notre site d’aide](${CONST.
'Une erreur s’est produite lors du chargement des flux de cartes de l’espace de travail. Veuillez réessayer ou contacter votre administrateur.',
feedCouldNotBeLoadedTitle: 'Impossible de charger ce flux',
feedCouldNotBeLoadedMessage: 'Une erreur s’est produite lors du chargement de ce flux. Veuillez réessayer ou contacter votre administrateur.',
+ tryAgain: 'Réessayer',
},
addNewCard: {
other: 'Autre',
@@ -6450,7 +6451,6 @@ _Pour des instructions plus détaillées, [visitez notre site d’aide](${CONST.
conciergeNotificationTitle: 'Concierge vous en informera',
conciergeNotificationDescription: 'Une fois le processus terminé, Concierge vous enverra un message.',
copyCompleted: 'Les paramètres de votre espace de travail ont été copiés.',
- copyFailedTitle: 'Échec de la copie',
},
upgrade: {
title: 'Certaines fonctionnalités nécessitent un forfait Control',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 6e49ff0d79c0..e1987fd84c81 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -518,7 +518,6 @@ const translations: TranslationDeepObject = {
avatar: 'Avatar',
editor: 'Editor',
restrictions: 'Restrizioni',
- tryAgain: 'Riprova',
tagGLCode: 'Tag codice GL',
off: 'Disattivato',
noResultsFoundSubtitle: 'Nessun risultato. Prova a modificare i filtri o la ricerca',
@@ -3745,6 +3744,7 @@ ${amount} per ${merchant} - ${date}`,
facialScan: 'Informativa e liberatoria per la scansione facciale di Onfido',
onfidoLinks: (onfidoTitle: string) =>
`${onfidoTitle} Informativa e consenso per la scansione facciale di Onfido, Informativa sulla privacy e Condizioni di servizio.`,
+ tryAgain: 'Riprova',
verifyIdentity: 'Verifica identità',
letsVerifyIdentity: 'Verifichiamo la tua identità',
butFirst: `Ma prima, le cose noiose. Leggi il gergo legale nel prossimo passaggio e fai clic su "Accetta" quando sei prontə.`,
@@ -5611,6 +5611,7 @@ _Per istruzioni più dettagliate, [visita il nostro sito di assistenza](${CONST.
'Si è verificato un errore durante il caricamento dei feed delle carte dello spazio di lavoro. Riprova o contatta il tuo amministratore.',
feedCouldNotBeLoadedTitle: 'Impossibile caricare questo feed',
feedCouldNotBeLoadedMessage: 'Si è verificato un errore durante il caricamento di questo feed. Riprova oppure contatta il tuo amministratore.',
+ tryAgain: 'Riprova',
},
addNewCard: {
other: 'Altro',
@@ -6410,7 +6411,6 @@ _Per istruzioni più dettagliate, [visita il nostro sito di assistenza](${CONST.
conciergeNotificationTitle: 'Concierge ti farà sapere',
conciergeNotificationDescription: 'Quando il processo sarà completato, Concierge ti invierà un messaggio.',
copyCompleted: 'Le impostazioni dello spazio di lavoro sono state copiate.',
- copyFailedTitle: 'Copia non riuscita',
},
upgrade: {
title: 'Alcune funzionalità richiedono un piano Control',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 2bde735c0fe4..4cdb2aefa9ac 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -517,7 +517,6 @@ const translations: TranslationDeepObject = {
avatar: 'アバター',
editor: '編集者',
restrictions: '制限',
- tryAgain: '再試行',
tagGLCode: 'GL コードにタグを付ける',
off: 'オフ',
noResultsFoundSubtitle: '結果がありません。フィルターや検索キーワードを調整してお試しください',
@@ -3711,6 +3710,7 @@ ${integrationName === CONST.ONBOARDING_ACCOUNTING_MAPPING.other ? 'あなたの'
facialScan: 'Onfido 顔認証ポリシーおよび同意書',
onfidoLinks: (onfidoTitle: string) =>
`${onfidoTitle} Onfidoの顔スキャンポリシーおよび同意、プライバシー、および利用規約。`,
+ tryAgain: '再試行',
verifyIdentity: '本人確認',
letsVerifyIdentity: '本人確認を行いましょう',
butFirst: `その前に、ちょっと退屈な話です。次のステップで法律関連の内容をよく読んで、準備ができたら「同意」をクリックしてください。`,
@@ -5550,6 +5550,7 @@ _詳しい手順については、[ヘルプサイトをご覧ください](${CO
workspaceFeedsCouldNotBeLoadedMessage: 'ワークスペースカードフィードの読み込み中にエラーが発生しました。もう一度お試しいただくか、管理者にお問い合わせください。',
feedCouldNotBeLoadedTitle: 'このフィードを読み込めませんでした',
feedCouldNotBeLoadedMessage: 'このフィードの読み込み中にエラーが発生しました。もう一度お試しいただくか、管理者にお問い合わせください。',
+ tryAgain: '再試行',
},
addNewCard: {
other: 'その他',
@@ -6328,7 +6329,6 @@ _詳しい手順については、[ヘルプサイトをご覧ください](${CO
conciergeNotificationTitle: 'Concierge からお知らせします',
conciergeNotificationDescription: '処理が完了すると、Concierge からメッセージが送信されます。',
copyCompleted: 'ワークスペースの設定がコピーされました。',
- copyFailedTitle: 'コピーに失敗しました',
},
upgrade: {
title: '一部の機能は Control プランへの加入が必要です',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 3bf61f9c238e..6d74c629890a 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -517,7 +517,6 @@ const translations: TranslationDeepObject = {
avatar: 'Avatar',
editor: 'Editor',
restrictions: 'Beperkingen',
- tryAgain: 'Probeer het opnieuw',
tagGLCode: 'GL-code labelen',
off: 'Uit',
noResultsFoundSubtitle: 'Geen resultaten. Probeer je filters of zoekopdracht aan te passen',
@@ -3741,6 +3740,7 @@ ${amount} voor ${merchant} - ${date}`,
facialScan: 'Beleid en toestemming voor gezichtsscan van Onfido',
onfidoLinks: (onfidoTitle: string) =>
`${onfidoTitle} Onfido’s beleid en toestemming voor gezichtsherkenning, Privacybeleid en Servicevoorwaarden.`,
+ tryAgain: 'Probeer het opnieuw',
verifyIdentity: 'Identiteit verifiëren',
letsVerifyIdentity: 'Laten we je identiteit verifiëren',
butFirst: `Maar eerst het saaie gedeelte. Lees de juridische tekst in de volgende stap en klik op ‘Accepteren’ wanneer je klaar bent.`,
@@ -5600,6 +5600,7 @@ _Voor meer gedetailleerde instructies, [bezoek onze help-site](${CONST.NETSUITE_
workspaceFeedsCouldNotBeLoadedMessage: 'Er is een fout opgetreden bij het laden van workspacekaartfeeds. Probeer het opnieuw of neem contact op met je beheerder.',
feedCouldNotBeLoadedTitle: 'Deze feed kon niet worden geladen',
feedCouldNotBeLoadedMessage: 'Er is een fout opgetreden bij het laden van deze feed. Probeer het opnieuw of neem contact op met je beheerder.',
+ tryAgain: 'Probeer het opnieuw',
},
addNewCard: {
other: 'Anders',
@@ -6392,7 +6393,6 @@ _Voor meer gedetailleerde instructies, [bezoek onze help-site](${CONST.NETSUITE_
conciergeNotificationTitle: 'Concierge laat je het weten',
conciergeNotificationDescription: 'Wanneer het proces is afgerond, stuurt Concierge je een bericht.',
copyCompleted: 'Je werkruimte-instellingen zijn gekopieerd.',
- copyFailedTitle: 'Kopiëren mislukt',
},
upgrade: {
title: 'Voor sommige functies is een Control-abonnement vereist',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index b4c34c53be25..6a48c7edd181 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -517,7 +517,6 @@ const translations: TranslationDeepObject = {
avatar: 'Avatar',
editor: 'Edytor',
restrictions: 'Ograniczenia',
- tryAgain: 'Spróbuj ponownie',
tagGLCode: 'Oznacz kod GL',
off: 'Wyłączone',
noResultsFoundSubtitle: 'Brak wyników. Spróbuj zmienić filtry lub zapytanie wyszukiwania',
@@ -3726,6 +3725,7 @@ ${amount} dla ${merchant} - ${date}`,
facialScan: 'Zasady skanów twarzy i zgoda Onfido',
onfidoLinks: (onfidoTitle: string) =>
`${onfidoTitle} Polityka skanowania twarzy i zgoda Onfido, Prywatność oraz Warunki korzystania z usługi.`,
+ tryAgain: 'Spróbuj ponownie',
verifyIdentity: 'Zweryfikuj tożsamość',
letsVerifyIdentity: 'Zweryfikujmy Twoją tożsamość',
butFirst: `Ale najpierw trochę nudnych rzeczy. Przeczytaj prawniczy żargon w następnym kroku i kliknij „Akceptuj”, gdy będziesz gotowy(-a).`,
@@ -5583,6 +5583,7 @@ _Aby uzyskać bardziej szczegółowe instrukcje, [odwiedź naszą stronę pomocy
workspaceFeedsCouldNotBeLoadedMessage: 'Wystąpił błąd podczas ładowania kanałów kart w przestrzeni roboczej. Spróbuj ponownie lub skontaktuj się ze swoim administratorem.',
feedCouldNotBeLoadedTitle: 'Nie udało się wczytać tego kanału',
feedCouldNotBeLoadedMessage: 'Wystąpił błąd podczas ładowania tego kanału. Spróbuj ponownie lub skontaktuj się z administratorem.',
+ tryAgain: 'Spróbuj ponownie',
},
addNewCard: {
other: 'Inne',
@@ -6374,7 +6375,6 @@ _Aby uzyskać bardziej szczegółowe instrukcje, [odwiedź naszą stronę pomocy
conciergeNotificationTitle: 'Concierge da ci znać',
conciergeNotificationDescription: 'Gdy proces się zakończy, Concierge wyśle ci wiadomość.',
copyCompleted: 'Twoje ustawienia przestrzeni roboczej zostały skopiowane.',
- copyFailedTitle: 'Kopiowanie nie powiodło się',
},
upgrade: {
title: 'Niektóre funkcje wymagają planu Control',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 429816f1f138..c1b1dae91975 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -516,7 +516,6 @@ const translations: TranslationDeepObject = {
avatar: 'Avatar',
editor: 'Editor',
restrictions: 'Restrições',
- tryAgain: 'Tentar novamente',
tagGLCode: 'Marcar código GL',
off: 'Desligado',
noResultsFoundSubtitle: 'Nenhum resultado. Tente ajustar seus filtros ou termo de pesquisa',
@@ -3730,6 +3729,7 @@ ${amount} para ${merchant} - ${date}`,
facialScan: 'Política e Autorização de Varredura Facial da Onfido',
onfidoLinks: (onfidoTitle: string) =>
`${onfidoTitle} Política e Autorização de Varredura Facial da Onfido, Privacidade e Termos de Serviço.`,
+ tryAgain: 'Tentar novamente',
verifyIdentity: 'Verificar identidade',
letsVerifyIdentity: 'Vamos verificar sua identidade',
butFirst: `Mas primeiro, a parte chata. Leia o juridiquês na próxima etapa e clique em “Aceitar” quando estiver pronto.`,
@@ -5591,6 +5591,7 @@ _Para instruções mais detalhadas, [visite nossa central de ajuda](${CONST.NETS
workspaceFeedsCouldNotBeLoadedMessage: 'Ocorreu um erro ao carregar os feeds de cartões do workspace. Tente novamente ou contate o seu administrador.',
feedCouldNotBeLoadedTitle: 'Não foi possível carregar este feed',
feedCouldNotBeLoadedMessage: 'Ocorreu um erro ao carregar este feed. Tente novamente ou entre em contato com seu administrador.',
+ tryAgain: 'Tentar novamente',
},
addNewCard: {
other: 'Outro',
@@ -6385,7 +6386,6 @@ _Para instruções mais detalhadas, [visite nossa central de ajuda](${CONST.NETS
conciergeNotificationTitle: 'O Concierge vai avisar você',
conciergeNotificationDescription: 'Quando o processo for concluído, o Concierge vai enviar uma mensagem para você.',
copyCompleted: 'As configurações do seu workspace foram copiadas.',
- copyFailedTitle: 'Falha ao copiar',
},
upgrade: {
title: 'Alguns recursos exigem um plano Control',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 286066528d33..09b836ae1027 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -513,7 +513,6 @@ const translations: TranslationDeepObject = {
avatar: '头像',
editor: '编辑',
restrictions: '限制',
- tryAgain: '重试',
tagGLCode: '标记总账代码',
off: '关',
noResultsFoundSubtitle: '无结果。请尝试调整筛选条件或搜索内容',
@@ -3637,6 +3636,7 @@ ${amount},商户:${merchant} - 日期:${date}`,
facialScan: 'Onfido 人脸扫描政策与授权书',
onfidoLinks: (onfidoTitle: string) =>
`${onfidoTitle} Onfido 的人脸扫描政策和授权、隐私政策和服务条款。`,
+ tryAgain: '重试',
verifyIdentity: '验证身份',
letsVerifyIdentity: '让我们验证您的身份',
butFirst: `不过首先是一些无聊的内容。请在下一步仔细阅读法律条款,准备好后点击“接受”。`,
@@ -5440,6 +5440,7 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
workspaceFeedsCouldNotBeLoadedMessage: '加载工作区卡片动态时发生错误。请重试或联系管理员。',
feedCouldNotBeLoadedTitle: '无法加载此动态',
feedCouldNotBeLoadedMessage: '加载此订阅源时发生错误。请重试或联系您的管理员。',
+ tryAgain: '重试',
},
addNewCard: {
other: '其他',
@@ -6204,7 +6205,6 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
conciergeNotificationTitle: 'Concierge 会通知你',
conciergeNotificationDescription: '流程完成后,Concierge 会向你发送一条消息。',
copyCompleted: '您的工作区设置已复制。',
- copyFailedTitle: '复制失败',
},
upgrade: {
title: '部分功能需要 Control 方案',
diff --git a/src/libs/API/parameters/CopyPolicySettingsNotifyParams.ts b/src/libs/API/parameters/CopyPolicySettingsNotifyParams.ts
deleted file mode 100644
index ede128e9ea8e..000000000000
--- a/src/libs/API/parameters/CopyPolicySettingsNotifyParams.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-type CopyPolicySettingsNotifyParams = {
- /** When true, only notify via Concierge if the copy fails (set when the user dismisses the in-progress modal) */
- shouldOnlyNotifyOnFailure: boolean;
-};
-
-export default CopyPolicySettingsNotifyParams;
diff --git a/src/libs/API/parameters/index.ts b/src/libs/API/parameters/index.ts
index c9f0bf5e731c..593609bc860b 100644
--- a/src/libs/API/parameters/index.ts
+++ b/src/libs/API/parameters/index.ts
@@ -118,7 +118,6 @@ export type {default as UpdateAutomaticTimezoneParams} from './UpdateAutomaticTi
export type {default as UpdateChatPriorityModeParams} from './UpdateChatPriorityModeParams';
export type {default as DuplicateWorkspaceParams} from './DuplicateWorkspaceParams';
export type {default as CopyPolicySettingsParams} from './CopyPolicySettingsParams';
-export type {default as CopyPolicySettingsNotifyParams} from './CopyPolicySettingsNotifyParams';
export type {default as UpdateDisplayNameParams} from './UpdateDisplayNameParams';
export type {default as UpdateChatNameParams} from './UpdateChatNameParams';
export type {default as UpdateGroupChatMemberRolesParams} from './UpdateGroupChatMemberRolesParams';
diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts
index 7f9799218775..5667ec073a27 100644
--- a/src/libs/API/types.ts
+++ b/src/libs/API/types.ts
@@ -1043,7 +1043,7 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.MARK_AS_CASH]: Parameters.MarkAsCashParams;
[WRITE_COMMANDS.DUPLICATE_POLICY]: Parameters.DuplicateWorkspaceParams;
[WRITE_COMMANDS.COPY_POLICY_SETTINGS]: Parameters.CopyPolicySettingsParams;
- [WRITE_COMMANDS.COPY_POLICY_SETTINGS_NOTIFY]: Parameters.CopyPolicySettingsNotifyParams;
+ [WRITE_COMMANDS.COPY_POLICY_SETTINGS_NOTIFY]: EmptyObject;
[WRITE_COMMANDS.MERGE_DUPLICATES]: Parameters.MergeDuplicatesParams;
[WRITE_COMMANDS.RESOLVE_DUPLICATES]: Parameters.ResolveDuplicatesParams;
[WRITE_COMMANDS.MERGE_TRANSACTION]: Parameters.MergeTransactionParams;
diff --git a/src/libs/actions/Policy/CopyPolicySettings.ts b/src/libs/actions/Policy/CopyPolicySettings.ts
index 705c705e2717..2457bf0700be 100644
--- a/src/libs/actions/Policy/CopyPolicySettings.ts
+++ b/src/libs/actions/Policy/CopyPolicySettings.ts
@@ -104,8 +104,8 @@ function clearCopyPolicySettings(): void {
Onyx.set(ONYXKEYS.COPY_POLICY_SETTINGS, {});
}
-function requestCopyPolicySettingsNotification(shouldOnlyNotifyOnFailure = false): void {
- write(WRITE_COMMANDS.COPY_POLICY_SETTINGS_NOTIFY, {shouldOnlyNotifyOnFailure});
+function requestCopyPolicySettingsNotification(): void {
+ write(WRITE_COMMANDS.COPY_POLICY_SETTINGS_NOTIFY, {});
}
function findCustomUnitByName(policy: Policy | undefined, unitName: string): CustomUnit | undefined {
diff --git a/src/pages/EnablePayments/Pay/Onfido/OnfidoPrivacy.tsx b/src/pages/EnablePayments/Pay/Onfido/OnfidoPrivacy.tsx
index 831d8af16650..4ace7e1a24c5 100644
--- a/src/pages/EnablePayments/Pay/Onfido/OnfidoPrivacy.tsx
+++ b/src/pages/EnablePayments/Pay/Onfido/OnfidoPrivacy.tsx
@@ -77,7 +77,7 @@ function OnfidoPrivacy({walletOnfidoData = DEFAULT_WALLET_ONFIDO_DATA}: OnfidoPr
}}
message={onfidoError}
isLoading={isLoading}
- buttonText={translate(onfidoError ? 'common.tryAgain' : 'common.continue')}
+ buttonText={onfidoError ? translate('onfidoStep.tryAgain') : translate('common.continue')}
containerStyles={[styles.mh0, styles.mv0, styles.mb0]}
/>
diff --git a/src/pages/EnablePayments/Wallet/VerifyIdentity/VerifyIdentity.tsx b/src/pages/EnablePayments/Wallet/VerifyIdentity/VerifyIdentity.tsx
index 517cf91ea15c..6663efc5b9b7 100644
--- a/src/pages/EnablePayments/Wallet/VerifyIdentity/VerifyIdentity.tsx
+++ b/src/pages/EnablePayments/Wallet/VerifyIdentity/VerifyIdentity.tsx
@@ -97,7 +97,7 @@ function VerifyIdentity() {
onSubmit={openOnfidoFlow}
message={onfidoError}
isLoading={walletOnfidoData?.isLoading}
- buttonText={translate(onfidoError ? 'common.tryAgain' : 'common.continue')}
+ buttonText={onfidoError ? translate('onfidoStep.tryAgain') : translate('common.continue')}
containerStyles={[styles.mh0, styles.mv0, styles.mb0]}
/>
diff --git a/src/pages/workspace/copyPolicySettings/CopyPolicySettingsProgressModal.tsx b/src/pages/workspace/copyPolicySettings/CopyPolicySettingsProgressModal.tsx
index cab0cc92f1b9..a19383e6537f 100644
--- a/src/pages/workspace/copyPolicySettings/CopyPolicySettingsProgressModal.tsx
+++ b/src/pages/workspace/copyPolicySettings/CopyPolicySettingsProgressModal.tsx
@@ -1,25 +1,19 @@
import ConfirmModal from '@components/ConfirmModal';
-import RenderHTML from '@components/RenderHTML';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
-import useThemeStyles from '@hooks/useThemeStyles';
import {clearCopyPolicySettings, requestCopyPolicySettingsNotification, setCopyPolicySettingsData} from '@libs/actions/Policy/CopyPolicySettings';
import {navigateToConciergeChat} from '@libs/actions/Report';
-import Navigation from '@libs/Navigation/Navigation';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
-import ROUTES from '@src/ROUTES';
import {hasSeenTourSelector} from '@src/selectors/Onboarding';
import React from 'react';
-import {View} from 'react-native';
function useCopyPolicySettingsProgressModal() {
- const styles = useThemeStyles();
const {translate} = useLocalize();
const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
const [copyPolicySettings] = useOnyx(ONYXKEYS.COPY_POLICY_SETTINGS);
@@ -31,51 +25,13 @@ function useCopyPolicySettingsProgressModal() {
const copyInProgressStep = copyPolicySettings?.currentStep === CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING;
const requestNotificationStep = copyPolicySettings?.currentStep === CONST.POLICY.COPY_SETTINGS_MODAL_STEP.COMPLETE;
- const isCopySettingsComplete = bulkPolicyCopySettings?.state === CONST.POLICY.COPY_SETTINGS_NVP_STATE.COMPLETE;
- const isCopySettingsFailed = bulkPolicyCopySettings?.state === CONST.POLICY.COPY_SETTINGS_NVP_STATE.FAILED;
- const backendErrorMessage = bulkPolicyCopySettings?.error;
-
- // Modal is visible when in progress, when user requested notification, or when failed (while modal is still open)
const isVisible = copyInProgressStep || requestNotificationStep;
-
- // Show failure state when on the loading step AND backend reports failed.
- // User can either try again or dismiss.
- const shouldShowFailure = copyInProgressStep && isCopySettingsFailed;
+ const isCopySettingsComplete = bulkPolicyCopySettings?.state === CONST.POLICY.COPY_SETTINGS_NVP_STATE.COMPLETE;
// Show "All Set" only when on the loading step AND backend reports complete.
// If user already requested Concierge notification (requestNotificationStep), they should stay on that screen since they explicitly chose to be notified rather than wait.
const shouldShowAllSet = copyInProgressStep && isCopySettingsComplete;
- if (shouldShowFailure) {
- const prompt = backendErrorMessage ? (
-
-
-
- ) : (
- translate('workspace.copyPolicySettings.error')
- );
- return {
- isVisible,
- title: translate('workspace.copyPolicySettings.progress.copyFailedTitle'),
- prompt,
- confirmText: translate('common.tryAgain'),
- cancelText: translate('common.dismiss'),
- shouldShowCancelButton: true,
- danger: true,
- onConfirm: () => {
- // Navigate back to the copy settings flow to retry
- clearCopyPolicySettings();
- const sourcePolicyID = copyPolicySettings?.sourcePolicyID;
- if (sourcePolicyID) {
- Navigation.navigate(ROUTES.POLICY_COPY_SETTINGS.getRoute(sourcePolicyID));
- }
- },
- onCancel: () => {
- clearCopyPolicySettings();
- },
- };
- }
-
if (shouldShowAllSet) {
return {
isVisible,
@@ -106,10 +62,7 @@ function useCopyPolicySettingsProgressModal() {
requestCopyPolicySettingsNotification();
setCopyPolicySettingsData({currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.COMPLETE});
},
- onCancel: () => {
- requestCopyPolicySettingsNotification(true);
- clearCopyPolicySettings();
- },
+ onCancel: () => {},
};
}
@@ -144,7 +97,7 @@ function useCopyPolicySettingsProgressModal() {
}
function CopyPolicySettingsProgressModal() {
- const {isVisible, title, prompt, confirmText, cancelText, shouldShowCancelButton, isTitleLoading, danger, onConfirm, onCancel} = useCopyPolicySettingsProgressModal();
+ const {isVisible, title, prompt, confirmText, cancelText, shouldShowCancelButton, isTitleLoading, onConfirm, onCancel} = useCopyPolicySettingsProgressModal();
return (
// eslint-disable-next-line @typescript-eslint/no-deprecated -- The global useConfirmModal()/showConfirmModal() API is one-shot (its promise resolves on the first confirm/cancel and the modal unmounts). This progress modal must stay open across multiple Onyx state transitions ('loading' → notify-requested → 'complete') and update its content in place, which the global system does not support.
@@ -159,8 +112,7 @@ function CopyPolicySettingsProgressModal() {
shouldShowCancelButton={shouldShowCancelButton}
isTitleLoading={isTitleLoading}
shouldHandleNavigationBack
- success={!danger}
- danger={danger}
+ success
/>
);
}
diff --git a/src/types/onyx/CopyPolicySettingsNVP.ts b/src/types/onyx/CopyPolicySettingsNVP.ts
index 873cbde50ffe..8ec684894689 100644
--- a/src/types/onyx/CopyPolicySettingsNVP.ts
+++ b/src/types/onyx/CopyPolicySettingsNVP.ts
@@ -10,14 +10,8 @@ type CopyPolicySettingsNVP = {
/** Current backend state of the bulk copy job. */
state?: CopyPolicySettingsNVPState;
- /** Whether the user requested a Concierge notification when the copy completes. */
+ /** Whether the user requested a Concierge notification. */
shouldSendToConcierge?: boolean;
-
- /** Whether the user should be notified via Concierge only if the copy fails (set when they dismiss the in-progress modal). */
- shouldSendToConciergeOnFailure?: boolean;
-
- /** Error message from the backend when state is 'failed'. */
- error?: string;
};
export default CopyPolicySettingsNVP;
diff --git a/tests/unit/CopyPolicySettingsProgressModalTest.tsx b/tests/unit/CopyPolicySettingsProgressModalTest.tsx
index d9e3fb7acb7c..de31dfa95ef6 100644
--- a/tests/unit/CopyPolicySettingsProgressModalTest.tsx
+++ b/tests/unit/CopyPolicySettingsProgressModalTest.tsx
@@ -8,40 +8,26 @@ import CopyPolicySettingsProgressModal from '@pages/workspace/copyPolicySettings
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
-import React, {isValidElement} from 'react';
+import React from 'react';
import Onyx from 'react-native-onyx';
-import waitForBatchedUpdatesWithAct from '../utils/waitForBatchedUpdatesWithAct';
+import waitForBatchedUpdates from '../utils/waitForBatchedUpdates';
type MockConfirmModalProps = {
isVisible?: boolean;
onConfirm?: () => void;
onCancel?: () => void;
title?: string;
- prompt?: string | React.ReactNode;
+ prompt?: string;
confirmText?: string;
cancelText?: string;
shouldShowCancelButton?: boolean;
shouldHandleNavigationBack?: boolean;
success?: boolean;
- danger?: boolean;
};
let lastModalProps: MockConfirmModalProps | undefined;
-function getBackendErrorFromPrompt(prompt: string | React.ReactNode | undefined): string | undefined {
- if (!isValidElement<{children: React.ReactNode}>(prompt)) {
- return undefined;
- }
-
- const renderHTML = prompt.props.children;
- if (isValidElement<{html: string}>(renderHTML)) {
- return renderHTML.props.html;
- }
-
- return undefined;
-}
-
jest.mock('@hooks/useLocalize', () => () => ({
translate: (key: string) => key,
}));
@@ -57,11 +43,6 @@ jest.mock('@components/ConfirmModal', () => {
};
});
-jest.mock('@components/RenderHTML', () => ({
- __esModule: true,
- default: () => null,
-}));
-
jest.mock('@libs/actions/Policy/CopyPolicySettings', () => ({
clearCopyPolicySettings: jest.fn(),
requestCopyPolicySettingsNotification: jest.fn(),
@@ -72,13 +53,6 @@ jest.mock('@libs/actions/Report', () => ({
navigateToConciergeChat: jest.fn(),
}));
-const mockNavigate = jest.fn();
-jest.mock('@libs/Navigation/Navigation', () => ({
- navigate: (route: string) => {
- mockNavigate(route);
- },
-}));
-
jest.mock('@src/selectors/Onboarding', () => ({
hasSeenTourSelector: () => true,
}));
@@ -88,16 +62,8 @@ const mockRequestNotification = jest.mocked(requestCopyPolicySettingsNotificatio
const mockSetCopyPolicySettingsData = jest.mocked(setCopyPolicySettingsData);
const mockNavigateToConcierge = jest.mocked(navigateToConciergeChat);
-async function setOnyxState(setter: () => Promise) {
- await act(async () => {
- await setter();
- await waitForBatchedUpdatesWithAct();
- });
-}
-
-async function renderModal() {
- render();
- await waitForBatchedUpdatesWithAct();
+function renderModal() {
+ return render();
}
describe('CopyPolicySettingsProgressModal', () => {
@@ -105,42 +71,40 @@ describe('CopyPolicySettingsProgressModal', () => {
Onyx.init({keys: ONYXKEYS});
});
- beforeEach(async () => {
+ beforeEach(() => {
lastModalProps = undefined;
jest.clearAllMocks();
- await act(async () => {
- await Onyx.clear();
- await waitForBatchedUpdatesWithAct();
- });
+ return Onyx.clear().then(waitForBatchedUpdates);
+ });
+
+ afterEach(() => {
+ return Onyx.clear();
});
describe('visibility', () => {
it('should not be visible when currentStep is null', async () => {
- await setOnyxState(async () => {
- await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: null});
- });
+ await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: null});
+ await waitForBatchedUpdates();
- await renderModal();
+ renderModal();
expect(lastModalProps?.isVisible).toBe(false);
});
it('should be visible when currentStep is loading', async () => {
- await setOnyxState(async () => {
- await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING});
- });
+ await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING});
+ await waitForBatchedUpdates();
- await renderModal();
+ renderModal();
expect(lastModalProps?.isVisible).toBe(true);
});
it('should be visible when currentStep is complete', async () => {
- await setOnyxState(async () => {
- await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.COMPLETE});
- });
+ await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.COMPLETE});
+ await waitForBatchedUpdates();
- await renderModal();
+ renderModal();
expect(lastModalProps?.isVisible).toBe(true);
});
@@ -148,32 +112,31 @@ describe('CopyPolicySettingsProgressModal', () => {
describe('loading state (initial)', () => {
beforeEach(async () => {
- await setOnyxState(async () => {
- await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING});
- });
+ await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING});
+ await waitForBatchedUpdates();
});
- it('should show copy-in-progress title and description', async () => {
- await renderModal();
+ it('should show copy-in-progress title and description', () => {
+ renderModal();
expect(lastModalProps?.title).toBe('workspace.copyPolicySettings.progress.copyInProgressTitle');
expect(lastModalProps?.prompt).toBe('workspace.copyPolicySettings.progress.copyInProgressDescription');
});
- it('should show "let me know" as confirm text', async () => {
- await renderModal();
+ it('should show "let me know" as confirm text', () => {
+ renderModal();
expect(lastModalProps?.confirmText).toBe('workspace.copyPolicySettings.progress.letMeKnowPrompt');
});
- it('should not show cancel button', async () => {
- await renderModal();
+ it('should not show cancel button', () => {
+ renderModal();
expect(lastModalProps?.shouldShowCancelButton).toBe(false);
});
- it('should call requestCopyPolicySettingsNotification on confirm', async () => {
- await renderModal();
+ it('should call requestCopyPolicySettingsNotification on confirm', () => {
+ renderModal();
act(() => {
lastModalProps?.onConfirm?.();
@@ -185,13 +148,12 @@ describe('CopyPolicySettingsProgressModal', () => {
describe('loading state (after notification requested)', () => {
beforeEach(async () => {
- await setOnyxState(async () => {
- await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING});
- });
+ await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING});
+ await waitForBatchedUpdates();
});
- it('should request notification and set currentStep to complete', async () => {
- await renderModal();
+ it('should request notification and set currentStep to complete', () => {
+ renderModal();
act(() => {
lastModalProps?.onConfirm?.();
@@ -204,28 +166,27 @@ describe('CopyPolicySettingsProgressModal', () => {
describe('concierge notification state', () => {
beforeEach(async () => {
- await setOnyxState(async () => {
- await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.COMPLETE});
- });
+ await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.COMPLETE});
+ await waitForBatchedUpdates();
});
- it('should show concierge notification title and description', async () => {
- await renderModal();
+ it('should show concierge notification title and description', () => {
+ renderModal();
expect(lastModalProps?.title).toBe('workspace.copyPolicySettings.progress.conciergeNotificationTitle');
expect(lastModalProps?.prompt).toBe('workspace.copyPolicySettings.progress.conciergeNotificationDescription');
});
- it('should show go-to-concierge as confirm and dismiss as cancel', async () => {
- await renderModal();
+ it('should show go-to-concierge as confirm and dismiss as cancel', () => {
+ renderModal();
expect(lastModalProps?.confirmText).toBe('common.goToConcierge');
expect(lastModalProps?.cancelText).toBe('common.dismiss');
expect(lastModalProps?.shouldShowCancelButton).toBe(true);
});
- it('should clear state and navigate to concierge on confirm', async () => {
- await renderModal();
+ it('should clear state and navigate to concierge on confirm', () => {
+ renderModal();
act(() => {
lastModalProps?.onConfirm?.();
@@ -235,8 +196,8 @@ describe('CopyPolicySettingsProgressModal', () => {
expect(mockNavigateToConcierge).toHaveBeenCalledTimes(1);
});
- it('should clear state on cancel (dismiss)', async () => {
- await renderModal();
+ it('should clear state on cancel (dismiss)', () => {
+ renderModal();
act(() => {
lastModalProps?.onCancel?.();
@@ -249,28 +210,27 @@ describe('CopyPolicySettingsProgressModal', () => {
describe('complete state', () => {
beforeEach(async () => {
- await setOnyxState(async () => {
- await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING});
- await Onyx.merge(ONYXKEYS.NVP_BULK_POLICY_COPY_SETTINGS, {state: CONST.POLICY.COPY_SETTINGS_NVP_STATE.COMPLETE});
- });
+ await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING});
+ await Onyx.merge(ONYXKEYS.NVP_BULK_POLICY_COPY_SETTINGS, {state: CONST.POLICY.COPY_SETTINGS_NVP_STATE.COMPLETE});
+ await waitForBatchedUpdates();
});
- it('should show all-set title and copy-completed description', async () => {
- await renderModal();
+ it('should show all-set title and copy-completed description', () => {
+ renderModal();
expect(lastModalProps?.title).toBe('common.allSet');
expect(lastModalProps?.prompt).toBe('workspace.copyPolicySettings.progress.copyCompleted');
});
- it('should show done as confirm text without cancel button', async () => {
- await renderModal();
+ it('should show done as confirm text without cancel button', () => {
+ renderModal();
expect(lastModalProps?.confirmText).toBe('common.done');
expect(lastModalProps?.shouldShowCancelButton).toBe(false);
});
- it('should clear state on confirm', async () => {
- await renderModal();
+ it('should clear state on confirm', () => {
+ renderModal();
act(() => {
lastModalProps?.onConfirm?.();
@@ -279,8 +239,8 @@ describe('CopyPolicySettingsProgressModal', () => {
expect(mockClearCopyPolicySettings).toHaveBeenCalledTimes(1);
});
- it('should clear state on cancel (browser back)', async () => {
- await renderModal();
+ it('should clear state on cancel (browser back)', () => {
+ renderModal();
act(() => {
lastModalProps?.onCancel?.();
@@ -289,111 +249,10 @@ describe('CopyPolicySettingsProgressModal', () => {
expect(mockClearCopyPolicySettings).toHaveBeenCalledTimes(1);
});
- it('should handle browser back navigation when visible', async () => {
- await renderModal();
+ it('should handle browser back navigation when visible', () => {
+ renderModal();
expect(lastModalProps?.shouldHandleNavigationBack).toBe(true);
});
});
-
- describe('failure state', () => {
- const sourcePolicyID = 'test-policy-123';
-
- beforeEach(async () => {
- await setOnyxState(async () => {
- await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {
- currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING,
- sourcePolicyID,
- });
- await Onyx.merge(ONYXKEYS.NVP_BULK_POLICY_COPY_SETTINGS, {state: CONST.POLICY.COPY_SETTINGS_NVP_STATE.FAILED});
- });
- });
-
- it('should be visible when in loading state and backend reports failed', async () => {
- await renderModal();
-
- expect(lastModalProps?.isVisible).toBe(true);
- });
-
- it('should show failed title', async () => {
- await renderModal();
-
- expect(lastModalProps?.title).toBe('workspace.copyPolicySettings.progress.copyFailedTitle');
- });
-
- it('should show default error message when backend error is not provided', async () => {
- await renderModal();
-
- expect(lastModalProps?.prompt).toBe('workspace.copyPolicySettings.error');
- });
-
- it('should show backend error message when provided', async () => {
- const backendError = 'Something went wrong on the server';
- await setOnyxState(async () => {
- await Onyx.merge(ONYXKEYS.NVP_BULK_POLICY_COPY_SETTINGS, {
- state: CONST.POLICY.COPY_SETTINGS_NVP_STATE.FAILED,
- error: backendError,
- });
- });
-
- await renderModal();
-
- expect(getBackendErrorFromPrompt(lastModalProps?.prompt)).toBe(backendError);
- });
-
- it('should show try again as confirm and dismiss as cancel', async () => {
- await renderModal();
-
- expect(lastModalProps?.confirmText).toBe('common.tryAgain');
- expect(lastModalProps?.cancelText).toBe('common.dismiss');
- expect(lastModalProps?.shouldShowCancelButton).toBe(true);
- });
-
- it('should show danger styling', async () => {
- await renderModal();
-
- expect(lastModalProps?.danger).toBe(true);
- });
-
- it('should clear state and navigate to copy settings flow on confirm (try again)', async () => {
- await renderModal();
-
- act(() => {
- lastModalProps?.onConfirm?.();
- });
-
- expect(mockClearCopyPolicySettings).toHaveBeenCalledTimes(1);
- expect(mockNavigate).toHaveBeenCalledTimes(1);
- });
-
- it('should clear state without navigation on cancel (dismiss)', async () => {
- await renderModal();
-
- act(() => {
- lastModalProps?.onCancel?.();
- });
-
- expect(mockClearCopyPolicySettings).toHaveBeenCalledTimes(1);
- expect(mockNavigate).not.toHaveBeenCalled();
- });
-
- it('should not navigate when sourcePolicyID is not available', async () => {
- await setOnyxState(async () => {
- await Onyx.clear();
- await Onyx.merge(ONYXKEYS.COPY_POLICY_SETTINGS, {
- currentStep: CONST.POLICY.COPY_SETTINGS_MODAL_STEP.LOADING,
- });
- await Onyx.merge(ONYXKEYS.NVP_BULK_POLICY_COPY_SETTINGS, {state: CONST.POLICY.COPY_SETTINGS_NVP_STATE.FAILED});
- });
-
- await renderModal();
-
- act(() => {
- lastModalProps?.onConfirm?.();
- });
-
- expect(mockClearCopyPolicySettings).toHaveBeenCalledTimes(1);
- expect(mockNavigate).not.toHaveBeenCalled();
- });
- });
});