From ce584c6e466c3d9ad6484075f9d84cd1a3fef0eb Mon Sep 17 00:00:00 2001 From: Peter Le Date: Thu, 30 Jan 2025 13:19:17 -0500 Subject: [PATCH] RDISCROWD-7917 - support improved flash message for error --- static/src/components/setting/index.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/static/src/components/setting/index.vue b/static/src/components/setting/index.vue index 336947b1..9f9077b8 100644 --- a/static/src/components/setting/index.vue +++ b/static/src/components/setting/index.vue @@ -321,6 +321,7 @@ export default { async save () { let data = {}; + let errormsg = ''; if (this.dataAccessConfigured && this.validAccessLevels.length > 0) { data = { config: this.externalConfigDict, @@ -352,6 +353,7 @@ export default { const projectData = await projectRes.json(); if (projectData['status'] !== 'success') { validConfig = false; + errormsg = projectData['error_msg']; window.pybossaNotify(projectData['flash'], true, projectData['status']); } } @@ -378,7 +380,11 @@ export default { if (validConfig) { window.pybossaNotify('Configuration updated successfully', true, 'success'); } else { - window.pybossaNotify('An error occurred configuring project config.', true, 'error'); + if (errormsg) { + window.pybossaNotify(errormsg, true, 'error'); + } else { + window.pybossaNotify('An error occurred configuring project config.', true, 'error'); + } } } catch (error) { window.pybossaNotify('An error occurred configuring project config.', true, 'error');