diff --git a/app/frontend/src/components/base/BaseNotificationBar.vue b/app/frontend/src/components/base/BaseNotificationBar.vue
index f99128713..30f33d4e2 100644
--- a/app/frontend/src/components/base/BaseNotificationBar.vue
+++ b/app/frontend/src/components/base/BaseNotificationBar.vue
@@ -1,6 +1,6 @@
diff --git a/app/frontend/src/components/designer/FormViewerActions.vue b/app/frontend/src/components/designer/FormViewerActions.vue
index cd274f32b..5703963a3 100644
--- a/app/frontend/src/components/designer/FormViewerActions.vue
+++ b/app/frontend/src/components/designer/FormViewerActions.vue
@@ -159,23 +159,11 @@ function toggleWideLayout() {
-
-
-
-
-
-
+
{{
- $t('trans.formViewerActions.saveAsADraft')
+ $t('trans.formViewerActions.saveAsDraft')
}}
-
+
diff --git a/app/frontend/src/internationalization/trans/chefs/ar/ar.json b/app/frontend/src/internationalization/trans/chefs/ar/ar.json
index 2579af577..ef7672826 100644
--- a/app/frontend/src/internationalization/trans/chefs/ar/ar.json
+++ b/app/frontend/src/internationalization/trans/chefs/ar/ar.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "فشل الرد من نقطة نهاية الإرسال. رمز الاستجابة: {status}",
"errSubmittingForm": "حدث خطأ أثناء إرسال هذا النموذج",
"errorSavingFile": "خطأ في حفظ الملفات. اسم الملف: {fileName}. خطأ: {error}",
+ "errorDeletingFile": "خطأ في حذف الملفات. اسم الملف: {fileName}. الخطأ: {error}",
"submittingDraftErrMsg": "حدث خطأ أثناء حفظ المسودة",
"submittingDraftConsErrMsg": "خطأ في حفظ المسودة. معرف التقديم: {submitId}. خطأ: {error}",
"formDraftAccessErrMsg": "تم إرسال طلب التقديم بالفعل ، مع إعادة التوجيه إلى صفحة العرض",
- "formUnauthorizedMessage": "غير مخول لك مشاهدة هذا النموذج، يرجى الاتصال بمالك النموذج للحصول على الوصول."
+ "formUnauthorizedMessage": "غير مخول لك مشاهدة هذا النموذج، يرجى الاتصال بمالك النموذج للحصول على الوصول.",
+ "fileUploadWarning": "لتحميل المرفقات، يجب عليك إما النقر على زر \"حفظ كمسودة\" أو إرسال النموذج. إذا انتقلت بعيدًا عن هذه الشاشة، فستفقد مرفقاتك."
},
"bCGovFooter": {
"home": "بيت",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "عرض المسودة / التقديمات الخاصة بي",
- "saveAsADraft": "احفظ كمسودة",
+ "saveAsDraft": "احفظ كمسودة",
"editThisDraft": "قم بتحرير هذه المسودة",
"switchSingleSubmssn": "التبديل إلى الإرسال الفردي",
"switchMultiSubmssn": "التبديل إلى تقديمات متعددة",
@@ -1083,5 +1085,8 @@
"history": "تاريخ",
"user": "مستخدم"
}
+ },
+ "alert": {
+ "warning": "تحذير"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/de/de.json b/app/frontend/src/internationalization/trans/chefs/de/de.json
index 4261135fd..f8e7691cd 100644
--- a/app/frontend/src/internationalization/trans/chefs/de/de.json
+++ b/app/frontend/src/internationalization/trans/chefs/de/de.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "Fehlgeschlagene Antwort vom Übermittlungsendpunkt. Antwortcode: {status}",
"errSubmittingForm": "Beim Absenden dieses Formulars ist ein Fehler aufgetreten",
"errorSavingFile": "Fehler beim Speichern der Dateien. Dateiname: {fileName}. Fehler: {error}",
+ "errorDeletingFile": "Fehler beim Löschen der Dateien. Dateiname: {fileName}. Fehler: {error}",
"submittingDraftErrMsg": "Beim Speichern eines Entwurfs ist ein Fehler aufgetreten",
"submittingDraftConsErrMsg": "Fehler beim Speichern des Entwurfs. Einreichungs-ID: {submissionId}. Fehler: {error}",
"formDraftAccessErrMsg": "Die angeforderte Übermittlung wurde bereits übermittelt und wird zur Ansichtsseite weitergeleitet",
- "formUnauthorizedMessage": "Sie sind nicht berechtigt, dieses Formular anzusehen. Bitte kontaktieren Sie den Formulareigentümer für den Zugang."
+ "formUnauthorizedMessage": "Sie sind nicht berechtigt, dieses Formular anzusehen. Bitte kontaktieren Sie den Formulareigentümer für den Zugang.",
+ "fileUploadWarning": "Um Ihre Anhänge hochzuladen, müssen Sie entweder auf die Schaltfläche „Als Entwurf speichern“ klicken oder Ihr Formular absenden. Wenn Sie diesen Bildschirm verlassen, gehen Ihre Anhänge verloren."
},
"bCGovFooter": {
"home": "Heim",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "Meine Entwürfe/Einreichungen ansehen",
- "saveAsADraft": "Als einen Entwurf sichern",
+ "saveAsDraft": "Als einen Entwurf sichern",
"editThisDraft": "Bearbeiten Sie diesen Entwurf",
"switchSingleSubmssn": "Wechseln Sie zur Einzeleinreichung",
"switchMultiSubmssn": "Wechseln Sie zu mehreren Einreichungen",
@@ -1083,5 +1085,8 @@
"history": "GESCHICHTE",
"user": "Benutzer"
}
+ },
+ "alert": {
+ "warning": "Warnung"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/en/en.json b/app/frontend/src/internationalization/trans/chefs/en/en.json
index fc76f0b3a..95f30b8fd 100644
--- a/app/frontend/src/internationalization/trans/chefs/en/en.json
+++ b/app/frontend/src/internationalization/trans/chefs/en/en.json
@@ -885,10 +885,12 @@
"failedResSubmissn": "Failed response from submission endpoint. Response code: {status}",
"errSubmittingForm": "An error occurred submitting this form",
"errorSavingFile": "Error saving files. Filename: {fileName}. Error: {error}",
+ "errorDeletingFile": "Error deleting files. Filename: {fileName}. Error: {error}",
"submittingDraftErrMsg": "An error occurred while saving a draft",
"submittingDraftConsErrMsg": "Error saving draft. SubmissionId: {submissionId}. Error: {error}",
"formDraftAccessErrMsg": "Requested submission is already submitted, redirecting to View page",
- "formUnauthorizedMessage": "You are not authorized to view this form, please contact the form owner for access."
+ "formUnauthorizedMessage": "You are not authorized to view this form, please contact the form owner for access.",
+ "fileUploadWarning": "To upload your attachments, you must either click on the 'Save as draft' button or submit your form. If you navigate away from this screen, you will lose your attachments."
},
"bCGovFooter": {
"home": "Home",
@@ -965,7 +967,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "View My Drafts/Submissions",
- "saveAsADraft": "Save as a Draft",
+ "saveAsDraft": "Save as Draft",
"editThisDraft": "Edit this Draft",
"switchSingleSubmssn": "Switch to single submission",
"switchMultiSubmssn": "Switch to multiple submissions",
@@ -1146,5 +1148,8 @@
},
"test": {
"customError": "This is a custom error message for testing."
+ },
+ "alert": {
+ "warning": "Warning"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/es/es.json b/app/frontend/src/internationalization/trans/chefs/es/es.json
index fa081d0e2..7f855e00c 100644
--- a/app/frontend/src/internationalization/trans/chefs/es/es.json
+++ b/app/frontend/src/internationalization/trans/chefs/es/es.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "Respuesta fallida desde el punto final de envío. Código de respuesta: {status}",
"errSubmittingForm": "Ocurrió un error al enviar este formulario",
"errorSavingFile": "Error al guardar archivos. Nombre de archivo: {fileName}. Error: {error}",
+ "errorDeletingFile": "Error al eliminar archivos. Nombre de archivo: {fileName}. Error: {error}",
"submittingDraftErrMsg": "Se produjo un error al guardar un borrador",
"submittingDraftConsErrMsg": "Error al guardar el borrador. Id de envío: {submissionId}. Error: {error}",
"formDraftAccessErrMsg": "El envío solicitado ya se envió, redirigiendo a la página Ver",
- "formUnauthorizedMessage": "No tienes autorización para ver este formulario, por favor contacta al propietario del formulario para acceder."
+ "formUnauthorizedMessage": "No tienes autorización para ver este formulario, por favor contacta al propietario del formulario para acceder.",
+ "fileUploadWarning": "Para cargar sus archivos adjuntos, debe hacer clic en el botón \"Guardar como borrador\" o enviar su formulario. Si sale de esta pantalla, perderá sus archivos adjuntos."
},
"bCGovFooter": {
"home": "Hogar",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "Ver mis borradores/presentaciones",
- "saveAsADraft": "Guardar como borrador",
+ "saveAsDraft": "Guardar como borrador",
"editThisDraft": "Editar este borrador",
"switchSingleSubmssn": "Cambiar a envío único",
"switchMultiSubmssn": "Cambiar a envíos múltiples",
@@ -1083,5 +1085,8 @@
"history": "HISTORIA",
"user": "Usuario"
}
+ },
+ "alert": {
+ "warning": "Advertencia"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/fa/fa.json b/app/frontend/src/internationalization/trans/chefs/fa/fa.json
index d849a4218..816499c76 100644
--- a/app/frontend/src/internationalization/trans/chefs/fa/fa.json
+++ b/app/frontend/src/internationalization/trans/chefs/fa/fa.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "پاسخ ناموفق از نقطه پایان ارسال. کد پاسخ: {status}",
"errSubmittingForm": "هنگام ارسال این فرم خطایی روی داد",
"errorSavingFile": "خطا در ذخیره فایل ها. نام فایل: {fileName}. خطا: {error}",
+ "errorDeletingFile": "خطا در حذف فایل ها نام فایل: {fileName}. خطا: {خطا}",
"submittingDraftErrMsg": "هنگام ذخیره پیش نویس خطایی روی داد",
"submittingDraftConsErrMsg": "خطا در ذخیره پیش نویس. SubmissionId: {submissionId}. خطا: {error}",
"formDraftAccessErrMsg": "ارسال درخواستی قبلا ارسال شده است، به صفحه مشاهده هدایت می شود",
- "formUnauthorizedMessage": "شما مجاز به مشاهده این فرم نیستید، لطفاً برای دسترسی با مالک فرم تماس بگیرید."
+ "formUnauthorizedMessage": "شما مجاز به مشاهده این فرم نیستید، لطفاً برای دسترسی با مالک فرم تماس بگیرید.",
+ "fileUploadWarning": "برای آپلود پیوست های خود، یا باید بر روی دکمه \"ذخیره به عنوان پیش نویس\" کلیک کنید یا فرم خود را ارسال کنید. اگر از این صفحه دور شوید، پیوست های خود را از دست خواهید داد."
},
"bCGovFooter": {
"home": "صفحه اصلی",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "مشاهده پیش نویس/موارد ارسالی من",
- "saveAsADraft": "ذخیره به عنوان پیش نویس",
+ "saveAsDraft": "ذخیره به عنوان پیش نویس",
"editThisDraft": "این پیش نویس را ویرایش کنید",
"switchSingleSubmssn": "به ارسال تکی بروید",
"switchMultiSubmssn": "تغییر به ارسال های متعدد",
@@ -1083,5 +1085,8 @@
"history": "تاریخ",
"user": "کاربر"
}
+ },
+ "alert": {
+ "warning": "هشدار"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/fr/fr.json b/app/frontend/src/internationalization/trans/chefs/fr/fr.json
index 234a30b0a..b358e4e99 100644
--- a/app/frontend/src/internationalization/trans/chefs/fr/fr.json
+++ b/app/frontend/src/internationalization/trans/chefs/fr/fr.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "Échec de la réponse du point de terminaison de soumission. Code de réponse : {status}",
"errSubmittingForm": "Une erreur s'est produite lors de la soumission de ce formulaire",
"errorSavingFile": "Erreur lors de l'enregistrement des fichiers. Nom de fichier : {fileName}. Erreur : {error}",
+ "errorDeletingFile": "Erreur lors de la suppression des fichiers. Nom de fichier : {fileName}. Erreur : {error}",
"submittingDraftErrMsg": "Une erreur s'est produite lors de l'enregistrement d'un brouillon",
"submittingDraftConsErrMsg": "Erreur lors de l'enregistrement du brouillon. ID de soumission : {submissionId}. Erreur : {error}",
"formDraftAccessErrMsg": "La soumission demandée est déjà soumise, redirigeant vers la page Afficher",
- "formUnauthorizedMessage": "Vous n'êtes pas autorisé à voir ce formulaire, veuillez contacter le propriétaire du formulaire pour accéder."
+ "formUnauthorizedMessage": "Vous n'êtes pas autorisé à voir ce formulaire, veuillez contacter le propriétaire du formulaire pour accéder.",
+ "fileUploadWarning": "Pour télécharger vos pièces jointes, vous devez cliquer sur le bouton « Enregistrer comme brouillon » ou soumettre votre formulaire. Si vous quittez cet écran, vous perdrez vos pièces jointes."
},
"bCGovFooter": {
"home": "Maison",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "Afficher mes brouillons/soumissions",
- "saveAsADraft": "Enregistrer en tant que projet",
+ "saveAsDraft": "Enregistrer en tant que projet",
"editThisDraft": "Modifier ce brouillon",
"switchSingleSubmssn": "Passer à la soumission unique",
"switchMultiSubmssn": "Passer à plusieurs soumissions",
@@ -1083,5 +1085,8 @@
"history": "HISTOIRE",
"user": "Utilisateur"
}
+ },
+ "alert": {
+ "warning": "Avertissement"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/hi/hi.json b/app/frontend/src/internationalization/trans/chefs/hi/hi.json
index 5bc902194..d737ed2ee 100644
--- a/app/frontend/src/internationalization/trans/chefs/hi/hi.json
+++ b/app/frontend/src/internationalization/trans/chefs/hi/hi.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "सबमिशन समापन बिंदु से विफल प्रतिक्रिया। प्रतिक्रिया कोड: {status}",
"errSubmittingForm": "इस फ़ॉर्म को सबमिट करते समय एक त्रुटि हुई",
"errorSavingFile": "फ़ाइलें सहेजने में त्रुटि. फ़ाइल का नाम: {fileName}. त्रुटि: {error}",
+ "errorDeletingFile": "फ़ाइलें हटाने में त्रुटि. फ़ाइल नाम: {fileName}. त्रुटि: {error}",
"submittingDraftErrMsg": "ड्राफ्ट सहेजते समय एक त्रुटि उत्पन्न हुई",
"submittingDraftConsErrMsg": "ड्राफ्ट सहेजने में त्रुटि. सबमिशनआईडी: {submissionId}। त्रुटि: {error}",
"formDraftAccessErrMsg": "अनुरोधित सबमिशन पहले ही सबमिट किया जा चुका है, व्यू पेज पर रीडायरेक्ट किया जा रहा है",
- "formUnauthorizedMessage": "आप इस फॉर्म को देखने के लिए अधिकृत नहीं हैं, कृपया पहुँच प्राप्त करने के लिए फॉर्म के मालिक से संपर्क करें।"
+ "formUnauthorizedMessage": "आप इस फॉर्म को देखने के लिए अधिकृत नहीं हैं, कृपया पहुँच प्राप्त करने के लिए फॉर्म के मालिक से संपर्क करें।",
+ "fileUploadWarning": "अपने अनुलग्नक अपलोड करने के लिए, आपको या तो 'ड्राफ्ट के रूप में सहेजें' बटन पर क्लिक करना होगा या अपना फ़ॉर्म सबमिट करना होगा। यदि आप इस स्क्रीन से दूर जाते हैं, तो आप अपने अनुलग्नक खो देंगे।"
},
"bCGovFooter": {
"home": "घर",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "मेरा ड्राफ्ट/प्रस्तुतियाँ देखें",
- "saveAsADraft": "एक मसौदे के रूप में सहेजो",
+ "saveAsDraft": "एक मसौदे के रूप में सहेजो",
"editThisDraft": "इस ड्राफ्ट को संपादित करें",
"switchSingleSubmssn": "एकल सबमिशन पर स्विच करें",
"switchMultiSubmssn": "एकाधिक सबमिशन पर स्विच करें",
@@ -1083,5 +1085,8 @@
"history": "इतिहास",
"user": "उपयोगकर्ता"
}
+ },
+ "alert": {
+ "warning": "चेतावनी"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/it/it.json b/app/frontend/src/internationalization/trans/chefs/it/it.json
index 1dbc38bfb..398df7815 100644
--- a/app/frontend/src/internationalization/trans/chefs/it/it.json
+++ b/app/frontend/src/internationalization/trans/chefs/it/it.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "Risposta non riuscita dall'endpoint di invio. Codice di risposta: {status}",
"errSubmittingForm": "Si è verificato un errore durante l'invio di questo modulo",
"errorSavingFile": "Errore durante il salvataggio dei file. nome file: {fileName}. Errore: {error}",
+ "errorDeletingFile": "Errore durante l'eliminazione dei file. Nome file: {fileName}. Errore: {error}",
"submittingDraftErrMsg": "Si è verificato un errore durante il salvataggio di una bozza",
"submittingDraftConsErrMsg": "Errore durante il salvataggio della bozza. SubmissionId: {submissionId}. Errore: {error}",
"formDraftAccessErrMsg": "L'invio richiesto è già stato inviato, reindirizzamento alla pagina Visualizza",
- "formUnauthorizedMessage": "Non sei autorizzato a visualizzare questo modulo, si prega di contattare il proprietario del modulo per l'accesso."
+ "formUnauthorizedMessage": "Non sei autorizzato a visualizzare questo modulo, si prega di contattare il proprietario del modulo per l'accesso.",
+ "fileUploadWarning": "Per caricare i tuoi allegati, devi cliccare sul pulsante \"Salva come bozza\" o inviare il tuo modulo. Se esci da questa schermata, perderai i tuoi allegati."
},
"bCGovFooter": {
"home": "Casa",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "Visualizza le mie bozze/presentazioni",
- "saveAsADraft": "Salva come bozza",
+ "saveAsDraft": "Salva come bozza",
"editThisDraft": "Modifica questa bozza",
"switchSingleSubmssn": "Passa all'invio singolo",
"switchMultiSubmssn": "Passa a più invii",
@@ -1083,5 +1085,8 @@
"history": "STORIA",
"user": "Utente"
}
+ },
+ "alert": {
+ "warning": "Avvertimento"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/ja/ja.json b/app/frontend/src/internationalization/trans/chefs/ja/ja.json
index c96262e4c..3a511d39e 100644
--- a/app/frontend/src/internationalization/trans/chefs/ja/ja.json
+++ b/app/frontend/src/internationalization/trans/chefs/ja/ja.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "送信エンドポイントからの応答が失敗しました。レスポンスコード: {status}",
"errSubmittingForm": "このフォームの送信中にエラーが発生しました",
"errorSavingFile": "ファイルの保存中にエラーが発生しました。ファイル名: {fileName}。エラー: {error}",
+ "errorDeletingFile": "ファイルの削除中にエラーが発生しました。ファイル名: {fileName}。エラー: {error}",
"submittingDraftErrMsg": "下書きの保存中にエラーが発生しました",
"submittingDraftConsErrMsg": "下書きの保存中にエラーが発生しました。送信 ID: {submissionId}。エラー: {error}",
"formDraftAccessErrMsg": "リクエストされた送信はすでに送信されており、[表示] ページにリダイレクトされます。",
- "formUnauthorizedMessage": "このフォームを表示する権限がありません。アクセスするにはフォームの所有者に連絡してください。"
+ "formUnauthorizedMessage": "このフォームを表示する権限がありません。アクセスするにはフォームの所有者に連絡してください。",
+ "fileUploadWarning": "添付ファイルをアップロードするには、「下書きとして保存」ボタンをクリックするか、フォームを送信する必要があります。この画面から移動すると、添付ファイルは失われます。"
},
"bCGovFooter": {
"home": "家",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "私のドラフト/提出物を表示する",
- "saveAsADraft": "下書きとして保存",
+ "saveAsDraft": "下書きとして保存",
"editThisDraft": "この下書きを編集する",
"switchSingleSubmssn": "単一の提出に切り替える",
"switchMultiSubmssn": "複数の提出に切り替える",
@@ -1083,5 +1085,8 @@
"history": "歴史",
"user": "ユーザー"
}
+ },
+ "alert": {
+ "warning": "警告"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/ko/ko.json b/app/frontend/src/internationalization/trans/chefs/ko/ko.json
index 761f54dcc..32e7fdfdc 100644
--- a/app/frontend/src/internationalization/trans/chefs/ko/ko.json
+++ b/app/frontend/src/internationalization/trans/chefs/ko/ko.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "제출 끝점에서 실패한 응답입니다. 응답 코드: {status}",
"errSubmittingForm": "이 양식을 제출하는 중에 오류가 발생했습니다.",
"errorSavingFile": "파일을 저장하는 중에 오류가 발생했습니다. 파일 이름: {fileName}. 오류: {error}",
+ "errorDeletingFile": "파일 삭제 오류. 파일 이름: {fileName}. 오류: {error}",
"submittingDraftErrMsg": "초안을 저장하는 중에 오류가 발생했습니다.",
"submittingDraftConsErrMsg": "초안을 저장하는 중에 오류가 발생했습니다. 제출 ID: {submissionId}. 오류: {error}",
"formDraftAccessErrMsg": "요청한 제출이 이미 제출되었으며 보기 페이지로 리디렉션됩니다.",
- "formUnauthorizedMessage": "이 양식을 볼 수 있는 권한이 없습니다. 접근하려면 양식 소유자에게 연락하세요."
+ "formUnauthorizedMessage": "이 양식을 볼 수 있는 권한이 없습니다. 접근하려면 양식 소유자에게 연락하세요.",
+ "fileUploadWarning": "첨부 파일을 업로드하려면 '임시 저장' 버튼을 클릭하거나 양식을 제출해야 합니다. 이 화면에서 벗어나면 첨부 파일이 손실됩니다."
},
"bCGovFooter": {
"home": "집",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "내 초안/제출물 보기",
- "saveAsADraft": "초안으로 저장",
+ "saveAsDraft": "초안으로 저장",
"editThisDraft": "이 초안 편집",
"switchSingleSubmssn": "단일 제출로 전환",
"switchMultiSubmssn": "다중 제출로 전환",
@@ -1083,5 +1085,8 @@
"history": "역사",
"user": "사용자"
}
+ },
+ "alert": {
+ "warning": "경고"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/pa/pa.json b/app/frontend/src/internationalization/trans/chefs/pa/pa.json
index f62404cd3..fcdd919a2 100644
--- a/app/frontend/src/internationalization/trans/chefs/pa/pa.json
+++ b/app/frontend/src/internationalization/trans/chefs/pa/pa.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "ਸਪੁਰਦਗੀ ਅੰਤਮ ਬਿੰਦੂ ਤੋਂ ਅਸਫਲ ਜਵਾਬ। ਜਵਾਬ ਕੋਡ: {status}",
"errSubmittingForm": "ਇਸ ਫਾਰਮ ਨੂੰ ਸਪੁਰਦ ਕਰਨ ਵਿੱਚ ਇੱਕ ਤਰੁੱਟੀ ਉਤਪੰਨ ਹੋਈ",
"errorSavingFile": "ਫ਼ਾਈਲਾਂ ਨੂੰ ਰੱਖਿਅਤ ਕਰਨ ਵਿੱਚ ਗੜਬੜ ਹੋਈ। ਫ਼ਾਈਲ ਦਾ ਨਾਮ: {fileName}। ਗਲਤੀ: {error}",
+ "errorDeletingFile": "ਫ਼ਾਈਲਾਂ ਨੂੰ ਮਿਟਾਉਣ ਵਿੱਚ ਗੜਬੜ ਹੋਈ। ਫ਼ਾਈਲ ਦਾ ਨਾਮ: {fileName}। ਗਲਤੀ: {error}",
"submittingDraftErrMsg": "ਡਰਾਫਟ ਨੂੰ ਸੁਰੱਖਿਅਤ ਕਰਨ ਦੌਰਾਨ ਇੱਕ ਤਰੁੱਟੀ ਉਤਪੰਨ ਹੋਈ",
"submittingDraftConsErrMsg": "ਡਰਾਫਟ ਸੁਰੱਖਿਅਤ ਕਰਨ ਵਿੱਚ ਤਰੁੱਟੀ। SubmissionId: {submissionId}। ਗਲਤੀ: {error}",
"formDraftAccessErrMsg": "ਬੇਨਤੀ ਕੀਤੀ ਸਪੁਰਦਗੀ ਪਹਿਲਾਂ ਹੀ ਸਪੁਰਦ ਕੀਤੀ ਗਈ ਹੈ, ਵੇਖੋ ਪੰਨੇ 'ਤੇ ਰੀਡਾਇਰੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ",
- "formUnauthorizedMessage": "ਤੁਹਾਨੂੰ ਇਸ ਫਾਰਮ ਨੂੰ ਵੇਖਣ ਦੀ ਅਧਿਕਾਰਤਾ ਨਹੀਂ ਹੈ, ਕਿਰਪਾ ਕਰਕੇ ਪਹੁੰਚ ਲਈ ਫਾਰਮ ਦੇ ਮਾਲਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।"
+ "formUnauthorizedMessage": "ਤੁਹਾਨੂੰ ਇਸ ਫਾਰਮ ਨੂੰ ਵੇਖਣ ਦੀ ਅਧਿਕਾਰਤਾ ਨਹੀਂ ਹੈ, ਕਿਰਪਾ ਕਰਕੇ ਪਹੁੰਚ ਲਈ ਫਾਰਮ ਦੇ ਮਾਲਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।",
+ "fileUploadWarning": "ਆਪਣੀਆਂ ਅਟੈਚਮੈਂਟਾਂ ਨੂੰ ਅਪਲੋਡ ਕਰਨ ਲਈ, ਤੁਹਾਨੂੰ ਜਾਂ ਤਾਂ 'ਡਰਾਫਟ ਦੇ ਰੂਪ ਵਿੱਚ ਸੁਰੱਖਿਅਤ ਕਰੋ' ਬਟਨ 'ਤੇ ਕਲਿੱਕ ਕਰਨਾ ਚਾਹੀਦਾ ਹੈ ਜਾਂ ਆਪਣਾ ਫਾਰਮ ਜਮ੍ਹਾਂ ਕਰਨਾ ਚਾਹੀਦਾ ਹੈ। ਜੇਕਰ ਤੁਸੀਂ ਇਸ ਸਕ੍ਰੀਨ ਤੋਂ ਦੂਰ ਨੈਵੀਗੇਟ ਕਰਦੇ ਹੋ, ਤਾਂ ਤੁਸੀਂ ਆਪਣੇ ਅਟੈਚਮੈਂਟਾਂ ਨੂੰ ਗੁਆ ਦੇਵੋਗੇ"
},
"bCGovFooter": {
"home": "ਘਰ",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "ਮੇਰਾ ਡਰਾਫਟ/ਸਬਮਿਸ਼ਨ ਦੇਖੋ",
- "saveAsADraft": "ਇੱਕ ਡਰਾਫਟ ਦੇ ਰੂਪ ਵਿੱਚ ਸੁਰੱਖਿਅਤ ਕਰੋ",
+ "saveAsDraft": "ਇੱਕ ਡਰਾਫਟ ਦੇ ਰੂਪ ਵਿੱਚ ਸੁਰੱਖਿਅਤ ਕਰੋ",
"editThisDraft": "ਇਸ ਡਰਾਫਟ ਨੂੰ ਸੰਪਾਦਿਤ ਕਰੋ",
"switchSingleSubmssn": "ਸਿੰਗਲ ਸਬਮਿਸ਼ਨ 'ਤੇ ਸਵਿਚ ਕਰੋ",
"switchMultiSubmssn": "ਕਈ ਸਬਮਿਸ਼ਨਾਂ 'ਤੇ ਸਵਿਚ ਕਰੋ",
@@ -1083,5 +1085,8 @@
"history": "ਇਤਿਹਾਸ",
"user": "ਉਪਭੋਗਤਾ"
}
+ },
+ "alert": {
+ "warning": "ਚੇਤਾਵਨੀ"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/pt/pt.json b/app/frontend/src/internationalization/trans/chefs/pt/pt.json
index 4ec6f0cf2..22cc13961 100644
--- a/app/frontend/src/internationalization/trans/chefs/pt/pt.json
+++ b/app/frontend/src/internationalization/trans/chefs/pt/pt.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "Falha na resposta do endpoint de envio. Código de resposta: {status}",
"errSubmittingForm": "Ocorreu um erro ao enviar este formulário",
"errorSavingFile": "Erro ao salvar arquivos. Nome do arquivo: {fileName}. Erro: {error}",
+ "errorDeletingFile": "Erro ao excluir arquivos. Nome do arquivo: {fileName}. Erro: {error}",
"submittingDraftErrMsg": "Ocorreu um erro ao salvar um rascunho",
"submittingDraftConsErrMsg": "Erro ao salvar rascunho. SubmissãoId: {submissionId}. Erro: {error}",
"formDraftAccessErrMsg": "O envio solicitado já foi enviado, redirecionando para a página Exibir",
- "formUnauthorizedMessage": "Você não está autorizado a visualizar este formulário, por favor, contate o proprietário do formulário para acesso."
+ "formUnauthorizedMessage": "Você não está autorizado a visualizar este formulário, por favor, contate o proprietário do formulário para acesso.",
+ "fileUploadWarning": "Para enviar os seus anexos, deve clicar no botão 'Guardar como rascunho' ou enviar o seu formulário. Se sair deste ecrã, perderá os seus anexos"
},
"bCGovFooter": {
"home": "Lar",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "Ver meus rascunhos/envios",
- "saveAsADraft": "Salve como um rascunho",
+ "saveAsDraft": "Salve como um rascunho",
"editThisDraft": "Editar este rascunho",
"switchSingleSubmssn": "Alternar para envio único",
"switchMultiSubmssn": "Mudar para vários envios",
@@ -1083,5 +1085,8 @@
"history": "HISTÓRIA",
"user": "Do utilizador"
}
+ },
+ "alert": {
+ "warning": "Aviso"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/ru/ru.json b/app/frontend/src/internationalization/trans/chefs/ru/ru.json
index 3fb7a82b3..7cc11d6e6 100644
--- a/app/frontend/src/internationalization/trans/chefs/ru/ru.json
+++ b/app/frontend/src/internationalization/trans/chefs/ru/ru.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "Неудачный ответ от конечной точки отправки. Код ответа: {status}",
"errSubmittingForm": "При отправке этой формы произошла ошибка",
"errorSavingFile": "Ошибка сохранения файлов. Имя файла: {fileName}. Ошибка: {error}",
+ "errorDeletingFile": "Ошибка удаления файлов. Имя файла: {fileName}. Ошибка: {error}",
"submittingDraftErrMsg": "Произошла ошибка при сохранении черновика",
"submittingDraftConsErrMsg": "Не удалось сохранить черновик. Идентификатор записи: {submissionId}. Ошибка: {error}",
"formDraftAccessErrMsg": "Запрошенная отправка уже отправлена, перенаправление на страницу просмотра",
- "formUnauthorizedMessage": "Вы не авторизованы для просмотра этой формы, пожалуйста, свяжитесь с владельцем формы для доступа."
+ "formUnauthorizedMessage": "Вы не авторизованы для просмотра этой формы, пожалуйста, свяжитесь с владельцем формы для доступа.",
+ "fileUploadWarning": "Чтобы загрузить вложения, вам необходимо нажать кнопку «Сохранить как черновик» или отправить форму. Если вы уйдете с этого экрана, вы потеряете свои вложения"
},
"bCGovFooter": {
"home": "Главная страница",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "Просмотреть мои черновики/представленные материалы",
- "saveAsADraft": "Сохранить как черновик",
+ "saveAsDraft": "Сохранить как черновик",
"editThisDraft": "Изменить этот черновик",
"switchSingleSubmssn": "Переключиться на одиночную отправку",
"switchMultiSubmssn": "Переключиться на несколько отправок",
@@ -1083,5 +1085,8 @@
"history": "История",
"user": "Пользователь"
}
+ },
+ "alert": {
+ "warning": "Предупреждение"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/tl/tl.json b/app/frontend/src/internationalization/trans/chefs/tl/tl.json
index 56bf8856d..317ebcd89 100644
--- a/app/frontend/src/internationalization/trans/chefs/tl/tl.json
+++ b/app/frontend/src/internationalization/trans/chefs/tl/tl.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "Nabigong tugon mula sa endpoint ng pagsusumite. Code ng tugon: {status}",
"errSubmittingForm": "Nagkaroon ng error sa pagsusumite ng form na ito",
"errorSavingFile": "Error sa pag-save ng mga file. Filename: {fileName}. Error: {error}",
+ "errorDeletingFile": "Error sa pagtanggal ng mga file. Filename: {fileName}. Error: {error}",
"submittingDraftErrMsg": "Nagkaroon ng error habang nagse-save ng draft",
"submittingDraftConsErrMsg": "Error sa pag-save ng draft. SubmissionId: {submissionId}. Error: {error}",
"formDraftAccessErrMsg": "Ang hiniling na pagsusumite ay naisumite na, nagre-redirect sa View page",
- "formUnauthorizedMessage": "Hindi ka awtorisadong tingnan ang form na ito, mangyaring makipag-ugnayan sa may-ari ng form para sa access."
+ "formUnauthorizedMessage": "Hindi ka awtorisadong tingnan ang form na ito, mangyaring makipag-ugnayan sa may-ari ng form para sa access.",
+ "fileUploadWarning": "Upang i-upload ang iyong mga kalakip, dapat mong i-click ang pindutang 'I-save bilang draft' o isumite ang iyong form. Kung mag-navigate ka palayo sa screen na ito, mawawala ang iyong mga attachment"
},
"bCGovFooter": {
"home": "Bahay",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "Tingnan ang Aking draft/mga isinumite",
- "saveAsADraft": "I-save bilang Draft",
+ "saveAsDraft": "I-save bilang Draft",
"editThisDraft": "I-edit ang Draft na ito",
"switchSingleSubmssn": "Lumipat sa iisang pagsusumite",
"switchMultiSubmssn": "Lumipat sa maramihang pagsusumite",
@@ -1081,5 +1083,8 @@
"history": "KASAYSAYAN",
"user": "Gumagamit"
}
+ },
+ "alert": {
+ "warning": "Babala"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/uk/uk.json b/app/frontend/src/internationalization/trans/chefs/uk/uk.json
index 35e574000..1e877b174 100644
--- a/app/frontend/src/internationalization/trans/chefs/uk/uk.json
+++ b/app/frontend/src/internationalization/trans/chefs/uk/uk.json
@@ -831,10 +831,12 @@
"failedResSubmissn": "Помилка відповіді від кінцевої точки надсилання. Код відповіді: {status}",
"errSubmittingForm": "Під час надсилання цієї форми сталася помилка",
"errorSavingFile": "Помилка збереження файлів. Ім'я файлу: {fileName}. Помилка: {error}",
+ "errorDeletingFile": "Error sa pagtanggal ng mga file. Filename: {fileName}. Error: {error}",
"submittingDraftErrMsg": "Під час збереження чернетки сталася помилка",
"submittingDraftConsErrMsg": "Помилка збереження чернетки. SubmissionId: {submissionId}. Помилка: {error}",
"formDraftAccessErrMsg": "Запитане подання вже подано, переспрямовує на сторінку перегляду",
- "formUnauthorizedMessage": "Ви не маєте права переглядати цю форму, будь ласка, зв'яжіться з власником форми для доступу."
+ "formUnauthorizedMessage": "Ви не маєте права переглядати цю форму, будь ласка, зв'яжіться з власником форми для доступу.",
+ "fileUploadWarning": "Щоб завантажити вкладені файли, ви повинні або натиснути кнопку «Зберегти як чернетку», або надіслати форму. Якщо ви перейдете з цього екрана, ви втратите вкладені файли"
},
"bCGovFooter": {
"home": "додому",
@@ -910,7 +912,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "Переглянути мої чернетки/подання",
- "saveAsADraft": "Зберегти як чернетку",
+ "saveAsDraft": "Зберегти як чернетку",
"editThisDraft": "Відредагуйте цю чернетку",
"switchSingleSubmssn": "Перейти до одноразової подачі",
"switchMultiSubmssn": "Переключитися на кілька повідомлень",
@@ -1082,5 +1084,8 @@
"history": "ІСТОРІЯ",
"user": "Користувач"
}
+ },
+ "alert": {
+ "warning": "УВАГА"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/vi/vi.json b/app/frontend/src/internationalization/trans/chefs/vi/vi.json
index c3522cfd6..2cc197180 100644
--- a/app/frontend/src/internationalization/trans/chefs/vi/vi.json
+++ b/app/frontend/src/internationalization/trans/chefs/vi/vi.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "Phản hồi không thành công từ điểm cuối gửi. Mã phản hồi: {status}",
"errSubmittingForm": "Đã xảy ra lỗi khi gửi biểu mẫu này",
"errorSavingFile": "Lỗi khi lưu tệp. Tên tệp: {fileName}. Lỗi: {error}",
+ "errorDeletingFile": "Lỗi khi xóa tệp. Tên tệp: {fileName}. Lỗi: {error}",
"submittingDraftErrMsg": "Đã xảy ra lỗi khi lưu bản nháp",
"submittingDraftConsErrMsg": "Lỗi khi lưu bản nháp. Đệ trìnhId: {submissionId}. Lỗi: {error}",
"formDraftAccessErrMsg": "Yêu cầu gửi đã được gửi, chuyển hướng đến Xem trang",
- "formUnauthorizedMessage": "Bạn không được phép xem mẫu này, vui lòng liên hệ với chủ sở hữu mẫu để được truy cập."
+ "formUnauthorizedMessage": "Bạn không được phép xem mẫu này, vui lòng liên hệ với chủ sở hữu mẫu để được truy cập.",
+ "fileUploadWarning": "Để tải lên tệp đính kèm của bạn, bạn phải nhấp vào nút 'Lưu dưới dạng bản nháp' hoặc gửi biểu mẫu của bạn. Nếu bạn thoát khỏi màn hình này, bạn sẽ mất tệp đính kèm của mình"
},
"bCGovFooter": {
"home": "Trang chủ",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "Xem bản nháp/bài nộp của tôi",
- "saveAsADraft": "Lưu dưới dạng Bản nháp",
+ "saveAsDraft": "Lưu dưới dạng Bản nháp",
"editThisDraft": "Chỉnh sửa Bản nháp này",
"switchSingleSubmssn": "Chuyển sang gửi một lần",
"switchMultiSubmssn": "Chuyển sang nhiều bài nộp",
@@ -1081,5 +1083,8 @@
"history": "LỊCH SỬ",
"user": "Người dùng"
}
+ },
+ "alert": {
+ "warning": "Cảnh báo"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/zh/zh.json b/app/frontend/src/internationalization/trans/chefs/zh/zh.json
index 22ea0ac6a..63aacd89a 100644
--- a/app/frontend/src/internationalization/trans/chefs/zh/zh.json
+++ b/app/frontend/src/internationalization/trans/chefs/zh/zh.json
@@ -832,10 +832,12 @@
"failedResSubmissn": "提交端点响应失败。响应代码:{status}",
"errSubmittingForm": "提交此表单时出错",
"errorSavingFile": "保存文件时出错。文件名:{fileName}。错误:{error}",
+ "errorDeletingFile": "删除文件时出错。文件名:{fileName}。错误:{error}",
"submittingDraftErrMsg": "保存草稿时出错",
"submittingDraftConsErrMsg": "保存草稿时出错。提交 ID:{submissionId}。错误:{error}",
"formDraftAccessErrMsg": "请求的提交已提交,正在重定向到查看页面",
- "formUnauthorizedMessage": "您无权查看此表单,请联系表单所有者以获取访问权限。"
+ "formUnauthorizedMessage": "您无权查看此表单,请联系表单所有者以获取访问权限。",
+ "fileUploadWarning": "要上传附件,您必须点击“另存为草稿”按钮或提交表单。如果您离开此屏幕,您将丢失附件"
},
"bCGovFooter": {
"home": "家",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "查看我的草稿/提交内容",
- "saveAsADraft": "另存为草稿",
+ "saveAsDraft": "另存为草稿",
"editThisDraft": "编辑本草稿",
"switchSingleSubmssn": "切换到单一提交",
"switchMultiSubmssn": "切换到多次提交",
@@ -1083,5 +1085,8 @@
"history": "历史",
"user": "用户"
}
+ },
+ "alert": {
+ "warning": "警告"
}
}
diff --git a/app/frontend/src/internationalization/trans/chefs/zhTW/zh-TW.json b/app/frontend/src/internationalization/trans/chefs/zhTW/zh-TW.json
index 6c7736429..35ad7af6f 100644
--- a/app/frontend/src/internationalization/trans/chefs/zhTW/zh-TW.json
+++ b/app/frontend/src/internationalization/trans/chefs/zhTW/zh-TW.json
@@ -831,11 +831,13 @@
"no": "不",
"failedResSubmissn": "提交端點響應失敗。響應代碼:{status}",
"errSubmittingForm": "提交此表單時出錯",
- "errorSavingFile": "保存文件時出錯。文件名:{fileName}。錯誤:{error}",
+ "errorSavingFile": "儲存文件時發生錯誤。檔名:{檔名}。錯誤:{錯誤}",
+ "errorDeletingFile": "刪除檔案時發生錯誤。檔名:{檔名}。錯誤:{錯誤}",
"submittingDraftErrMsg": "保存草稿時出錯",
"submittingDraftConsErrMsg": "保存草稿時出錯。提交 ID:{submissionId}。錯誤:{error}",
"formDraftAccessErrMsg": "請求的提交已提交,正在重定向到查看頁面",
- "formUnauthorizedMessage": "您無權查看此表單,請聯繫表單所有者以獲取訪問權限。"
+ "formUnauthorizedMessage": "您無權查看此表單,請聯繫表單所有者以獲取訪問權限。",
+ "fileUploadWarning": "若要上傳附件,您必須按一下「另存為草稿」按鈕或提交表單。如果您離開此螢幕,您將丟失附件"
},
"bCGovFooter": {
"home": "家",
@@ -911,7 +913,7 @@
},
"formViewerActions": {
"viewMyDraftOrSubmissions": "查看我的草稿/投稿內容",
- "saveAsADraft": "另存為草稿",
+ "saveAsDraft": "另存為草稿",
"editThisDraft": "編輯本草稿",
"switchSingleSubmssn": "切換到單一提交",
"switchMultiSubmssn": "切換到多次提交",
@@ -1083,5 +1085,8 @@
"history": "歷史",
"user": "用戶"
}
+ },
+ "alert": {
+ "warning": "警告"
}
}
diff --git a/app/frontend/src/plugins/vuetify.js b/app/frontend/src/plugins/vuetify.js
index 5a6dbf74d..64ec405c7 100755
--- a/app/frontend/src/plugins/vuetify.js
+++ b/app/frontend/src/plugins/vuetify.js
@@ -34,7 +34,7 @@ const chefsTheme = {
error: '#D8292F',
info: '#2196F3',
success: '#2E8540',
- warning: '#FFC107',
+ warning: '#DA7102',
},
};
diff --git a/app/frontend/src/store/notification.js b/app/frontend/src/store/notification.js
index 0ead34f27..5cd037ceb 100644
--- a/app/frontend/src/store/notification.js
+++ b/app/frontend/src/store/notification.js
@@ -44,6 +44,12 @@ export const useNotificationStore = defineStore('notification', {
if (!notification.type)
notification = { ...notification, ...NotificationTypes.ERROR };
+ if (notification.unique) {
+ const ntfcation = this.notifications.find(
+ (n) => n.text === notification.text
+ );
+ if (ntfcation) return;
+ }
this.notifications.push({
...notification,
id: this.notificationId++,
diff --git a/app/frontend/tests/unit/components/designer/FormViewer.spec.js b/app/frontend/tests/unit/components/designer/FormViewer.spec.js
index 6f9cabb9f..2111d6bf6 100644
--- a/app/frontend/tests/unit/components/designer/FormViewer.spec.js
+++ b/app/frontend/tests/unit/components/designer/FormViewer.spec.js
@@ -1854,6 +1854,7 @@ describe('FormViewer.vue', () => {
props: {
formId: formId,
submissionId: '123',
+ isDuplicate: false,
},
global: {
provide: {
@@ -1866,7 +1867,7 @@ describe('FormViewer.vue', () => {
await flushPromises();
- wrapper.vm.yes();
+ await wrapper.vm.yes();
expect(updateSubmissionSpy).toBeCalledTimes(1);
});
@@ -2137,13 +2138,12 @@ describe('FormViewer.vue', () => {
push,
}));
const updateSubmissionSpy = vi.spyOn(formService, 'updateSubmission');
- updateSubmissionSpy.mockImplementationOnce(() => {
- throw new Error();
- });
+ updateSubmissionSpy.mockImplementationOnce(() => {});
const wrapper = shallowMount(FormViewer, {
props: {
formId: formId,
submissionId: '123',
+ isDuplicate: false,
},
global: {
provide: {
@@ -2158,7 +2158,7 @@ describe('FormViewer.vue', () => {
addNotificationSpy.mockReset();
- wrapper.vm.saveDraftFromModal({});
+ await wrapper.vm.saveDraftFromModal({});
expect(updateSubmissionSpy).toBeCalledTimes(1);
expect(addNotificationSpy).toBeCalledTimes(0);
@@ -2251,7 +2251,7 @@ describe('FormViewer.vue', () => {
expect(preventDefault).toBeCalledTimes(1);
});
- it('deleteFile will call fileServices deleteFile', async () => {
+ it('deleteFile will add the file to queuedDeleteFiles', async () => {
const deleteFileSpy = vi.spyOn(fileService, 'deleteFile');
deleteFileSpy.mockImplementation(() => {});
const wrapper = shallowMount(FormViewer, {
@@ -2270,12 +2270,97 @@ describe('FormViewer.vue', () => {
await flushPromises();
- await wrapper.vm.deleteFile('asdf');
- expect(deleteFileSpy).toBeCalledWith(undefined);
- await wrapper.vm.deleteFile({ id: '123' });
- expect(deleteFileSpy).toBeCalledWith('123');
- await wrapper.vm.deleteFile({ data: { id: '123' } });
- expect(deleteFileSpy).toBeCalledWith('123');
+ const onSuccess = vi.fn();
+
+ await wrapper.vm.deleteFile({}, { onSuccess: onSuccess });
+ expect(wrapper.vm.queuedDeleteFiles).toEqual([
+ {
+ file: {},
+ onSuccess: onSuccess,
+ },
+ ]);
+ });
+
+ it('deleteQueuedFiles will call deleteFile and then the files onSuccess function', async () => {
+ const deleteFileSpy = vi.spyOn(fileService, 'deleteFile');
+ deleteFileSpy.mockImplementation(() => {});
+ const wrapper = shallowMount(FormViewer, {
+ props: {
+ formId: formId,
+ submissionId: '123',
+ },
+ global: {
+ provide: {
+ setWideLayout: vi.fn(),
+ },
+ plugins: [pinia],
+ stubs: STUBS,
+ },
+ });
+
+ await flushPromises();
+
+ const onSuccess = vi.fn();
+
+ wrapper.vm.queuedDeleteFiles = [
+ {
+ file: {
+ id: '123',
+ },
+ onSuccess: onSuccess,
+ },
+ ];
+
+ await wrapper.vm.deleteQueuedFiles();
+ expect(deleteFileSpy).toBeCalledTimes(1);
+ expect(onSuccess).toBeCalledTimes(1);
+ expect(wrapper.vm.queuedDeleteFiles).toEqual([]);
+ });
+
+ it('deleteQueuedFiles will addNotification if an error occurs', async () => {
+ const deleteFileSpy = vi.spyOn(fileService, 'deleteFile');
+ deleteFileSpy.mockImplementation(() => {
+ throw new Error();
+ });
+ const wrapper = shallowMount(FormViewer, {
+ props: {
+ formId: formId,
+ submissionId: '123',
+ },
+ global: {
+ provide: {
+ setWideLayout: vi.fn(),
+ },
+ plugins: [pinia],
+ stubs: STUBS,
+ },
+ });
+
+ await flushPromises();
+
+ const onSuccess = vi.fn();
+
+ wrapper.vm.queuedDeleteFiles = [
+ {
+ file: {
+ id: '123',
+ },
+ onSuccess: onSuccess,
+ },
+ ];
+
+ await wrapper.vm.deleteQueuedFiles();
+ expect(deleteFileSpy).toBeCalledTimes(1);
+ expect(onSuccess).toBeCalledTimes(0);
+ expect(wrapper.vm.queuedDeleteFiles).toEqual([
+ {
+ file: {
+ id: '123',
+ },
+ onSuccess: onSuccess,
+ },
+ ]);
+ expect(addNotificationSpy).toBeCalledTimes(1);
});
it('getFile will call form stores downloadFile for json', async () => {
@@ -2346,7 +2431,52 @@ describe('FormViewer.vue', () => {
expect(getDispositionSpy).toBeCalledTimes(1);
});
- it('uploadFile will call fileServices uploadFile', async () => {
+ it('uploadFile will add the file and config to queuedUploadFiles', async () => {
+ const uploadFileSpy = vi.spyOn(fileService, 'uploadFile');
+ uploadFileSpy.mockImplementation(() => {});
+ const wrapper = shallowMount(FormViewer, {
+ props: {
+ formId: formId,
+ submissionId: '123',
+ },
+ global: {
+ provide: {
+ setWideLayout: vi.fn(),
+ },
+ plugins: [pinia],
+ stubs: STUBS,
+ },
+ });
+
+ await flushPromises();
+
+ const onError = vi.fn();
+ const onUploaded = vi.fn();
+ const onUploadProgress = vi.fn();
+
+ await wrapper.vm.uploadFile(
+ {},
+ {
+ onError: onError,
+ onUploadProgress: onUploadProgress,
+ onUploaded: onUploaded,
+ headers: {},
+ }
+ );
+ expect(wrapper.vm.queuedUploadFiles).toEqual([
+ {
+ file: {},
+ config: {
+ onUploadProgress: onUploadProgress,
+ headers: {},
+ },
+ onUploaded: onUploaded,
+ onError: onError,
+ },
+ ]);
+ });
+
+ it('uploadQueuedFiles will call fileServices uploadFile', async () => {
const uploadFileSpy = vi.spyOn(fileService, 'uploadFile');
uploadFileSpy.mockImplementation(() => {});
const wrapper = shallowMount(FormViewer, {
@@ -2365,7 +2495,83 @@ describe('FormViewer.vue', () => {
await flushPromises();
- await wrapper.vm.uploadFile('this is a file object');
+ const onError = vi.fn();
+ const onUploaded = vi.fn();
+ const onUploadProgress = vi.fn();
+
+ wrapper.vm.queuedUploadFiles = [
+ {
+ file: {},
+ config: {
+ onUploadProgress: onUploadProgress,
+ headers: {},
+ },
+ onError: onError,
+ onUploaded: onUploaded,
+ },
+ ];
+
+ await wrapper.vm.uploadQueuedFiles();
+ expect(uploadFileSpy).toBeCalledTimes(1);
+ expect(onUploaded).toBeCalledTimes(1);
+ expect(wrapper.vm.queuedUploadFiles).toEqual([]);
+ });
+
+ it('uploadQueuedFiles will addNotification if an error is thrown', async () => {
+ const uploadFileSpy = vi.spyOn(fileService, 'uploadFile');
+ uploadFileSpy.mockImplementation(() => {
+ throw new Error();
+ });
+ const wrapper = shallowMount(FormViewer, {
+ props: {
+ formId: formId,
+ submissionId: '123',
+ },
+ global: {
+ provide: {
+ setWideLayout: vi.fn(),
+ },
+ plugins: [pinia],
+ stubs: STUBS,
+ },
+ });
+
+ await flushPromises();
+
+ const onError = vi.fn();
+ const onUploaded = vi.fn();
+ const onUploadProgress = vi.fn();
+
+ wrapper.vm.queuedUploadFiles = [
+ {
+ file: {
+ originalName: 'test.txt',
+ },
+ config: {
+ onUploadProgress: onUploadProgress,
+ headers: {},
+ },
+ onError: onError,
+ onUploaded: onUploaded,
+ },
+ ];
+
+ await wrapper.vm.uploadQueuedFiles();
expect(uploadFileSpy).toBeCalledTimes(1);
+ expect(onUploaded).toBeCalledTimes(0);
+ expect(wrapper.vm.queuedUploadFiles).toEqual([
+ {
+ file: {
+ originalName: 'test.txt',
+ },
+ config: {
+ onUploadProgress: onUploadProgress,
+ headers: {},
+ },
+ onError: onError,
+ onUploaded: onUploaded,
+ },
+ ]);
+ expect(addNotificationSpy).toBeCalledTimes(1);
});
});
diff --git a/app/frontend/tests/unit/components/designer/FormViewerActions.spec.js b/app/frontend/tests/unit/components/designer/FormViewerActions.spec.js
index 8fc41321d..c25e5e8b2 100644
--- a/app/frontend/tests/unit/components/designer/FormViewerActions.spec.js
+++ b/app/frontend/tests/unit/components/designer/FormViewerActions.spec.js
@@ -150,7 +150,7 @@ describe('FormDisclaimer.vue', () => {
},
});
- expect(wrapper.text()).toContain('trans.formViewerActions.saveAsADraft');
+ expect(wrapper.text()).toContain('trans.formViewerActions.saveAsDraft');
});
it('renders if showEditToggle, isDraft, and draftEnabled is true', () => {
diff --git a/components/src/components/SimpleFile/Component.ts b/components/src/components/SimpleFile/Component.ts
index 07100ae4a..2a59f4981 100644
--- a/components/src/components/SimpleFile/Component.ts
+++ b/components/src/components/SimpleFile/Component.ts
@@ -76,7 +76,24 @@ export default class Component extends (ParentComponent as any) {
deleteFile(fileInfo) {
const { options = {} } = this.component;
if (fileInfo) {
- options.deleteFile(fileInfo);
+ return new Promise((resolve, reject) => {
+ options.deleteFile(fileInfo, {
+ onSuccess: () => {
+ this.redraw();
+ this.triggerChange();
+ resolve(fileInfo);
+ },
+ onError: (error) => {
+ this.redraw();
+ this.triggerChange();
+ reject(error);
+ this.statuses.push({
+ status: 'error',
+ message: error.detail,
+ });
+ },
+ });
+ });
}
}
@@ -94,7 +111,7 @@ export default class Component extends (ParentComponent as any) {
name: fileName,
size: file.size,
status: 'info',
- message: this.t('Starting upload'),
+ message: '',
};
// Check file pattern
@@ -176,6 +193,7 @@ export default class Component extends (ParentComponent as any) {
options.uploadFile(formData, {
onUploadProgress: (evt) => {
fileUpload.status = 'progress';
+ fileUpload.message = this.t('Starting upload');
// @ts-ignore
fileUpload.progress = parseInt(100.0 * evt.loaded / evt.total);
delete fileUpload.message;
@@ -184,8 +202,7 @@ export default class Component extends (ParentComponent as any) {
headers: {
'Content-Type': 'multipart/form-data',
},
- })
- .then((response) => {
+ onUploaded: (response) => {
response.data = response.data || {};
const index = this.statuses.indexOf(fileUpload);
if (index !== -1) {
@@ -207,15 +224,16 @@ export default class Component extends (ParentComponent as any) {
this.dataValue.push(fileInfo);
this.redraw();
this.triggerChange();
- })
- .catch((response) => {
+ },
+ onError: (response) => {
fileUpload.status = 'error';
// grab the detail out our api-problem response.
fileUpload.message = response.detail;
// @ts-ignore
delete fileUpload.progress;
this.redraw();
- })
+ },
+ })
}
});
}