Skip to content

Commit

Permalink
Add PECBridge admin mail field to translation.json and Settings.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Sep 20, 2024
1 parent a9b152c commit 9c7cbbe
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 9 deletions.
18 changes: 14 additions & 4 deletions imageroot/actions/configure-module/validate-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "^$"
}
]
}
}
}
18 changes: 14 additions & 4 deletions imageroot/actions/get-configuration/validate-output.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "^$"
}
]
}
}
}
6 changes: 5 additions & 1 deletion ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 21 additions & 0 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,23 @@
$t("settings.LOG_WARNING")
}}</cv-dropdown-item>
</cv-dropdown>
<NsTextInput
:label="$t('settings.pecbridge_admin_mail')"
:placeholder="$t('settings.pecbridge_admin_mail_placeholder')"
v-model.trim="pecbridge_admin_mail"
class="mg-bottom"
:invalid-message="$t(error.pecbridge_admin_mail)"
:disabled="
loading.getConfiguration ||
loading.configureModule ||
loading.getDefaults
"
ref="pecbridge_admin_mail"
>
<template #tooltip>{{
$t("settings.pecbridge_admin_mail_tooltip")
}}</template>
</NsTextInput>
</template>
</cv-accordion-item>
</cv-accordion>
Expand Down Expand Up @@ -427,6 +444,7 @@ export default {
zpush: {
loglevel: "ERROR",
},
pecbridge_admin_mail: "",
loading: {
getConfiguration: false,
configureModule: false,
Expand Down Expand Up @@ -455,6 +473,7 @@ export default {
zpush: {
loglevel: "",
},
pecbridge_admin_mail: "",
},
};
},
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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", {
Expand Down

0 comments on commit 9c7cbbe

Please sign in to comment.