MT#63228 Add new button for the DND activation/de-activation

A new button to activate the new 'dnd' subscriber preference
has been added to the CSC under the 'Call Settings>General' page.

Change-Id: I00a4c845b098c46fcdfdfbb246f97cebf7a82ae1
master
nidrissi-zouggari 3 months ago committed by Nouhaila Idrissi-Zouggari
parent 837de61280
commit 716d45f6ca

@ -41,17 +41,9 @@ export async function setPreference (id, field, value) {
await removePreference(id, field)
} else {
try {
await replacePreference(id, field, value)
await addPreference(id, field, value)
} catch (err) {
const errCode = `${err.status}`
if (errCode === '422') {
// eslint-disable-next-line no-useless-catch
try {
await addPreference(id, field, value)
} catch (innerErr) {
throw innerErr
}
} else {
if (err) {
throw err
}
}

@ -142,6 +142,7 @@
"Custom time set": "Benutzerdefinierte Zeiteinstellung",
"Customer Phonebook": "Telefonbuch des Kunden",
"Customer Preferences": "Kundenpräferenzen",
"DND": "Bitte nicht stören",
"Daily": "Täglich",
"Dashboard": "Übersicht",
"Data is in the clipboard": "Daten wurden in die Zwischenablage kopiert",
@ -252,6 +253,7 @@
"Hunt Policy": "Rufverteilungsregel",
"Hunt Timeout": "Rufdauer",
"Id": "ID",
"If activated the subscriber will not receive any call. The call forwards will not be taken into account.": "Wenn diese Funktion aktiviert ist, erhält der Teilnehmer keine Anrufe. Die Weiterleitung von Anrufen wird nicht berücksichtigt.",
"If busy": "Wenn besetzt",
"If not available": "Wenn besetzt",
"Ignore Members Call Forwards when Hunting": "Anrufweiterleitungen von Gruppenmitgliedern beim Suchen ignorieren",

@ -139,6 +139,7 @@
"Custom time set": "Custom time set",
"Customer Phonebook": "Customer Phonebook",
"Customer Preferences": "Customer Preferences",
"DND": "DND",
"Daily": "Daily",
"Dashboard": "Dashboard",
"Data is in the clipboard": "Data is in the clipboard",
@ -248,6 +249,7 @@
"Hunt Policy": "Hunt Policy",
"Hunt Timeout": "Hunt Timeout",
"Id": "Id",
"If activated the subscriber will not receive any call. The call forwards will not be taken into account.": "If activated the subscriber will not receive any call. The call forwards will not be taken into account.",
"If busy": "If busy",
"If not available": "If not available",
"Ignore Members Call Forwards when Hunting": "Ignore Members Call Forwards when Hunting",

@ -142,6 +142,7 @@
"Custom time set": "Intervalo de tiempo personalizado",
"Customer Phonebook": "Customer Phonebook",
"Customer Preferences": "Customer Preferences",
"DND": "No molestar",
"Daily": "Diariamente",
"Dashboard": "Tablero",
"Data is in the clipboard": "Data is in the clipboard",
@ -252,6 +253,7 @@
"Hunt Policy": "Política de búsqueda",
"Hunt Timeout": "Tiempo de espera de grupo de búsqueda",
"Id": "Identificador",
"If activated the subscriber will not receive any call. The call forwards will not be taken into account.": "Si se activa, el abonado no recibirá ninguna llamada. No se tendrá en cuenta el desvío de llamadas.",
"If busy": "Si está ocupado",
"If not available": "Si no está disponible",
"Ignore Members Call Forwards when Hunting": "Ignorar los Reenvíos de Llamada de los Miembros al Buscar",

@ -142,6 +142,7 @@
"Custom time set": "Intervalle de temps personnalisé",
"Customer Phonebook": "Annuaire du client",
"Customer Preferences": "Préférences du client",
"DND": "Ne pas déranger",
"Daily": "Quotidien",
"Dashboard": "Tableau de bord",
"Data is in the clipboard": "Données dans le presse-papiers",
@ -252,6 +253,7 @@
"Hunt Policy": "Règlages des groupements d'appels",
"Hunt Timeout": "Temporisation des groupements dappels",
"Id": "Id",
"If activated the subscriber will not receive any call. The call forwards will not be taken into account.": "Si cette option est activée, l'abonné ne recevra aucun appel. Les renvois d'appels ne seront pas pris en compte.",
"If busy": "Si occupé",
"If not available": "Si non disponible",
"Ignore Members Call Forwards when Hunting": "Ignorer les renvois d'appel des membres lors de la chasse",

@ -140,6 +140,7 @@
"Custom time set": "Intervallo di tempo personalizzato",
"Customer Phonebook": "Rubrica cliente",
"Customer Preferences": "Preferenze cliente",
"DND": "Non disturbare",
"Daily": "Giornaliero",
"Dashboard": "Dashboard",
"Data is in the clipboard": "I dati sono negli appunti",
@ -249,6 +250,7 @@
"Hunt Timeout": "Timeout ricerca",
"Hunt timeout": "Timeout ricerca",
"Id": "Id",
"If activated the subscriber will not receive any call. The call forwards will not be taken into account.": "Se attivato, l'abbonato non riceverà alcuna chiamata. Le chiamate inoltrate non saranno prese in considerazione.",
"If busy": "Se occupato",
"If not available": "Se non disponibile",
"Ignore Members Call Forwards when Hunting": "Ignora gli Inoltri di Chiamata dei Membri durante la Ricerca",

@ -11,7 +11,7 @@
>
<q-item-section>
<q-toggle
:model-value="musicOnHold"
:model-value="musicOnHoldValue"
:disable="dataLoading"
:label="$t('Music on Hold')"
:title="$t('&quot;Music on Hold&quot; - if set to true and a music on hold file is provided, a calling party gets that file played when put on hold')"
@ -20,6 +20,14 @@
unchecked-icon="audiotrack"
@update:model-value="toggleMusicOnHold"
/>
<q-toggle
:model-value="dndValue"
:disable="dataLoading"
:label="$t('DND')"
:title="$t('If activated the subscriber will not receive any call. The call forwards will not be taken into account.')"
data-cy="do-not-disturb"
@update:model-value="toggleDnd"
/>
</q-item-section>
<q-item-section
side
@ -57,7 +65,8 @@ export default {
'subscriberPreferencesInitialized'
]),
...mapGetters('callSettings', [
'musicOnHold'
'musicOnHold',
'dnd'
]),
...mapGetters('user', [
'hasSubscriberProfileAttribute'
@ -67,6 +76,12 @@ export default {
}),
dataLoading () {
return !this.subscriberPreferencesInitialized || this.processingSubscriberPreferences
},
musicOnHoldValue () {
return this.musicOnHold || false
},
dndValue () {
return this.dnd || false
}
},
async mounted () {
@ -82,7 +97,8 @@ export default {
...mapWaitingActions('callSettings', {
loadPreferencesDefsAction: 'processing subscriberPreferences',
loadSubscriberPreferencesAction: 'processing subscriberPreferences',
setMusicOnHold: 'processing subscriberPreferences'
setMusicOnHold: 'processing subscriberPreferences',
setDnd: 'dnd'
}),
async toggleMusicOnHold () {
try {
@ -90,6 +106,13 @@ export default {
} catch (err) {
showGlobalError(err?.message || this.$t('Unknown error'))
}
},
async toggleDnd () {
try {
await this.setDnd(!this.dnd)
} catch (err) {
showGlobalError(err?.message || this.$t('Unknown error'))
}
}
}
}

@ -19,6 +19,9 @@ export default {
musicOnHold (state) {
return state.subscriberPreferences?.music_on_hold
},
dnd (state) {
return state.subscriberPreferences?.dnd
},
language (state) {
return state.subscriberPreferences.language
},
@ -66,6 +69,9 @@ export default {
async setMusicOnHold (context, value) {
await context.dispatch('fieldUpdateAction', { field: 'music_on_hold', value })
},
async setDnd (context, value) {
await context.dispatch('fieldUpdateAction', { field: 'dnd', value })
},
async setLanguage (context, options) {
const subscriberId = options.subscriberId || context.getters.subscriberId
if (options.language) {

Loading…
Cancel
Save