diff --git a/src/api/call-forwarding.js b/src/api/call-forwarding.js
index 75aa0306..3b41fa10 100644
--- a/src/api/call-forwarding.js
+++ b/src/api/call-forwarding.js
@@ -28,14 +28,16 @@ export async function cfLoadDestinationSets (subscriberId) {
export async function cfLoadSourceSets (subscriberId) {
return getList({
resource: 'cfsourcesets',
- params: (subscriberId) ? { subscriber_id: subscriberId } : {}
+ params: (subscriberId) ? { subscriber_id: subscriberId } : {},
+ all: true
})
}
export async function cfLoadTimeSets (subscriberId) {
return getList({
resource: 'cftimesets',
- params: (subscriberId) ? { subscriber_id: subscriberId } : {}
+ params: (subscriberId) ? { subscriber_id: subscriberId } : {},
+ all: true
})
}
diff --git a/src/components/call-forwarding/CscCfConditionPopupCustom.vue b/src/components/call-forwarding/CscCfConditionPopupCustom.vue
new file mode 100644
index 00000000..71e4d956
--- /dev/null
+++ b/src/components/call-forwarding/CscCfConditionPopupCustom.vue
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
diff --git a/src/components/call-forwarding/CscCfGroupConditionCustom.vue b/src/components/call-forwarding/CscCfGroupConditionCustom.vue
new file mode 100644
index 00000000..eb24731e
--- /dev/null
+++ b/src/components/call-forwarding/CscCfGroupConditionCustom.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+ {{ $t('Period') }}
+
+
+ {{ date.from }}
+
+
+ {{ date.to }}
+
+
+
+
+
+
+
+
diff --git a/src/components/call-forwarding/CscCfGroupConditionDate.vue b/src/components/call-forwarding/CscCfGroupConditionDate.vue
index 773c4033..27115108 100644
--- a/src/components/call-forwarding/CscCfGroupConditionDate.vue
+++ b/src/components/call-forwarding/CscCfGroupConditionDate.vue
@@ -23,7 +23,7 @@
flat
color="negative"
icon="delete"
- @click="deleteSourceSetEvent"
+ @click="deleteTimeSetEvent"
/>
{
this.$wait.start(this.waitIdentifier)
if (this.destinationSet.destinations.length > 1) {
- await this.removeDestination(payload)
+ await this.triggerRemoveDestination(payload)
this.setAnnouncement()
} else {
this.$emit('delete-last', payload)
@@ -271,6 +271,13 @@ export default {
this.$wait.end(this.waitIdentifier)
})
},
+ async triggerRemoveDestination (payload) {
+ try {
+ await this.removeDestination(payload)
+ } catch (e) {
+ showGlobalError(e.message)
+ }
+ },
async updateDestinationTimeoutEvent (payload) {
this.$wait.start(this.waitIdentifier)
await this.updateDestinationTimeout(payload)
diff --git a/src/components/call-forwarding/CscCfGroupTitle.vue b/src/components/call-forwarding/CscCfGroupTitle.vue
index 34ae2907..2afbf303 100644
--- a/src/components/call-forwarding/CscCfGroupTitle.vue
+++ b/src/components/call-forwarding/CscCfGroupTitle.vue
@@ -144,7 +144,6 @@
>
{{ $t('office hours are') }}
-
- {{ $filters.timeSetTimes(timeSet.times) }}
-
+
+
+ {{ $t('Custom time set') }}
+
+
+
{
+ const timeSetMap = createTimeSetMap(timeSet)
+
+ const from = formatTimeSetValues(timeSetMap, 'from')
+ const to = formatTimeSetValues(timeSetMap, 'to')
+
+ return {
+ from: formatTimeString(from),
+ to: formatTimeString(to)
+ }
+ })
+}
+
+function createTimeSetMap (timeSet) {
+ const timeSetMap = {
+ hour: { from: null, to: null },
+ mday: { from: null, to: null },
+ minute: { from: null, to: null },
+ month: { from: null, to: null },
+ wday: { from: null, to: null },
+ year: { from: null, to: null }
+ }
+
+ Object.keys(timeSet).forEach((key) => {
+ // 1. Case: not set
+ if (timeSet[key] === null) {
+ timeSetMap[key] = { from: null, to: null }
+ // 2. Case: range
+ } else if (timeSet[key].includes('-')) {
+ const [from, to] = timeSet[key].split('-')
+ timeSetMap[key] = { from, to }
+ // 3. Case: single value
+ } else {
+ timeSetMap[key] = { from: timeSet[key], to: null }
+ }
+ })
+
+ return timeSetMap
+}
+
+function formatTimeSetValues (timeSetMap, type) {
+ const defaultTime = '00'
+ const defaultDay = 'DD'
+ const defaultMonth = 'MM'
+ const defaultYear = 'YYYY'
+
+ return {
+ year: timeSetMap.year[type] || defaultYear,
+ month: getMonthNameByNumber(timeSetMap.month[type]) || defaultMonth,
+ wDay: getDayNameByNumber(timeSetMap.wday[type]) ? `${getDayNameByNumber(timeSetMap.wday[type])},` : '',
+ mDay: timeSetMap.mday[type] || defaultDay,
+ hour: formatTime(timeSetMap.hour[type]) || defaultTime,
+ minutes: formatTime(timeSetMap.minute[type]) || defaultTime
+ }
+}
+
+function formatTimeString (timeSetValues) {
+ return `${timeSetValues.mDay} ${timeSetValues.month} ${timeSetValues.year}, ${timeSetValues.wDay} ${timeSetValues.hour}:${timeSetValues.minutes}`
+}
+
+function formatTime (time) {
+ return (time !== null && time < 10) ? `0${time}` : time
}
diff --git a/src/helpers/kamailio-timesets-converter.js b/src/helpers/kamailio-timesets-converter.js
index 2cef2936..3734ba13 100644
--- a/src/helpers/kamailio-timesets-converter.js
+++ b/src/helpers/kamailio-timesets-converter.js
@@ -1,3 +1,5 @@
+// ---- 1. Implementation for Times ranges and day of the week ----
+// ------------------------------------------
/*
humanReadableTimeset = [{
weekday: 1..7,
@@ -71,7 +73,7 @@ export function validateHumanTimesets (hTimeset) {
/**
* Function resort timesets by "weekday" and "from" and combines closest timesets or duplicates
- * Important! Before use this function please validate you timeses for correctness.
+ * Important! Before use this function please validate you timesets for correctness.
* @param hTimeset {humanReadableTimeset}
* @returns {humanReadableTimeset}
*/
@@ -293,7 +295,11 @@ export function validateKamailioRange (kamailioRangeStr = '', minValue, maxValue
}
}
}
-
+/**
+ * Validates Kamailio Timesets with day of week to human readable format
+ * @param kTimeset {Array} - Kamailio timeset with day of the week, hour and minute
+ * throws {Error} - if the Kamailio timeset has invalid format
+ */
export function validateKamailioTimesets (kTimeset) {
kTimeset.forEach((timesetItem) => {
let { wday, hour, minute } = timesetItem
@@ -322,10 +328,15 @@ export function validateKamailioTimesets (kTimeset) {
})
}
+/**
+* Converts Kamailio timeset with day of week to human readable format
+* @param kTimeset {Array} - Kamailio timeset with day of the week, hour and minute
+* retuns {Array} - human readable timeset with weekday, from and to
+*/
export function kamailioTimesetToHuman (kTimeset = []) {
validateKamailioTimesets(kTimeset)
- // convert Kamailio timeset into Human readable format
+ // convert Kamailio timeset into human readable format
const hTimesetRaw = kTimeset.map((timesetItem) => {
let { wday, hour, minute } = timesetItem
hour = getAsTrimmedString(hour)
@@ -381,7 +392,7 @@ export function kamailioTimesetToHuman (kTimeset = []) {
return res
}
-// ---- implementation for date ranges ----
+// ---- 2. Implementation for date ranges ----
// ------------------------------------------
/*
@@ -683,7 +694,11 @@ export function humanDatesetToKamailio (hDateset = []) {
return kamailioDateset
}
-
+/**
+ * Validates Kamailio Datesets Ranges (Year, Month, Day)
+ * @param kDateset {Array} - Kamailio Dateset (Year, Month, Day)
+ * throws {Error} - if the Kamailio dateset has invalid format
+ */
export function validateKamailioDatesets (kDateset) {
kDateset.forEach((datesetItem) => {
let { year, month, mday } = datesetItem
@@ -711,11 +726,15 @@ export function validateKamailioDatesets (kDateset) {
})
})
}
-
+/**
+* Converts Kamailio Dateset to human readable Date Range format
+* @param kDateset {Date} - Kamaillio Dateset with Year, Month and Day
+* retun {Array} - human readable data range with from and to year, month and day.
+*/
export function kamailioDatesetToHuman (kDateset = []) {
validateKamailioDatesets(kDateset)
- // convert Kamailio dateset into Human readable format
+ // convert Kamailio dateset into human readable format
const hDatesetRaw = kDateset.map((datesetItem) => {
let { year, month, mday } = datesetItem
year = getAsTrimmedString(year)
diff --git a/src/i18n/de.json b/src/i18n/de.json
index 455edb76..8b014fb4 100644
--- a/src/i18n/de.json
+++ b/src/i18n/de.json
@@ -47,8 +47,10 @@
"An error occured while trying to unassign the speed dial slot. Please try again": "Kurzwahl-Eintrag konnte nicht geändert werden. Bitte erneut versuchen",
"Application": "Anwendung",
"Apps": "Apps",
+ "April": "April",
"Assigned slot {slot}": "Zugewiesene Kurzwahl {slot}",
"Attach voicemail to email notification": "Voicemail als Anhang in E-Mail-Benachrichtigung",
+ "August": "August",
"Auto Attendant": "Anrufmenü",
"Block Incoming": "Eingehende Anrufe blockieren",
"Block Incoming/Outgoing": "Ein-/Ausgehende Anrufe blockieren",
@@ -134,6 +136,8 @@
"Custom Announcement": "Benutzerdefinierte Ansage",
"Custom Announcements": "Individuelle Ansagen",
"Custom sound": "Benutzerdefinierter Sound",
+ "Custom time set": "Custom time set",
+ "Custom time sets": "Custom time sets",
"Customer Details": "Kunden-Details",
"Customer Phonebook": "Telefonbuch des Kunden",
"Customer Preferences": "Kundenpräferenzen",
@@ -141,6 +145,7 @@
"Dashboard": "Übersicht",
"Data is in the clipboard": "Daten wurden in die Zwischenablage kopiert",
"Data loading error": "Fehler beim Laden von Daten",
+ "December": "Dezember",
"Default": "Standard",
"Default sound": "Standard-Sound",
"Default sound set for all seats and groups": "Standard-Sound-Set für alle Nebenstellen und Gruppen",
@@ -184,6 +189,7 @@
"End time": "Endzeit",
"English": "Deutsch",
"Enter a number to dial": "Geben Sie eine Telefonnummer zum Anwählen an",
+ "Entity belongs to admin": "Diese Einheit gehört dem Admin",
"Expires": "Läuft aus",
"Extension": "Durchwahl",
"Extension Settings": "Erweiterungseinstellungen",
@@ -193,6 +199,7 @@
"Fax to mail and sendfax": "„Fax to Mail“ und „Sendfax“",
"Fax2Mail": "Fax2Mail",
"Faxes": "Faxe",
+ "February": "Februar",
"File": "Datei",
"File Type": "Dateityp",
"Filter": "Filtern",
@@ -262,8 +269,11 @@
"Input must be a valid number": "Eingabe muss eine gültige Nummer sein",
"Interval when the secret key is automatically renewed.": "Zeitraum, nach dem der Geheimschlüssel automatisch erneuert wird.",
"Italian": "Italienisch",
+ "January": "Januar",
"Join conference": "Konferenz beitreten",
"Join conference with name": "Konferenz beitreten mit Name",
+ "July": "Juli",
+ "June": "Juni",
"Lamp/Key": "Lampe/Taste",
"Lamps/Keys": "Lampen/Tasten",
"Language": "Sprache",
@@ -283,8 +293,10 @@
"Manager Secretary": "Geschäftsführungssekretariat",
"Manager Secretary feature": "Manager Sekretär Funktion",
"ManagerSecretary": "Geschäftsführungssekretariat",
+ "March": "März",
"Maximum allowed extension is {max}": "Die maximal zulässige Länge der Durchwahl ist {max}",
"Maximum calls in queue": "Maximale Anzahl an Anrufen in der Warteschlange",
+ "May": "Mai",
"Me": "Ich",
"Messages": "Nachrichten",
"Minimum allowed extension is {min}": "Die minimal zulässige Länge der Durchwahlnummer ist {min}",
@@ -339,10 +351,12 @@
"No speed dials found": "Keine Kurzwahl gefunden",
"Normal": "Normal",
"Not modified yet": "Bisher nicht geändert",
+ "November": "November",
"Number": "Nummer",
"Number list": "Nummernliste",
"Number list name": "Name der Nummernliste",
"Numbers": "Nummern",
+ "October": "Oktober",
"Office Hours Announcement": "Bürozeiten Ansage",
"On weekdays": "An Werktagen",
"Only incoming calls from listed numbers are allowed": "Es sind nur eingehende Anrufe von aufgelisteten Nummern erlaubt",
@@ -373,6 +387,7 @@
"Password must be at least {max} characters long": "Password must be at least {max} characters long",
"Password must be at least {min} characters long": "Password must be at least {min} characters long",
"Passwords must be equal": "Passwörter müssen übereinstimmen",
+ "Period": "Period",
"Phone model": "Telefonmodell",
"Phone number": "Rufnummer",
"Pilot": "Hauptteilnehmer",
@@ -471,6 +486,7 @@
"Send": "Senden",
"Send Fax": "Sende Fax",
"Sending fax completed successfully.": "Fax wurde erfolgreich gesendet.",
+ "September": "September",
"Serial Ringing": "Serielles Klingeln",
"Session expired, please login again": "Sitzung abgelaufen, bitte erneut anmelden",
"Set your Extension settings": "Legen Sie Ihre Erweiterungseinstellungen fest",
diff --git a/src/i18n/en.json b/src/i18n/en.json
index a63caf11..93c9ec82 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -46,8 +46,10 @@
"An error occured while trying to send the fax. Please try again": "An error occured while trying to send the fax. Please try again",
"An error occured while trying to unassign the speed dial slot. Please try again": "An error occured while trying to unassign the speed dial slot. Please try again",
"Apps": "Apps",
+ "April": "April",
"Assigned slot {slot}": "Assigned slot {slot}",
"Attach voicemail to email notification": "Attach voicemail to email notification",
+ "August": "August",
"Auto Attendant": "Auto Attendant",
"Block Incoming": "Block Incoming",
"Block Incoming/Outgoing": "Block Incoming/Outgoing",
@@ -131,6 +133,8 @@
"Custom Announcement": "Custom Announcement",
"Custom Announcements": "Custom Announcements",
"Custom sound": "Custom sound",
+ "Custom time set": "Custom time set",
+ "Custom time sets": "Custom time sets",
"Customer Details": "Customer Details",
"Customer Phonebook": "Customer Phonebook",
"Customer Preferences": "Customer Preferences",
@@ -138,6 +142,7 @@
"Dashboard": "Dashboard",
"Data is in the clipboard": "Data is in the clipboard",
"Data loading error": "Data loading error",
+ "December": "December",
"Default": "Default",
"Default sound": "Default sound",
"Default sound set for all seats and groups": "Default sound set for all seats and groups",
@@ -181,6 +186,7 @@
"End time": "End time",
"English": "English",
"Enter a number to dial": "Enter a number to dial",
+ "Entity belongs to admin": "Entity belongs to admin",
"Expires": "Expires",
"Extension": "Extension",
"Extension Settings": "Extension Settings",
@@ -190,6 +196,7 @@
"Fax to mail and sendfax": "Fax to Mail and Sendfax",
"Fax2Mail": "Fax2Mail",
"Faxes": "Faxes",
+ "February": "February",
"File": "File",
"File Type": "File Type",
"Filter": "Filter",
@@ -258,6 +265,9 @@
"Input must be a valid number": "Input must be a valid number",
"Interval when the secret key is automatically renewed.": "Interval when the secret key is automatically renewed.",
"Italian": "Italian",
+ "January": "January",
+ "July": "July",
+ "June": "June",
"Lamp/Key": "Lamp/Key",
"Lamps/Keys": "Lamps/Keys",
"Language": "Language",
@@ -274,8 +284,10 @@
"Mail to Fax": "Mail to Fax",
"Manager Secretary": "Manager Secretary",
"Manager Secretary feature": "Manager Secretary feature",
+ "March": "March",
"Maximum allowed extension is {max}": "Maximum allowed extension is {max}",
"Maximum calls in queue": "Maximum calls in queue",
+ "May": "May",
"Me": "Me",
"Messages": "Messages",
"Minimum allowed extension is {min}": "Minimum allowed extension is {min}",
@@ -325,10 +337,12 @@
"No speed dials found": "No speed dials found",
"Normal": "Normal",
"Not modified yet": "Not modified yet",
+ "November": "November",
"Number": "Number",
"Number list": "Number list",
"Number list name": "Number list name",
"Numbers": "Numbers",
+ "October": "October",
"Office Hours Announcement": "Office Hours Announcement",
"On weekdays": "On weekdays",
"Only incoming calls from listed numbers are allowed": "Only incoming calls from listed numbers are allowed",
@@ -359,6 +373,7 @@
"Password must be at least {max} characters long": "Password must be at least {max} characters long",
"Password must be at least {min} characters long": "Password must be at least {min} characters long",
"Passwords must be equal": "Passwords must be equal",
+ "Period": "Period",
"Phone model": "Phone model",
"Phone number": "Phone number",
"Pilot": "Pilot",
@@ -456,6 +471,7 @@
"Send": "Send",
"Send Fax": "Send Fax",
"Sending fax completed successfully.": "Sending fax completed successfully.",
+ "September": "September",
"Serial Ringing": "Serial Ringing",
"Session expired, please login again": "Session expired, please login again",
"Set your Extension settings": "Set your Extension settings",
diff --git a/src/i18n/es.json b/src/i18n/es.json
index 7508893a..4a0d3eb6 100644
--- a/src/i18n/es.json
+++ b/src/i18n/es.json
@@ -47,8 +47,10 @@
"An error occured while trying to unassign the speed dial slot. Please try again": "Se produjo un error al intentar remover la ranura de marcación rápida. Por favor, inténtelo nuevamente.",
"Application": "Aplicación",
"Apps": "Aplicaciones",
+ "April": "Abril",
"Assigned slot {slot}": "Ranura {slot} asignada",
"Attach voicemail to email notification": "Adjuntar correo de voz a notificación de correo electrónico",
+ "August": "Agosto",
"Auto Attendant": "Asistente Automático",
"Block Incoming": "Bloquear Entrantes",
"Block Incoming/Outgoing": "Bloquear Entrantes/Salientes",
@@ -134,6 +136,8 @@
"Custom Announcement": "Anuncio Personalizado",
"Custom Announcements": "Anuncios Personalizados",
"Custom sound": "Sonido personalizado",
+ "Custom time set": "Custom time set",
+ "Custom time sets": "Custom time sets",
"Customer Details": "Detalles de cliente",
"Customer Phonebook": "Customer Phonebook",
"Customer Preferences": "Customer Preferences",
@@ -141,6 +145,7 @@
"Dashboard": "Tablero",
"Data is in the clipboard": "Data is in the clipboard",
"Data loading error": "Data loading error",
+ "December": "Diciembre",
"Default": "Predeterminado",
"Default sound": "Sonido predeterminado",
"Default sound set for all seats and groups": "Conjunto de sonido predeterminado para todos los asientos y grupos",
@@ -184,6 +189,7 @@
"End time": "Hora de finalización",
"English": "Español",
"Enter a number to dial": "Introduzca un número para marcar",
+ "Entity belongs to admin": "Esta entidad pertenece a admin",
"Expires": "Expira",
"Extension": "Extensión",
"Extension Settings": "Configuración de la extensión",
@@ -193,6 +199,7 @@
"Fax to mail and sendfax": "Fax a Correo y Envío de Fax",
"Fax2Mail": "Fax2Mail",
"Faxes": "Faxes",
+ "February": "Febrero",
"File": "Archivo",
"File Type": "Tipos de archivo",
"Filter": "Filtrar",
@@ -262,8 +269,11 @@
"Input must be a valid number": "El campo debe ser un número válido",
"Interval when the secret key is automatically renewed.": "Intervalo en el que la clave secreta se renueva automáticamente.",
"Italian": "Italiano",
+ "January": "Enero",
"Join conference": "Unirse a la conferencia",
"Join conference with name": "Unirse a la conferencia con nombre",
+ "July": "Julio",
+ "June": "Junio",
"Lamp/Key": "Indicador/Tecla",
"Lamps/Keys": "Indicadores/Teclas",
"Language": "Idioma",
@@ -284,8 +294,10 @@
"Manager Secretary": "Jefe-Asistente",
"Manager Secretary feature": "Manager Secretary feature",
"ManagerSecretary": "Jefe-Asistente",
+ "March": "Marzo",
"Maximum allowed extension is {max}": "La extensión máxima permitida es {max}",
"Maximum calls in queue": "Máximo de llamadas en cola",
+ "May": "Mayo",
"Me": "Me",
"Messages": "Messages",
"Minimum allowed extension is {min}": "La extensión mínima permitida es {min}",
@@ -338,10 +350,12 @@
"No speed dials found": "No se encontraron marcaciones rápidas",
"Normal": "Normal",
"Not modified yet": "No se ha modificado todavía",
+ "November": "Noviembre",
"Number": "Número",
"Number list": "Lista de números",
"Number list name": "Nombre de la lista de números",
"Numbers": "Números",
+ "October": "Octubre",
"Office Hours Announcement": "Office Hours Announcement",
"On weekdays": "En días de la semana",
"Only incoming calls from listed numbers are allowed": "Permitir solo los números listados",
@@ -372,6 +386,7 @@
"Password must be at least {max} characters long": "Password must be at least {max} characters long",
"Password must be at least {min} characters long": "Password must be at least {min} characters long",
"Passwords must be equal": "Las contraseñas deben ser iguales",
+ "Period": "Period",
"Phone model": "Modelo de teléfono",
"Phone number": "Número de teléfono",
"Pilot": "Piloto",
@@ -471,6 +486,7 @@
"Send": "Enviar",
"Send Fax": "Enviar Fax",
"Sending fax completed successfully.": "Envío de fax completado exitosamente.",
+ "September": "Septiembre",
"Serial Ringing": "Llamada en serie",
"Session expired, please login again": "Session expired, please login again",
"Session language successfully changed": "Idioma de la sesión modificado exitosamente.",
diff --git a/src/i18n/fr.json b/src/i18n/fr.json
index 8342e06d..0f11f068 100644
--- a/src/i18n/fr.json
+++ b/src/i18n/fr.json
@@ -47,8 +47,10 @@
"An error occured while trying to unassign the speed dial slot. Please try again": "Une erreur est survenue lors de la séassignation de l'emplacement de numérotation abrégée. Veuillez réessayer",
"Application": "Application",
"Apps": "Apps",
+ "April": "Avril",
"Assigned slot {slot}": "Emplacement {slot} attribué",
"Attach voicemail to email notification": "Joindre le message vocal à l'e-mail de notification",
+ "August": "Août",
"Auto Attendant": "Association auto",
"Block Incoming": "Bloquer les appels entrants",
"Block Incoming/Outgoing": "Bloquer les entrants/sortants",
@@ -134,6 +136,8 @@
"Custom Announcement": "Annonce personnalisée",
"Custom Announcements": "Annonces personnalisées",
"Custom sound": "Son personnalisé",
+ "Custom time set": "Custom time set",
+ "Custom time sets": "Custom time sets",
"Customer Details": "Détails du client",
"Customer Phonebook": "Annuaire du client",
"Customer Preferences": "Préférences du client",
@@ -141,6 +145,7 @@
"Dashboard": "Tableau de bord",
"Data is in the clipboard": "Données dans le presse-papiers",
"Data loading error": "Data loading error",
+ "December": "Décembre",
"Default": "Défaut",
"Default sound": "Son par défaut",
"Default sound set for all seats and groups": "Son par défaut défini pour tous les sièges et groupes",
@@ -184,6 +189,7 @@
"End time": "Date de fin",
"English": "Français",
"Enter a number to dial": "Enter a number to dial",
+ "Entity belongs to admin": "Cette entité appartient à l’administrateur",
"Expires": "Expire",
"Extension": "Extension",
"Extension Settings": "Paramètres des extensions",
@@ -193,6 +199,7 @@
"Fax to mail and sendfax": "Fax à E-mail et Sendfax",
"Fax2Mail": "Fax2Mail",
"Faxes": "Télécopies",
+ "February": "Février",
"File": "Fichier",
"File Type": "Type de fichier",
"Filter": "Filtrer",
@@ -262,8 +269,11 @@
"Input must be a valid number": "Le champ doit être un nombre valide",
"Interval when the secret key is automatically renewed.": "Intervalle où la clé secrète est automatiquement renouvelée.",
"Italian": "Italien",
+ "January": "Janvier",
"Join conference": "Rejoindre la conférence",
"Join conference with name": "Rejoindre la conférence avec le nom",
+ "July": "Juillet",
+ "June": "Juin",
"Lamp/Key": "Lampe/clé",
"Lamps/Keys": "Lampes/clés",
"Language": "Langue",
@@ -283,8 +293,10 @@
"Manager Secretary": "Manager Secretary",
"Manager Secretary feature": "Manager Secretary feature",
"ManagerSecretary": "ManagerSecretary",
+ "March": "Mars",
"Maximum allowed extension is {max}": "L'extension maximale autorisée est de {max}",
"Maximum calls in queue": "Nombre maximum d'appels dans la file d'attente",
+ "May": "Mai",
"Me": "Me",
"Messages": "Messages",
"Minimum allowed extension is {min}": "L'extension minimale autorisée est de {min}",
@@ -339,10 +351,12 @@
"No speed dials found": "Aucun numéro abrégé trouvé",
"Normal": "Normal",
"Not modified yet": "Pas encore modifié",
+ "November": "Novembre",
"Number": "Numéro",
"Number list": "Liste de numéros",
"Number list name": "Nom de la liste de numéros",
"Numbers": "Nombres",
+ "October": "Octobre",
"Office Hours Announcement": "Office Hours Announcement",
"On weekdays": "Les jours de semaine",
"Only incoming calls from listed numbers are allowed": "Seuls les appels entrants provenant des numéros listés sont autorisés",
@@ -373,6 +387,7 @@
"Password must be at least {max} characters long": "Password must be at least {max} characters long",
"Password must be at least {min} characters long": "Password must be at least {min} characters long",
"Passwords must be equal": "Les mots de passe doivent être égaux",
+ "Period": "Period",
"Phone model": "Modèle du poste",
"Phone number": "Numéro de téléphone",
"Pilot": "Pilote",
@@ -471,6 +486,7 @@
"Send": "Envoyer",
"Send Fax": "Envoyer un fax",
"Sending fax completed successfully.": "Le Fax a été envoyé avec succès.",
+ "September": "Septembre",
"Serial Ringing": "Sonnerie en série",
"Session expired, please login again": "Session expired, please login again",
"Set your Extension settings": "Définir les paramètres de votre extensions",
diff --git a/src/i18n/it.json b/src/i18n/it.json
index c6da040b..f3061f9e 100644
--- a/src/i18n/it.json
+++ b/src/i18n/it.json
@@ -45,8 +45,10 @@
"An error occured while trying to send the fax. Please try again": "Si è verificato un errore durante l'invio del fax. Si prega di riprovare",
"An error occured while trying to unassign the speed dial slot. Please try again": "Si è verificato un errore nella cancellazione della selezione rapida. Si prega di riprovare",
"Apps": "Apps",
+ "April": "Aprile",
"Assigned slot {slot}": "Slot assegnato: {slot}",
"Attach voicemail to email notification": "Allega messaggio vocale all'email di notifica",
+ "August": "Agosto",
"Auto Attendant": "Risponditore Automatico",
"Block Incoming": "Blocca chiamate entranti",
"Block Incoming/Outgoing": "Blocca chiamate in entrata/uscita",
@@ -132,6 +134,8 @@
"Custom Announcement": "Custom Announcement",
"Custom Announcements": "Custom Announcements",
"Custom sound": "Audio personalizzato",
+ "Custom time set": "Custom time set",
+ "Custom time sets": "Custom time sets",
"Customer Details": "Dettagli cliente",
"Customer Phonebook": "Rubrica cliente",
"Customer Preferences": "Customer Preferences",
@@ -139,6 +143,7 @@
"Dashboard": "Dashboard",
"Data is in the clipboard": "I dati sono negli appunti",
"Data loading error": "Errore nel caricamento dei dati",
+ "December": "Dicembre",
"Default": "Predefinito",
"Default sound": "Audio predefinito",
"Default sound set for all seats and groups": "Set di suoni predefinito per tutte le postazioni e i gruppi",
@@ -181,6 +186,7 @@
"End time": "End time",
"English": "Italiano",
"Enter a number to dial": "Inserisci un numero per chiamare",
+ "Entity belongs to admin": "Questa entità appartiene ad admin",
"Expires": "Scade",
"Extension": "Interno",
"Extension Settings": "Impostazioni dell'Estensione",
@@ -190,6 +196,7 @@
"Fax to mail and sendfax": "Fax to mail and sendfax",
"Fax2Mail": "Fax2Mail",
"Faxes": "Fax",
+ "February": "Febbraio",
"File": "File",
"File Type": "File Type",
"Filter": "Filtra",
@@ -258,7 +265,10 @@
"Input must be a valid number": "Il campo deve essere un numero valido",
"Interval when the secret key is automatically renewed.": "Interval when the secret key is automatically renewed.",
"Italian": "Italian",
+ "January": "Gennaio",
"Join conference with name": "Partecipa alla conferenza con nome",
+ "July": "Luglio",
+ "June": "Giugno",
"Lamp/Key": "Lampada/Tasto",
"Lamps/Keys": "Lampade/Tasti",
"Language": "Lingua",
@@ -277,8 +287,10 @@
"Mail to Fax": "Mail to Fax",
"Manager Secretary": "Segreteria",
"Manager Secretary feature": "Manager Secretary feature",
+ "March": "Marzo",
"Maximum allowed extension is {max}": "Maximum allowed extension is {max}",
"Maximum calls in queue": "Numero massimo di chiamate in coda",
+ "May": "Maggio",
"Me": "Me",
"Messages": "Messages",
"Minimum allowed extension is {min}": "Minimum allowed extension is {min}",
@@ -331,10 +343,12 @@
"No speed dials found": "Nessuna impostazione di chiamata rapida",
"Normal": "Normale",
"Not modified yet": "Not modified yet",
+ "November": "Novembre",
"Number": "Numero",
"Number list": "Number list",
"Number list name": "Number list name",
"Numbers": "Numeri",
+ "October": "Ottobre",
"Office Hours Announcement": "Office Hours Announcement",
"On weekdays": "Nei giorni feriali",
"Only incoming calls from listed numbers are allowed": "Solo ammesse solo chiamate dai numeri in elenco",
@@ -365,6 +379,7 @@
"Password must be at least {max} characters long": "Password must be at least {max} characters long",
"Password must be at least {min} characters long": "Password must be at least {min} characters long",
"Passwords must be equal": "Le passwords devono essere identiche",
+ "Period": "Period",
"Phone model": "Modello telefono",
"Phone number": "Numero di telefono",
"Pilot": "Pilota",
@@ -463,6 +478,7 @@
"Send": "Invia",
"Send Fax": "Invia fax",
"Sending fax completed successfully.": "Fax inviato correttamente.",
+ "September": "Settembre",
"Serial Ringing": "Chiamata in sequenza",
"Session expired, please login again": "Session expired, please login again",
"Set your fax settings": "Set your fax settings",
diff --git a/src/pages/CscPageCf.vue b/src/pages/CscPageCf.vue
index 1f0b8358..98132a08 100644
--- a/src/pages/CscPageCf.vue
+++ b/src/pages/CscPageCf.vue
@@ -95,11 +95,7 @@ import CscPopupMenuItem from 'components/CscPopupMenuItem'
import CscSpinner from 'components/CscSpinner'
import CscCfGroup from 'components/call-forwarding/CscCfGroup'
import CscCfGroupItemPrimaryNumber from 'components/call-forwarding/CscCfGroupItemPrimaryNumber'
-import {
- mapActions,
- mapGetters,
- mapState
-} from 'vuex'
+import { mapActions, mapGetters, mapState } from 'vuex'
export default {
name: 'CscPageCf',
components: {
diff --git a/src/pages/CscPagePbxGroupDetails.vue b/src/pages/CscPagePbxGroupDetails.vue
index 9d0e31f7..019c3f15 100644
--- a/src/pages/CscPagePbxGroupDetails.vue
+++ b/src/pages/CscPagePbxGroupDetails.vue
@@ -242,18 +242,22 @@
@@ -400,6 +404,13 @@ export default {
}
},
watch: {
+ async $route (to) {
+ if (this.id !== to.params.id) {
+ this.id = to.params.id
+ this.selectGroup(this.id)
+ await this.loadMappingsFull(this.id)
+ }
+ },
groupSelected () {
this.changes = this.getGroupData()
this.soundSet = this.getSoundSetByGroupId(this.groupSelected.id)
@@ -412,9 +423,9 @@ export default {
}
}
},
- mounted () {
+ async mounted () {
this.selectGroup(this.id)
- this.loadMappingsFull(this.id)
+ await this.loadMappingsFull(this.id)
},
beforeUnmount () {
this.resetSelectedGroup()
diff --git a/src/pages/CscPagePbxSeatDetails.vue b/src/pages/CscPagePbxSeatDetails.vue
index ccb44ae4..8c254fdd 100644
--- a/src/pages/CscPagePbxSeatDetails.vue
+++ b/src/pages/CscPagePbxSeatDetails.vue
@@ -347,18 +347,22 @@
@@ -469,6 +473,7 @@ export default {
'getIntraPbx',
'getSeatUpdateToastMessage',
'isSeatLoading',
+ 'isSeatMapByIdEmpty',
'getAnnouncementCfu',
'getAnnouncementCallSetup',
'getAnnouncementToCallee',
@@ -578,6 +583,12 @@ export default {
}
},
watch: {
+ async $route (to) {
+ if (this.id !== to.params.id) {
+ this.id = to.params.id
+ this.selectSeat(this.id)
+ }
+ },
seatSelected () {
this.soundSet = this.getSoundSetBySeatId(this.seatSelected.id)
this.loadPreferences(this.seatSelected.id).then((preferences) => {
@@ -625,7 +636,11 @@ export default {
}
},
async mounted () {
- this.selectSeat(this.id)
+ if (this.isSeatMapByIdEmpty) {
+ await this.loadSeatListItems()
+ }
+
+ this.selectSeat(this.$route.params.id)
await this.loadAnnouncements()
await this.getNcosSetSubscriber()
},
@@ -642,6 +657,7 @@ export default {
'setIntraPbx',
'setMusicOnHold',
'setSeatSoundSet',
+ 'loadSeatListItems',
'loadPreferences',
'setCli',
'setNcosSet',
diff --git a/src/store/call-forwarding/actions.js b/src/store/call-forwarding/actions.js
index 2777373a..558b5bc2 100644
--- a/src/store/call-forwarding/actions.js
+++ b/src/store/call-forwarding/actions.js
@@ -18,12 +18,15 @@ import {
cfUpdateTimeSetWeekdays
} from 'src/api/call-forwarding'
import {
- get, getList,
+ get,
+ getList,
patchReplace,
patchReplaceFull,
- post, put
+ post,
+ put
} from 'src/api/common'
-import { showGlobalError } from 'src/helpers/ui'
+import { i18n } from 'src/boot/i18n'
+import { showGlobalError, showGlobalWarning } from 'src/helpers/ui'
import { v4 } from 'uuid'
const DEFAULT_RING_TIMEOUT = 60
@@ -42,19 +45,16 @@ function createDefaultDestination (destination, defaultAnnouncementId) {
return payload
}
-export async function loadMappingsFull ({ dispatch, commit, rootGetters }, subscriberId) {
+export async function loadMappingsFull ({ dispatch, commit, rootGetters }, id) {
dispatch('wait/start', WAIT_IDENTIFIER, { root: true })
- let res = null
- if (subscriberId) {
- res = await cfLoadMappingsFull(subscriberId)
- } else {
- res = await cfLoadMappingsFull(rootGetters['user/getSubscriberId'])
- }
+ const subscriberId = id || rootGetters['user/getSubscriberId']
+ const mappingData = await cfLoadMappingsFull(subscriberId)
+
commit('dataSucceeded', {
- mappings: res[0],
- destinationSets: res[1].items,
- sourceSets: res[2].items,
- timeSets: res[3].items
+ mappings: mappingData[0],
+ destinationSets: mappingData[1].items,
+ sourceSets: mappingData[2].items,
+ timeSets: mappingData[3].items
})
dispatch('wait/end', WAIT_IDENTIFIER, { root: true })
}
@@ -66,7 +66,7 @@ export async function createMapping ({ dispatch, commit, state, rootGetters }, p
if (payload.type === 'cfu' && state.mappings.cft && state.mappings.cft.length > 0) {
type = 'cft'
}
- const subscriberId = (payload.subscriberId) ? (payload.subscriberId) : rootGetters['user/getSubscriberId']
+ const subscriberId = payload.subscriberId ? payload.subscriberId : rootGetters['user/getSubscriberId']
const mappings = _.cloneDeep(state.mappings[type])
const destinationSet = await post({
resource: 'cfdestinationsets',
@@ -76,21 +76,22 @@ export async function createMapping ({ dispatch, commit, state, rootGetters }, p
destinations: [createDefaultDestination()]
}
})
+
mappings.push({
- destinationset_id: destinationSet?.id
+ destinationset_id: destinationSet.id
})
- const res = await Promise.all([
- patchReplaceFull({
- resource: 'cfmappings',
- resourceId: subscriberId,
- fieldPath: type,
- value: mappings
- }),
- cfLoadDestinationSets(rootGetters['user/getSubscriberId'])
- ])
+
+ const patchedMappings = await patchReplaceFull({
+ resource: 'cfmappings',
+ resourceId: subscriberId,
+ fieldPath: type,
+ value: mappings
+ })
+ const latestDestinationSets = await cfLoadDestinationSets()
+
commit('dataSucceeded', {
- mappings: res[0],
- destinationSets: res[1].items
+ mappings: patchedMappings,
+ destinationSets: latestDestinationSets.items
})
} catch (error) {
showGlobalError(error.message)
@@ -114,7 +115,19 @@ export async function deleteMapping ({ dispatch, commit, state, rootGetters }, p
fieldPath: payload.type,
value: updatedMappings
})
- await cfDeleteDestinationSet(payload.destinationset_id)
+
+ try {
+ await cfDeleteDestinationSet(payload.destinationset_id)
+ } catch (e) {
+ if (e.code === 404 && e.message === 'Entity \'cfdestinationset\' not found.') {
+ // This happens when CF was set by Admin therefore current
+ // csc user doesn't have rights to delete the entity
+ showGlobalWarning(i18n.global.tc('Entity belongs to admin'))
+ } else {
+ showGlobalError(e.message)
+ }
+ }
+
const destinationSets = await cfLoadDestinationSets()
commit('dataSucceeded', {
mappings: patchRes,
@@ -139,8 +152,8 @@ export async function toggleMapping ({ dispatch, commit, state, rootGetters }, p
dispatch('wait/end', WAIT_IDENTIFIER, { root: true })
}
-export async function updateDestination ({ dispatch, commit, state, rootGetters }, payload) {
- dispatch('wait/start', WAIT_IDENTIFIER, { root: true })
+export async function updateDestination ({ dispatch, commit, state }, payload) {
+ dispatch('wait/start', 'csc-cf-destination-set-update', { root: true })
const destinations = _.cloneDeep(state.destinationSetMap[payload.destinationSetId].destinations)
destinations[payload.destinationIndex].destination = payload.destination
await patchReplace({
@@ -153,7 +166,7 @@ export async function updateDestination ({ dispatch, commit, state, rootGetters
commit('dataSucceeded', {
destinationSets: destinationSets.items
})
- dispatch('wait/end', WAIT_IDENTIFIER, { root: true })
+ dispatch('wait/end', 'csc-cf-destination-set-update', { root: true })
}
export async function addDestination ({ dispatch, commit, state, rootGetters }, payload) {
@@ -189,8 +202,8 @@ export async function rewriteDestination ({ dispatch, commit, state, rootGetters
}
}
-export async function removeDestination ({ dispatch, commit, state, rootGetters }, payload) {
- dispatch('wait/start', WAIT_IDENTIFIER, { root: true })
+export async function removeDestination ({ dispatch, commit, state }, payload) {
+ dispatch('wait/start', 'csc-cf-destination-set-remove', { root: true })
const destinations = _.cloneDeep(state.destinationSetMap[payload.destinationSetId].destinations)
const updatedDestinations = destinations.reduce(($updatedDestinations, value, index) => {
if (index !== payload.destinationIndex) {
@@ -208,19 +221,23 @@ export async function removeDestination ({ dispatch, commit, state, rootGetters
commit('dataSucceeded', {
destinationSets: destinationSets.items
})
- dispatch('wait/end', WAIT_IDENTIFIER, { root: true })
+ dispatch('wait/end', 'csc-cf-destination-set-remove', { root: true })
}
-export async function updateDestinationTimeout ({ dispatch, commit, state, rootGetters }, payload) {
+export async function updateDestinationTimeout ({ dispatch, commit, state }, payload) {
dispatch('wait/start', WAIT_IDENTIFIER, { root: true })
const destinations = _.cloneDeep(state.destinationSetMap[payload.destinationSetId].destinations)
destinations[payload.destinationIndex].timeout = payload.destinationTimeout
- await patchReplace({
- resource: 'cfdestinationsets',
- resourceId: payload.destinationSetId,
- fieldPath: 'destinations',
- value: destinations
- })
+ try {
+ await patchReplace({
+ resource: 'cfdestinationsets',
+ resourceId: payload.destinationSetId,
+ fieldPath: 'destinations',
+ value: destinations
+ })
+ } catch (e) {
+ showGlobalError(e.message)
+ }
const destinationSets = await cfLoadDestinationSets()
commit('dataSucceeded', {
destinationSets: destinationSets.items
@@ -228,7 +245,7 @@ export async function updateDestinationTimeout ({ dispatch, commit, state, rootG
dispatch('wait/end', WAIT_IDENTIFIER, { root: true })
}
-export async function loadSourceSets ({ dispatch, commit, rootGetters }) {
+export async function loadSourceSets ({ dispatch, commit }) {
dispatch('wait/start', 'csc-cf-sourcesets', { root: true })
const sourceSets = await cfLoadSourceSets()
commit('dataSucceeded', {
@@ -259,7 +276,7 @@ export async function createSourceSet ({ dispatch, commit, rootGetters, state },
}
}
-export async function updateSourceSet ({ dispatch, commit, rootGetters, state }, payload) {
+export async function updateSourceSet ({ dispatch, commit, rootGetters }, payload) {
try {
dispatch('wait/start', 'csc-cf-source-set-create', { root: true })
await cfUpdateSourceSet(rootGetters['user/getSubscriberId'], payload)
@@ -267,6 +284,14 @@ export async function updateSourceSet ({ dispatch, commit, rootGetters, state },
commit('dataSucceeded', {
sourceSets: sourceSets.items
})
+ } catch (e) {
+ if (e.code === 404 && e.message === 'Entity \'sourceset\' not found.') {
+ // This happens when CF was set by Admin therefore current
+ // csc user doesn't have rights to delete the entity
+ showGlobalWarning(i18n.global.tc('Entity belongs to admin'))
+ } else {
+ showGlobalError(e.message)
+ }
} finally {
dispatch('wait/end', 'csc-cf-source-set-create', { root: true })
}
@@ -290,6 +315,8 @@ export async function deleteSourceSet ({ dispatch, commit, rootGetters, state },
mappings: updatedMappings,
sourceSets: sourceSets.items
})
+ } catch (e) {
+ showGlobalError(e.message)
} finally {
dispatch('wait/end', 'csc-cf-source-set-create', { root: true })
}
@@ -353,14 +380,19 @@ export async function createTimeSetDate ({ dispatch, commit, rootGetters, state
dispatch('wait/end', 'csc-cf-time-set-create', { root: true })
}
-export async function updateTimeSetDate ({ dispatch, commit, rootGetters, state }, payload) {
+export async function updateTimeSetDate ({ dispatch, commit }, payload) {
dispatch('wait/start', 'csc-cf-time-set-create', { root: true })
- await cfUpdateTimeSetDate(payload.id, payload.date)
- const timeSets = await cfLoadTimeSets()
- commit('dataSucceeded', {
- timeSets: timeSets.items
- })
- dispatch('wait/end', 'csc-cf-time-set-create', { root: true })
+ try {
+ await cfUpdateTimeSetDate(payload.id, payload.date)
+ const timeSets = await cfLoadTimeSets()
+ commit('dataSucceeded', {
+ timeSets: timeSets.items
+ })
+ } catch (e) {
+ showGlobalError(e.message)
+ } finally {
+ dispatch('wait/end', 'csc-cf-time-set-create', { root: true })
+ }
}
export async function deleteTimeSet ({ dispatch, commit, rootGetters, state }, payload) {
@@ -374,7 +406,17 @@ export async function deleteTimeSet ({ dispatch, commit, rootGetters, state }, p
fieldPath: payload.mapping.type,
value: updatedMapping
})
- await cfDeleteTimeSet(payload.id)
+ try {
+ await cfDeleteTimeSet(payload.id)
+ } catch (e) {
+ if (e.code === 404 && e.message === 'Entity \'cftimeset\' not found.') {
+ // This happens when CF was set by Admin therefore current
+ // csc user doesn't have rights to delete the entity
+ showGlobalWarning(i18n.global.tc('Entity belongs to admin'))
+ } else {
+ showGlobalError(e.message)
+ }
+ }
const timeSets = await cfLoadTimeSets()
commit('dataSucceeded', {
mappings: updatedMappings,
@@ -414,6 +456,8 @@ export async function doNotRingPrimaryNumber ({ commit, rootGetters, state }, pa
}
export async function updateRingTimeout ({ commit, rootGetters, state }, payload) {
+ // eslint-disable-next-line no-console
+ console.debug('aaa')
const updatedMappings = await patchReplaceFull({
resource: 'cfmappings',
resourceId: (payload.subscriberId) ? payload.subscriberId : rootGetters['user/getSubscriberId'],
@@ -444,9 +488,20 @@ export async function createTimeSetDateRange ({ dispatch, commit, rootGetters, s
dispatch('wait/end', 'csc-cf-time-set-create', { root: true })
}
-export async function updateTimeSetDateRange ({ dispatch, commit, rootGetters, state }, payload) {
+export async function updateTimeSetDateRange ({ dispatch, commit }, payload) {
dispatch('wait/start', 'csc-cf-time-set-create', { root: true })
- await cfUpdateTimeSetDateRange(payload.id, payload.date)
+ try {
+ await cfUpdateTimeSetDateRange(payload.id, payload.date)
+ } catch (e) {
+ if (e.code === 404 && e.message === 'Entity \'timeset\' not found.') {
+ // This happens when CF was set by Admin therefore current
+ // csc user doesn't have rights to delete the entity
+ showGlobalWarning(i18n.global.tc('Entity belongs to admin'))
+ } else {
+ showGlobalError(e.message)
+ }
+ }
+
const timeSets = await cfLoadTimeSets()
commit('dataSucceeded', {
timeSets: timeSets.items
@@ -473,9 +528,20 @@ export async function createTimeSetWeekdays ({ dispatch, commit, rootGetters, st
dispatch('wait/end', 'csc-cf-time-set-create', { root: true })
}
-export async function updateTimeSetWeekdays ({ dispatch, commit, rootGetters, state }, payload) {
+export async function updateTimeSetWeekdays ({ dispatch, commit }, payload) {
dispatch('wait/start', 'csc-cf-time-set-create', { root: true })
- await cfUpdateTimeSetWeekdays(payload.id, payload.weekdays)
+ try {
+ await cfUpdateTimeSetWeekdays(payload.id, payload.weekdays)
+ } catch (e) {
+ if (e.code === 404 && e.message === 'Entity \'timeset\' not found.') {
+ // This happens when CF was set by Admin therefore current
+ // csc user doesn't have rights to delete the entity
+ showGlobalWarning(i18n.global.tc('Entity belongs to admin'))
+ } else {
+ showGlobalError(e.message)
+ }
+ }
+
const timeSets = await cfLoadTimeSets()
commit('dataSucceeded', {
timeSets: timeSets.items
@@ -497,7 +563,7 @@ export async function createOfficeHours ({ dispatch, commit, rootGetters, state
if (payload.id) {
await cfDeleteTimeSet(payload.id)
}
- const timeSets = await cfLoadTimeSets(rootGetters['user/getSubscriberId'])
+ const timeSets = await cfLoadTimeSets()
commit('dataSucceeded', {
mappings: updatedMappings,
timeSets: timeSets.items
@@ -507,8 +573,13 @@ export async function createOfficeHours ({ dispatch, commit, rootGetters, state
export async function updateOfficeHours ({ dispatch, commit, rootGetters, state }, payload) {
dispatch('wait/start', 'csc-cf-time-set-create', { root: true })
- await cfUpdateOfficeHours(payload.id, payload.times)
- const timeSets = await cfLoadTimeSets(rootGetters['user/getSubscriberId'])
+ try {
+ await cfUpdateOfficeHours(payload.id, payload.times)
+ } catch (e) {
+ showGlobalError(e.message)
+ }
+
+ const timeSets = await cfLoadTimeSets()
commit('dataSucceeded', {
timeSets: timeSets.items
})
@@ -543,15 +614,20 @@ export async function getAnnouncementById ({ dispatch, commit, rootGetters, stat
}
}
-export async function updateAnnouncement ({ dispatch, commit, rootGetters, state }, payload) {
- const destinations = _.cloneDeep(state.destinationSetMap[payload.destinationSetId].destinations)
- destinations[payload.destinationIndex].announcement_id = payload.announcementId
- await patchReplace({
- resource: 'cfdestinationsets',
- resourceId: payload.destinationSetId,
- fieldPath: 'destinations',
- value: destinations
- })
+export async function updateAnnouncement ({ dispatch, commit, state }, payload) {
+ try {
+ const destinations = _.cloneDeep(state.destinationSetMap[payload.destinationSetId].destinations)
+ destinations[payload.destinationIndex].announcement_id = payload.announcementId
+ await patchReplace({
+ resource: 'cfdestinationsets',
+ resourceId: payload.destinationSetId,
+ fieldPath: 'destinations',
+ value: destinations
+ })
+ } catch (e) {
+ showGlobalError(e.message)
+ }
+
const destinationSets = await cfLoadDestinationSets()
commit('dataSucceeded', {
destinationSets: destinationSets.items
diff --git a/src/store/call-forwarding/mutations.js b/src/store/call-forwarding/mutations.js
index 374261e2..3e33d22a 100644
--- a/src/store/call-forwarding/mutations.js
+++ b/src/store/call-forwarding/mutations.js
@@ -5,6 +5,7 @@ export function dataSucceeded (state, res) {
destinationSetMap[destinationSet.id] = destinationSet
})
state.destinationSetMap = destinationSetMap
+ state.destinationSets = res.destinationSets
}
if (res.sourceSets) {
const sourceSetMap = {}
diff --git a/src/store/pbx-seats.js b/src/store/pbx-seats.js
index ee435283..9b0276cf 100644
--- a/src/store/pbx-seats.js
+++ b/src/store/pbx-seats.js
@@ -58,6 +58,9 @@ export default {
isSeatListEmpty (state) {
return state.seatListItems.length && state.seatListItems.length === 0
},
+ isSeatMapByIdEmpty (state) {
+ return Object.keys(state.seatMapById).length === 0
+ },
isSeatListRequesting (state) {
return state.seatListState === RequestState.requesting
},