diff --git a/src/api/fax.js b/src/api/fax.js index 10215509..946569b2 100644 --- a/src/api/fax.js +++ b/src/api/fax.js @@ -32,3 +32,30 @@ export async function setFaxServerField (options) { value: options.value }) } + +export async function getMailToFaxSettings (subscriberId) { + const result = await get({ + path: `api/mailtofaxsettings/${subscriberId}` + }) + const settings = _.clone(result) + delete settings._links + return settings +} + +export async function setMailToFaxSettingField (options) { + if (!['active', 'secret_key', 'secret_key_renew', 'secret_renew_notify', 'acl'].includes(options.field)) { + throw Error(`setMailToFaxSettingField: unknown field name ${options.field}`) + } + if (options.field === 'secret_renew_notify') { + // searching for duplicates + const destinationsIds = options.value.map(d => d.destination) + if ((new Set(destinationsIds)).size !== destinationsIds.length) { + throw Error(i18n.t('faxSettings.notifyEmailExists')) + } + } + return patchReplaceFull({ + path: `api/mailtofaxsettings/${options.subscriberId}`, + fieldPath: options.field, + value: options.value + }) +} diff --git a/src/boot/i18n.js b/src/boot/i18n.js index e8e7a3fa..61b5dccf 100644 --- a/src/boot/i18n.js +++ b/src/boot/i18n.js @@ -17,6 +17,7 @@ export const defaultLocale = 'en-US' export const i18n = new VueI18n({ locale: defaultLocale, fallbackLocale: defaultLocale, + formatFallbackMessages: true, messages }) diff --git a/src/components/CscMainMenuTop.vue b/src/components/CscMainMenuTop.vue index 2b8077d3..cebe6413 100644 --- a/src/components/CscMainMenuTop.vue +++ b/src/components/CscMainMenuTop.vue @@ -46,7 +46,8 @@ export default { computed: { ...mapGetters('user', [ 'isRtcEngineUiVisible', - 'isPbxEnabled' + 'isPbxEnabled', + 'hasFaxCapability' ]), items () { return [ @@ -129,7 +130,7 @@ export default { to: '/user/fax-settings', icon: 'fas fa-fax', label: this.$t('navigation.faxSettings.title'), - visible: true + visible: this.hasFaxCapability }, { icon: 'miscellaneous_services', diff --git a/src/components/CscTooltip.vue b/src/components/CscTooltip.vue new file mode 100644 index 00000000..a6a2e80f --- /dev/null +++ b/src/components/CscTooltip.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/form/CscInputSaveable.vue b/src/components/form/CscInputSaveable.vue index 4c78f4e8..c407819f 100644 --- a/src/components/form/CscInputSaveable.vue +++ b/src/components/form/CscInputSaveable.vue @@ -7,6 +7,7 @@ @input="$emit('input', $event)" @keyup.enter="$emit('save', $event)" > + + + diff --git a/src/components/pages/FaxSettings/CscMailToFaxACL.vue b/src/components/pages/FaxSettings/CscMailToFaxACL.vue new file mode 100644 index 00000000..f56097a0 --- /dev/null +++ b/src/components/pages/FaxSettings/CscMailToFaxACL.vue @@ -0,0 +1,109 @@ + + + diff --git a/src/components/pages/FaxSettings/CscMailToFaxACLForm.vue b/src/components/pages/FaxSettings/CscMailToFaxACLForm.vue new file mode 100644 index 00000000..ab84293b --- /dev/null +++ b/src/components/pages/FaxSettings/CscMailToFaxACLForm.vue @@ -0,0 +1,177 @@ + + + diff --git a/src/components/pages/FaxSettings/CscMailToFaxRenewNotifyEmail.vue b/src/components/pages/FaxSettings/CscMailToFaxRenewNotifyEmail.vue new file mode 100644 index 00000000..19a8936c --- /dev/null +++ b/src/components/pages/FaxSettings/CscMailToFaxRenewNotifyEmail.vue @@ -0,0 +1,152 @@ + + + diff --git a/src/components/pages/FaxSettings/CscMailToFaxRenewNotifyEmailForm.vue b/src/components/pages/FaxSettings/CscMailToFaxRenewNotifyEmailForm.vue new file mode 100644 index 00000000..ad0be762 --- /dev/null +++ b/src/components/pages/FaxSettings/CscMailToFaxRenewNotifyEmailForm.vue @@ -0,0 +1,129 @@ + + + diff --git a/src/components/pages/FaxSettings/CscMailToFaxSettings.vue b/src/components/pages/FaxSettings/CscMailToFaxSettings.vue new file mode 100644 index 00000000..a98cdc65 --- /dev/null +++ b/src/components/pages/FaxSettings/CscMailToFaxSettings.vue @@ -0,0 +1,373 @@ + + + + + diff --git a/src/css/app.styl b/src/css/app.styl index c5823806..f216e03d 100644 --- a/src/css/app.styl +++ b/src/css/app.styl @@ -27,3 +27,9 @@ body.body--dark .csc-opt-center margin-top ($header-height * -2) + +.striped-list + > :nth-of-type(2n+1) + background-color $item-stripe-color + > :nth-of-type(2n) + background-color alpha($main-menu-background, 0.2) diff --git a/src/i18n/en.json b/src/i18n/en.json index 6643c61c..a8e424f2 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -764,7 +764,20 @@ "deleteDestinationTitle": "Remove Destination", "deleteDestinationText": "You are about to remove destination {destination}", "destinationEmailExists": "The Destination Email is already used", - "destinationItemTitle": "<{destination}> as {filetype}" + "destinationItemTitle": "<{destination}> as {filetype}", + "notifyEmailExists": "The Notify Email is already used", + "featureIsNotActive": "Mail To Fax feature is not active", + "destinations": "Destinations", + "secretKeyField": "Secret Key (empty=disabled)", + "lastModifyTime": "Last Modify Time", + "notModifiedYet": "Not modified yet", + "secretKeyRenew": "Secret Key Renew", + "secretKeyRenewNotify": "Secret Key Renew Notify", + "addEmail": "Add email", + "deleteRenewNotifyEmailTitle": "Remove secret key renew notify email", + "deleteRenewNotifyEmailText": "You are about to remove secret key renew notify email: {email}", + "ACL": "ACL", + "addACL": "Add ACL" }, "callSettings": { "musicOnHold": "Music on Hold", diff --git a/src/layouts/CscLayoutMain.vue b/src/layouts/CscLayoutMain.vue index c419b2e1..6eeca715 100644 --- a/src/layouts/CscLayoutMain.vue +++ b/src/layouts/CscLayoutMain.vue @@ -21,7 +21,7 @@ @click="$refs.mainMenu.show()" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Destinations: -
-
- -
-
- - {{ $t('faxSettings.addDestination') }} - -
-
-
- -
- - - - - - {{ $t('faxSettings.noDestinationsCreatedYet') }} - - - -
-
+ + + + + + +