From 9c7cbbe30b4ec491ebf532455a063f2c599a1193 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Fri, 20 Sep 2024 10:45:23 +0200 Subject: [PATCH] Add PECBridge admin mail field to translation.json and Settings.vue --- .../configure-module/validate-input.json | 18 ++++++++++++---- .../get-configuration/validate-output.json | 18 ++++++++++++---- ui/public/i18n/en/translation.json | 6 +++++- ui/src/views/Settings.vue | 21 +++++++++++++++++++ 4 files changed, 54 insertions(+), 9 deletions(-) diff --git a/imageroot/actions/configure-module/validate-input.json b/imageroot/actions/configure-module/validate-input.json index 2cd7c29f..0797fdb3 100644 --- a/imageroot/actions/configure-module/validate-input.json +++ b/imageroot/actions/configure-module/validate-input.json @@ -146,10 +146,20 @@ } }, "pecbridge_admin_mail": { - "type": "string", - "title": "PEC bridge admin mail", - "description": "Email address of the PEC bridge administrator", - "format": "idn-email" + "anyOf": [ + { + "type": "string", + "title": "PEC bridge admin mail", + "description": "Email address of the PEC bridge administrator", + "format": "idn-email" + }, + { + "type": "string", + "title": "PEC bridge admin mail", + "description": "Email address of the PEC bridge administrator", + "pattern": "^$" + } + ] } } } diff --git a/imageroot/actions/get-configuration/validate-output.json b/imageroot/actions/get-configuration/validate-output.json index 3d3c7c9c..0f7bcf89 100644 --- a/imageroot/actions/get-configuration/validate-output.json +++ b/imageroot/actions/get-configuration/validate-output.json @@ -144,10 +144,20 @@ } }, "pecbridge_admin_mail": { - "type": "string", - "title": "PEC Bridge admin email", - "description": "Email address used by PEC Bridge for administrative purposes", - "format": "idn-email" + "anyOf": [ + { + "type": "string", + "title": "PEC bridge admin mail", + "description": "Email address of the PEC bridge administrator", + "format": "idn-email" + }, + { + "type": "string", + "title": "PEC bridge admin mail", + "description": "Email address of the PEC bridge administrator", + "pattern": "^$" + } + ] } } } diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index 821a8a33..314bae08 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -68,7 +68,11 @@ "no_available_mail_domain_check_users": "Make sure the mail domain you intend to use has \"Add user addresses from user domain\" checkbox enabled", "mail_module_misconfigured": "No mail domain available", "hostname_pattern": "Must be a valid fully qualified domain name", - "hostname_format": "Must be a valid fully qualified domain name" + "hostname_format": "Must be a valid fully qualified domain name", + "pecbridge_admin_mail": "PECBridge admin mail", + "pecbridge_admin_mail_placeholder": "Enter the PECBridge admin mail", + "pecbridge_admin_mail_tooltip": "The PECBridge admin mail is used to send notifications to the PECBridge administrator", + "pecbridge_admin_mail_format": "Must be a valid email address" }, "about": { "title": "About" diff --git a/ui/src/views/Settings.vue b/ui/src/views/Settings.vue index bc5b50f0..1208e26d 100644 --- a/ui/src/views/Settings.vue +++ b/ui/src/views/Settings.vue @@ -344,6 +344,23 @@ $t("settings.LOG_WARNING") }} + + + @@ -427,6 +444,7 @@ export default { zpush: { loglevel: "ERROR", }, + pecbridge_admin_mail: "", loading: { getConfiguration: false, configureModule: false, @@ -455,6 +473,7 @@ export default { zpush: { loglevel: "", }, + pecbridge_admin_mail: "", }, }; }, @@ -593,6 +612,7 @@ export default { this.webdav = config.webdav; this.zpush = config.zpush; this.locale = config.locale; + this.pecbridge_admin_mail = config.pecbridge_admin_mail; // force to reload value after dom update this.$nextTick(() => { const mail_module_tmp = config.mail_module; @@ -730,6 +750,7 @@ export default { zpush: { loglevel: this.zpush.loglevel, }, + pecbridge_admin_mail: this.pecbridge_admin_mail, }, extra: { title: this.$t("settings.instance_configuration", {