From 01032cad602b84ae85c6f2b5309dddb27249744d Mon Sep 17 00:00:00 2001 From: Carlo Venusino Date: Tue, 13 Apr 2021 15:46:30 +0200 Subject: [PATCH] TT#117521 Auto-attendant - As a SubscriberAdmin, I want to configure Auto-attendant slots - TT#118754 Create new menu point under PBXConfiguration + new page + new route - TT#118755 Render a list of all slots of all Subscribers (Pilot, Seats, Groups) - TT#118756 Load Subscriber (Pilot, Seats, Groups) name for each slot in the list - TT#118757 Implement AddForm to be able to add a new AA-Slot - TT#118758 Implement Deletion for a AA-Slot including a confirmation Dialog - TT#118765 Implement EditForm to be able to edit the destination of an existing AA-Slot NOTES - In order to test the feature you need to create a Customer with Product = Cloud PBX Account, and at least one subscriber which you need to login into CSC. - There are a couple of components which have been created and not used due tue specs revision, but left in place for future possible utilisation: - Sorting by subscriber id and name has been removed as it is not supported by the endpoint src/components/form/CscSelectLazy.vue src/components/CscDataTableEditSelect.vue Change-Id: Iec29baecfa75f3c818b9deb945625a1bf977ca88 --- src/api/pbx-auto-attendants.js | 20 ++ src/components/CscDataTableEditInput.vue | 111 ++++++++ src/components/CscDataTableEditSelect.vue | 99 +++++++ src/components/CscMainMenuTop.vue | 6 + src/components/CscPopupMenuItem.vue | 2 +- src/components/form/CscSelectLazy.vue | 135 +++++++++ .../CscNewCallForwardDateRange.vue | 4 +- .../CscPbxAutoAttendantAddForm.vue | 149 ++++++++++ ...n.vue => CscPbxAutoAttendantSelection.vue} | 2 +- .../CscPbxAutoAttendantSlotsTable.vue | 261 ++++++++++++++++++ .../PbxConfiguration/CscPbxDeviceConfig.vue | 6 +- .../PbxConfiguration/CscPbxDeviceFilters.vue | 6 +- src/i18n/de.json | 20 +- src/i18n/en.json | 20 +- src/i18n/es.json | 20 +- src/i18n/fr.json | 20 +- src/i18n/it.json | 20 +- src/pages/CscPagePbxAutoAttendant.vue | 212 ++++++++++++++ src/router/routes.js | 9 + src/store/index.js | 4 +- src/store/pbx-auto-attendants.js | 115 ++++++++ 21 files changed, 1224 insertions(+), 17 deletions(-) create mode 100644 src/api/pbx-auto-attendants.js create mode 100644 src/components/CscDataTableEditInput.vue create mode 100644 src/components/CscDataTableEditSelect.vue create mode 100644 src/components/form/CscSelectLazy.vue create mode 100644 src/components/pages/PbxConfiguration/CscPbxAutoAttendantAddForm.vue rename src/components/pages/PbxConfiguration/{CscPbxAttendantSelection.vue => CscPbxAutoAttendantSelection.vue} (97%) create mode 100644 src/components/pages/PbxConfiguration/CscPbxAutoAttendantSlotsTable.vue create mode 100644 src/pages/CscPagePbxAutoAttendant.vue create mode 100644 src/store/pbx-auto-attendants.js diff --git a/src/api/pbx-auto-attendants.js b/src/api/pbx-auto-attendants.js new file mode 100644 index 00000000..d3d0738e --- /dev/null +++ b/src/api/pbx-auto-attendants.js @@ -0,0 +1,20 @@ +import Vue from 'vue' +import { patchReplaceFull } from 'src/api/common' + +export async function getAutoAttendants (options) { + const params = { ...options, ...{ expand: 1 } } + const res = await Vue.http.get('api/autoattendants/', { + params: params + }) + return res.body.total_count > 0 ? res.body : [] +} + +export async function editSubscriberSlots (options) { + const res = await patchReplaceFull({ + resource: 'autoattendants', + resourceId: options.subscriberId, + fieldPath: 'slots', + value: options.slots + }) + return res.slots +} diff --git a/src/components/CscDataTableEditInput.vue b/src/components/CscDataTableEditInput.vue new file mode 100644 index 00000000..2ad9718b --- /dev/null +++ b/src/components/CscDataTableEditInput.vue @@ -0,0 +1,111 @@ + + + diff --git a/src/components/CscDataTableEditSelect.vue b/src/components/CscDataTableEditSelect.vue new file mode 100644 index 00000000..331497c9 --- /dev/null +++ b/src/components/CscDataTableEditSelect.vue @@ -0,0 +1,99 @@ + + + diff --git a/src/components/CscMainMenuTop.vue b/src/components/CscMainMenuTop.vue index a6406782..d899a32b 100644 --- a/src/components/CscMainMenuTop.vue +++ b/src/components/CscMainMenuTop.vue @@ -179,6 +179,12 @@ export default { icon: 'arrow_forward', label: this.$t('Manager Secretary'), visible: true + }, + { + to: '/user/pbx-configuration/auto-attendant', + icon: 'dialpad', + label: this.$t('Auto-attendant'), + visible: true } ] }, diff --git a/src/components/CscPopupMenuItem.vue b/src/components/CscPopupMenuItem.vue index 2582cfb2..e5ca4f7f 100644 --- a/src/components/CscPopupMenuItem.vue +++ b/src/components/CscPopupMenuItem.vue @@ -35,7 +35,7 @@ export default { default: 'primary' }, label: { - type: String, + type: [String, Number], default: '' }, sublabel: { diff --git a/src/components/form/CscSelectLazy.vue b/src/components/form/CscSelectLazy.vue new file mode 100644 index 00000000..3a0b168b --- /dev/null +++ b/src/components/form/CscSelectLazy.vue @@ -0,0 +1,135 @@ + + + diff --git a/src/components/pages/NewCallForward/CscNewCallForwardDateRange.vue b/src/components/pages/NewCallForward/CscNewCallForwardDateRange.vue index 56cd8e9e..11b2b217 100644 --- a/src/components/pages/NewCallForward/CscNewCallForwardDateRange.vue +++ b/src/components/pages/NewCallForward/CscNewCallForwardDateRange.vue @@ -391,13 +391,11 @@ export default { } - diff --git a/src/components/pages/PbxConfiguration/CscPbxAttendantSelection.vue b/src/components/pages/PbxConfiguration/CscPbxAutoAttendantSelection.vue similarity index 97% rename from src/components/pages/PbxConfiguration/CscPbxAttendantSelection.vue rename to src/components/pages/PbxConfiguration/CscPbxAutoAttendantSelection.vue index ebb82b9e..f96104e4 100644 --- a/src/components/pages/PbxConfiguration/CscPbxAttendantSelection.vue +++ b/src/components/pages/PbxConfiguration/CscPbxAutoAttendantSelection.vue @@ -36,7 +36,7 @@ diff --git a/src/components/pages/PbxConfiguration/CscPbxDeviceConfig.vue b/src/components/pages/PbxConfiguration/CscPbxDeviceConfig.vue index 28bdb2b5..a3ac2359 100644 --- a/src/components/pages/PbxConfiguration/CscPbxDeviceConfig.vue +++ b/src/components/pages/PbxConfiguration/CscPbxDeviceConfig.vue @@ -51,7 +51,7 @@ - import _ from 'lodash' +import CscPbxAutoAttendantSelection from './CscPbxAutoAttendantSelection' import { Platform } from 'quasar' import { BoundingBox2D } from 'src/helpers/graphics' -import CscPbxAttendantSelection from './CscPbxAttendantSelection' export default { name: 'CscPbxDeviceConfig', components: { - CscPbxAttendantSelection + CscPbxAutoAttendantSelection }, props: { device: { diff --git a/src/components/pages/PbxConfiguration/CscPbxDeviceFilters.vue b/src/components/pages/PbxConfiguration/CscPbxDeviceFilters.vue index 40fc8341..236a820a 100644 --- a/src/components/pages/PbxConfiguration/CscPbxDeviceFilters.vue +++ b/src/components/pages/PbxConfiguration/CscPbxDeviceFilters.vue @@ -49,7 +49,7 @@ @opened="$emit('model-select-opened')" @input="triggerFilter" /> - import _ from 'lodash' import CscPbxModelSelect from '../PbxConfiguration/CscPbxModelSelect' -import CscPbxAttendantSelection from '../PbxConfiguration/CscPbxAttendantSelection' +import CscPbxAutoAttendantSelection from './CscPbxAutoAttendantSelection' import { mapActions, mapState } from 'vuex' export default { name: 'CscPbxDeviceFilters', components: { CscPbxModelSelect, - CscPbxAttendantSelection + CscPbxAutoAttendantSelection }, props: { loading: { diff --git a/src/i18n/de.json b/src/i18n/de.json index 7f83dd34..c9f1f7ad 100644 --- a/src/i18n/de.json +++ b/src/i18n/de.json @@ -12,6 +12,7 @@ "404 Not Found": "404 Not Found", "A default subscriber sound set to be set before being able to select, in the Sound Sets page.": "Ein Standard-Soundset muss festgelegt werden, bevor ein Soundset ausgewählt werden kann.", "ACL": "", + "ADD SLOT": "", "Abort": "Abbrechen", "Accepted email address to allow mail2fax transmission.": "", "Active": "", @@ -23,6 +24,7 @@ "Add Group": "Gruppe hinzufügen", "Add Number": "Weiterleitung zu Rufnummern hinzuƒügen", "Add Seat": "Seat hinzufügen", + "Add Slots": "", "Add Sound Set": "Soundset hinzufügen", "Add Speed Dial": "Kurzwahl hinzufügen", "Add Time": "Zeitraum hinzufügen", @@ -34,6 +36,7 @@ "Add forwarding": "", "Add new": "Neue hinzufügen", "Add number": "Nummer hinzufügen", + "Add slot": "", "Add source": "Anrufer hinzufügen", "Add time": "", "Add time range": "", @@ -94,6 +97,7 @@ "Audio + Video": "Audio und Video", "Audio Call": "Audioanruf", "Audio Only": "Nur Audio", + "Auto-attendant": "", "Blacklist": "Blacklist", "Block Incoming": "Eingehende Anrufe blockieren", "Block Incoming/Outgoing": "Ein-/Ausgehende Anrufe blockieren", @@ -182,6 +186,7 @@ "Delete forwarding": "", "Delete from {groupName} forwarding": "", "Delete recording": "", + "Delete slot?": "", "Delete sourceset": "Anruferliste löschen", "Delete voicemail after email notification is delivered": "Voicemail löschen, wenn die E-Mail-Benachrichtigung gesendet wurde", "Delete {groupName} forwarding group": "", @@ -196,6 +201,7 @@ "Destination Email": "", "Destination Number": "Zielrufnummer", "Destination email to send the secret key renew notification to.": "", + "Destination must not be empty": "", "Destinations": "", "Devices": "Geräte", "Disable": "Deaktivieren", @@ -341,6 +347,7 @@ "No Voicemails found": "Keine Voicemails gefunden", "No call goes to primary number": "", "No call queues created yet": "Es wurden noch keine Anrufwarteschlangen erstellt.", + "No data found": "", "No data to save. Please provide at least one time range.": "", "No destinations created yet": "", "No devices created yet": "Noch keine Geräte angelegt", @@ -390,6 +397,9 @@ "Play sound in loop": "Sound in Schleife abspielen", "Playing in loop": "In Schleife abspielen", "Please add a destination to the group before adding conditions": "", + "Please fill all the empty destinations": "", + "Please fill all the fields": "", + "Please fill or remove the empty slots": "", "Please select a valid timerange": "", "Please select an option": "", "Primary Number": "Primär-Rufnummer", @@ -500,6 +510,12 @@ "Show filters": "Filter anzeigen", "Sign In": "Log-in", "Slot": "Kurzwahl", + "Slot added successfully": "", + "Slot edited successfully": "", + "Slot successfully deleted": "", + "Slot {number}": "", + "Slots saved successfully": "", + "Slots successfully added": "", "Something went wrong. Please retry later": "", "Sound Set": "Soundset", "Sound Sets": "Sound Sets", @@ -516,6 +532,7 @@ "Start time should be less than End time": "", "Station name": "Gerätename", "Su": "", + "Subscriber": "", "Subscriber Sign In": "Subscriber Log-in", "Sunday": "Sonntag", "Super": "Hoch", @@ -604,6 +621,7 @@ "You are about to delete {name} sourceset": "", "You are about to delete {name} timeset": "", "You are about to delete recording #{id}": "", + "You are about to delete slot {slot}": "", "You are about to delete time range \"{from} - {to}\"": "", "You are about to delete {destination} from {groupName} call forwarding": "", "You are about to delete {groupName} call forwarding group": "", @@ -697,4 +715,4 @@ "{field} must have at most {maxLength} letters": "{field} darf höchstens {maxLength} Buchstaben beinhalten", "{mode} of sources": "{mode} of sources", "{mode} own phone": "Eigene Rufnummer {mode}" -} \ No newline at end of file +} diff --git a/src/i18n/en.json b/src/i18n/en.json index 71e3d260..92323c8d 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -12,6 +12,7 @@ "404 Not Found": "404 Not Found", "A default subscriber sound set to be set before being able to select, in the Sound Sets page.": "A default subscriber sound set to be set before being able to select, in the Sound Sets page.", "ACL": "ACL", + "ADD SLOT": "ADD SLOT", "Abort": "Abort", "Accepted email address to allow mail2fax transmission.": "Accepted email address to allow mail2fax transmission.", "Active": "Active", @@ -23,6 +24,7 @@ "Add Group": "Add Group", "Add Number": "Add Number", "Add Seat": "Add Seat", + "Add Slots": "Add Slots", "Add Sound Set": "Add Sound Set", "Add Speed Dial": "Add Speed Dial", "Add Time": "Add Time", @@ -34,6 +36,7 @@ "Add forwarding": "Add forwarding", "Add new": "Add new", "Add number": "Add number", + "Add slot": "Add slot", "Add source": "Add source", "Add time": "Add time", "Add time range": "Add time range", @@ -94,6 +97,7 @@ "Audio + Video": "Audio + Video", "Audio Call": "Audio Call", "Audio Only": "Audio Only", + "Auto-attendant": "Auto-attendant", "Blacklist": "Blacklist", "Block Incoming": "Block Incoming", "Block Incoming/Outgoing": "Block Incoming/Outgoing", @@ -182,6 +186,7 @@ "Delete forwarding": "Delete forwarding", "Delete from {groupName} forwarding": "Delete from {groupName} forwarding", "Delete recording": "Delete recording", + "Delete slot?": "Delete slot?", "Delete sourceset": "Delete sourceset", "Delete voicemail after email notification is delivered": "Delete voicemail after email notification is delivered", "Delete {groupName} forwarding group": "Delete {groupName} forwarding group", @@ -196,6 +201,7 @@ "Destination Email": "Destination Email", "Destination Number": "Destination Number", "Destination email to send the secret key renew notification to.": "Destination email to send the secret key renew notification to.", + "Destination must not be empty": "Destination must not be empty", "Destinations": "Destinations", "Devices": "Devices", "Disable": "Disable", @@ -341,6 +347,7 @@ "No Voicemails found": "No Voicemails found", "No call goes to primary number": "No call goes to primary number", "No call queues created yet": "No call queues created yet", + "No data found": "No data found", "No data to save. Please provide at least one time range.": "No data to save. Please provide at least one time range.", "No destinations created yet": "No destinations created yet", "No devices created yet": "No devices created yet", @@ -390,6 +397,9 @@ "Play sound in loop": "Play sound in loop", "Playing in loop": "Playing in loop", "Please add a destination to the group before adding conditions": "Please add a destination to the group before adding conditions", + "Please fill all the empty destinations": "Please fill all the empty destinations", + "Please fill all the fields": "Please fill all the fields", + "Please fill or remove the empty slots": "Please fill or remove the empty slots", "Please select a valid timerange": "Please select a valid timerange", "Please select an option": "Please select an option", "Primary Number": "Primary Number", @@ -500,6 +510,12 @@ "Show filters": "Show filters", "Sign In": "Sign In", "Slot": "Slot", + "Slot added successfully": "Slot added successfully", + "Slot edited successfully": "Slot edited successfully", + "Slot successfully deleted": "Slot successfully deleted", + "Slot {number}": "Slot {number}", + "Slots saved successfully": "Slots saved successfully", + "Slots successfully added": "Slots successfully added", "Something went wrong. Please retry later": "Something went wrong. Please retry later", "Sound Set": "Sound Set", "Sound Sets": "Sound Sets", @@ -516,6 +532,7 @@ "Start time should be less than End time": "Start time should be less than End time", "Station name": "Station name", "Su": "Su", + "Subscriber": "Subscriber", "Subscriber Sign In": "Subscriber Sign In", "Sunday": "Sunday", "Super": "Super", @@ -604,6 +621,7 @@ "You are about to delete {name} sourceset": "You are about to delete {name} sourceset", "You are about to delete {name} timeset": "You are about to delete {name} timeset", "You are about to delete recording #{id}": "You are about to delete recording #{id}", + "You are about to delete slot {slot}": "You are about to delete slot {slot}", "You are about to delete time range \"{from} - {to}\"": "You are about to delete time range \"{from} - {to}\"", "You are about to delete {destination} from {groupName} call forwarding": "You are about to delete {destination} from {groupName} call forwarding", "You are about to delete {groupName} call forwarding group": "You are about to delete {groupName} call forwarding group", @@ -697,4 +715,4 @@ "{field} must have at most {maxLength} letters": "{field} must have at most {maxLength} letters", "{mode} of sources": "{mode} of sources", "{mode} own phone": "{mode} own phone" -} \ No newline at end of file +} diff --git a/src/i18n/es.json b/src/i18n/es.json index d20585a9..b65bdc52 100644 --- a/src/i18n/es.json +++ b/src/i18n/es.json @@ -12,6 +12,7 @@ "404 Not Found": "404 Not Encontrado", "A default subscriber sound set to be set before being able to select, in the Sound Sets page.": "Un conjunto de sonido de suscriptor predeterminado que se establecerá antes de poder seleccionar, en la página de Conjuntos de Sonido.", "ACL": "", + "ADD SLOT": "", "Abort": "Abortar", "Accepted email address to allow mail2fax transmission.": "", "Active": "", @@ -23,6 +24,7 @@ "Add Group": "Agregar grupo", "Add Number": "Agregar Número", "Add Seat": "Agregar asiento", + "Add Slots": "", "Add Sound Set": "Añadir Conjunto de Sonido", "Add Speed Dial": "Agregar marcado rápido", "Add Time": "Agregar tiempo", @@ -34,6 +36,7 @@ "Add forwarding": "", "Add new": "Añadir nuevo", "Add number": "Agregar número", + "Add slot": "", "Add source": "Agregar fuente", "Add time": "", "Add time range": "", @@ -94,6 +97,7 @@ "Audio + Video": "Audio + Video", "Audio Call": "Llamada de audio", "Audio Only": "Solo Audio", + "Auto-attendant": "", "Blacklist": "Lista Negra", "Block Incoming": "Bloquear Entrantes", "Block Incoming/Outgoing": "Bloquear Entrantes/Salientes", @@ -182,6 +186,7 @@ "Delete forwarding": "", "Delete from {groupName} forwarding": "", "Delete recording": "", + "Delete slot?": "", "Delete sourceset": "Eliminar el conjunto de fuentes", "Delete voicemail after email notification is delivered": "Eliminar el correo de voz después de enviar la notificación por correo electrónico", "Delete {groupName} forwarding group": "", @@ -196,6 +201,7 @@ "Destination Email": "", "Destination Number": "Número de destino", "Destination email to send the secret key renew notification to.": "", + "Destination must not be empty": "", "Destinations": "", "Devices": "Dispositivos", "Disable": "Desactivar", @@ -341,6 +347,7 @@ "No Voicemails found": "No se encontraron mensajes de voz", "No call goes to primary number": "", "No call queues created yet": "Aún no se han creado colas de llamadas", + "No data found": "", "No data to save. Please provide at least one time range.": "", "No destinations created yet": "", "No devices created yet": "Aún no se han creado dispositivos", @@ -390,6 +397,9 @@ "Play sound in loop": "Reproducir sonido en bucle", "Playing in loop": "Reproducir en bucle", "Please add a destination to the group before adding conditions": "", + "Please fill all the empty destinations": "", + "Please fill all the fields": "", + "Please fill or remove the empty slots": "", "Please select a valid timerange": "", "Please select an option": "", "Primary Number": "Número primario", @@ -500,6 +510,12 @@ "Show filters": "Mostrar filtros", "Sign In": "Iniciar sesión", "Slot": "Ranura", + "Slot added successfully": "", + "Slot edited successfully": "", + "Slot successfully deleted": "", + "Slot {number}": "", + "Slots saved successfully": "", + "Slots successfully added": "", "Something went wrong. Please retry later": "", "Sound Set": "Conjunto de sonido", "Sound Sets": "Conjuntos de Sonido", @@ -516,6 +532,7 @@ "Start time should be less than End time": "", "Station name": "Nombre de la estación", "Su": "", + "Subscriber": "", "Subscriber Sign In": "Iniciar sesión de suscriptor", "Sunday": "Domingo", "Super": "Super", @@ -604,6 +621,7 @@ "You are about to delete {name} sourceset": "", "You are about to delete {name} timeset": "", "You are about to delete recording #{id}": "", + "You are about to delete slot {slot}": "", "You are about to delete time range \"{from} - {to}\"": "", "You are about to delete {destination} from {groupName} call forwarding": "", "You are about to delete {groupName} call forwarding group": "", @@ -697,4 +715,4 @@ "{field} must have at most {maxLength} letters": "{field} debe tener como máximo {maxLength} letras", "{mode} of sources": "{mode} de fuentes", "{mode} own phone": "{mode} teléfono propio" -} \ No newline at end of file +} diff --git a/src/i18n/fr.json b/src/i18n/fr.json index c1d8c9bb..af6ec071 100644 --- a/src/i18n/fr.json +++ b/src/i18n/fr.json @@ -12,6 +12,7 @@ "404 Not Found": "Erreur 404", "A default subscriber sound set to be set before being able to select, in the Sound Sets page.": "", "ACL": "", + "ADD SLOT": "", "Abort": "Abandonner", "Accepted email address to allow mail2fax transmission.": "", "Active": "", @@ -23,6 +24,7 @@ "Add Group": "Ajouter un groupe", "Add Number": "Ajouter un numéro", "Add Seat": "Ajouter un siège", + "Add Slots": "", "Add Sound Set": "", "Add Speed Dial": "Ajouter un raccourci", "Add Time": "Ajouter une heure", @@ -34,6 +36,7 @@ "Add forwarding": "", "Add new": "En ajouter un nouveau", "Add number": "Ajouter un numéro", + "Add slot": "", "Add source": "Ajouter une source", "Add time": "", "Add time range": "", @@ -94,6 +97,7 @@ "Audio + Video": "Audio et vidéo", "Audio Call": "Appel audio", "Audio Only": "Audio seulement", + "Auto-attendant": "", "Blacklist": "Liste noire", "Block Incoming": "", "Block Incoming/Outgoing": "", @@ -182,6 +186,7 @@ "Delete forwarding": "", "Delete from {groupName} forwarding": "", "Delete recording": "", + "Delete slot?": "", "Delete sourceset": "Supprimer la liste de sources", "Delete voicemail after email notification is delivered": "Supprimer le message vocal une fois la notification e-mail délivrée", "Delete {groupName} forwarding group": "", @@ -196,6 +201,7 @@ "Destination Email": "", "Destination Number": "Numéro de destination", "Destination email to send the secret key renew notification to.": "", + "Destination must not be empty": "", "Destinations": "", "Devices": "Postes", "Disable": "Désactiver", @@ -341,6 +347,7 @@ "No Voicemails found": "Message vocaux introuvables", "No call goes to primary number": "", "No call queues created yet": "Aucune file d’attente de créée", + "No data found": "", "No data to save. Please provide at least one time range.": "", "No destinations created yet": "", "No devices created yet": "Aucun poste créé", @@ -390,6 +397,9 @@ "Play sound in loop": "", "Playing in loop": "", "Please add a destination to the group before adding conditions": "", + "Please fill all the empty destinations": "", + "Please fill all the fields": "", + "Please fill or remove the empty slots": "", "Please select a valid timerange": "", "Please select an option": "", "Primary Number": "Numéro principal", @@ -500,6 +510,12 @@ "Show filters": "Afficher les filtre", "Sign In": "Authentification", "Slot": "Emplacement", + "Slot added successfully": "", + "Slot edited successfully": "", + "Slot successfully deleted": "", + "Slot {number}": "", + "Slots saved successfully": "", + "Slots successfully added": "", "Something went wrong. Please retry later": "", "Sound Set": "", "Sound Sets": "", @@ -516,6 +532,7 @@ "Start time should be less than End time": "", "Station name": "Nom du poste", "Su": "", + "Subscriber": "", "Subscriber Sign In": "Authentification de l’abonné", "Sunday": "Dimanche", "Super": "Supérieur", @@ -604,6 +621,7 @@ "You are about to delete {name} sourceset": "", "You are about to delete {name} timeset": "", "You are about to delete recording #{id}": "", + "You are about to delete slot {slot}": "", "You are about to delete time range \"{from} - {to}\"": "", "You are about to delete {destination} from {groupName} call forwarding": "", "You are about to delete {groupName} call forwarding group": "", @@ -697,4 +715,4 @@ "{field} must have at most {maxLength} letters": "{field} doit avoir au maximum {maxLength} caractères", "{mode} of sources": "Sources {mode}", "{mode} own phone": "{mode} téléphone personnel" -} \ No newline at end of file +} diff --git a/src/i18n/it.json b/src/i18n/it.json index f67efb15..647d098a 100644 --- a/src/i18n/it.json +++ b/src/i18n/it.json @@ -12,6 +12,7 @@ "404 Not Found": "404 Not Found", "A default subscriber sound set to be set before being able to select, in the Sound Sets page.": "Un set di messaggi predefinito per gli utenti, disponibile prima che se ne possa selezionare uno nella pagina Set di Messaggi.", "ACL": "", + "ADD SLOT": "", "Abort": "Abbandona", "Accepted email address to allow mail2fax transmission.": "", "Active": "", @@ -23,6 +24,7 @@ "Add Group": "Aggiungi gruppo", "Add Number": "Aggiungi Numero", "Add Seat": "Aggiungi postazione", + "Add Slots": "", "Add Sound Set": "Aggiungi set messaggi", "Add Speed Dial": "Aggiungi Selezione Rapida", "Add Time": "Aggiungi orario", @@ -34,6 +36,7 @@ "Add forwarding": "", "Add new": "Aggiungi nuovo", "Add number": "Aggiungi numero", + "Add slot": "", "Add source": "Aggiungi ", "Add time": "", "Add time range": "", @@ -94,6 +97,7 @@ "Audio + Video": "Audio + Video", "Audio Call": "Chiamata Vocale", "Audio Only": "Solo Audio", + "Auto-attendant": "", "Blacklist": "Lista Nera", "Block Incoming": "Blocca Entranti", "Block Incoming/Outgoing": "Blocca Entranti/Uscenti", @@ -182,6 +186,7 @@ "Delete forwarding": "", "Delete from {groupName} forwarding": "", "Delete recording": "", + "Delete slot?": "", "Delete sourceset": "Cancella set pattern sorgente", "Delete voicemail after email notification is delivered": "Cancella il messaggio vocale dopo che l'email di notifica è stata inoltrata", "Delete {groupName} forwarding group": "", @@ -196,6 +201,7 @@ "Destination Email": "", "Destination Number": "Numero di Destinazione", "Destination email to send the secret key renew notification to.": "", + "Destination must not be empty": "", "Destinations": "", "Devices": "Dispositivi", "Disable": "Disabilita", @@ -341,6 +347,7 @@ "No Voicemails found": "Non è stato trovato nessun Messaggio Vocale", "No call goes to primary number": "", "No call queues created yet": "Nessuna coda creata", + "No data found": "", "No data to save. Please provide at least one time range.": "", "No destinations created yet": "", "No devices created yet": "Nessun dispositivo creato", @@ -390,6 +397,9 @@ "Play sound in loop": "Ripoduci il messaggio a ciclo continuo", "Playing in loop": "Ripoduci a ciclo continuo", "Please add a destination to the group before adding conditions": "", + "Please fill all the empty destinations": "", + "Please fill all the fields": "", + "Please fill or remove the empty slots": "", "Please select a valid timerange": "", "Please select an option": "", "Primary Number": "Numero Principale", @@ -500,6 +510,12 @@ "Show filters": "Mostra filtri", "Sign In": "Accedi", "Slot": "Posizione", + "Slot added successfully": "", + "Slot edited successfully": "", + "Slot successfully deleted": "", + "Slot {number}": "", + "Slots saved successfully": "", + "Slots successfully added": "", "Something went wrong. Please retry later": "", "Sound Set": "Set Messaggi", "Sound Sets": "Annunci", @@ -516,6 +532,7 @@ "Start time should be less than End time": "", "Station name": "Nome stazione", "Su": "", + "Subscriber": "", "Subscriber Sign In": "Accedi come utente", "Sunday": "Domenica", "Super": "Super", @@ -604,6 +621,7 @@ "You are about to delete {name} sourceset": "", "You are about to delete {name} timeset": "", "You are about to delete recording #{id}": "", + "You are about to delete slot {slot}": "", "You are about to delete time range \"{from} - {to}\"": "", "You are about to delete {destination} from {groupName} call forwarding": "", "You are about to delete {groupName} call forwarding group": "", @@ -697,4 +715,4 @@ "{field} must have at most {maxLength} letters": "Il campo {field} può contenere al massimo {maxLength} lettere", "{mode} of sources": "{mode} dei pattern sorgente", "{mode} own phone": "{mode} proprio telefono" -} \ No newline at end of file +} diff --git a/src/pages/CscPagePbxAutoAttendant.vue b/src/pages/CscPagePbxAutoAttendant.vue new file mode 100644 index 00000000..3c20af28 --- /dev/null +++ b/src/pages/CscPagePbxAutoAttendant.vue @@ -0,0 +1,212 @@ + + + + diff --git a/src/router/routes.js b/src/router/routes.js index a1f77a6d..2e70deb0 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -22,6 +22,7 @@ import CscPagePbxDevices from 'src/pages/CscPagePbxDevices' import CscPagePbxCallQueues from 'src/pages/CscPagePbxCallQueues' import CscPagePbxSoundSets from 'src/pages/CscPagePbxSoundSets' import CscPagePbxMsConfigs from 'src/pages/CscPagePbxMsConfigs' +import CscPagePbxAutoAttendant from 'src/pages/CscPagePbxAutoAttendant' import CscPagePbxSettings from 'src/pages/CscPagePbxSettings' import CscPageVoicebox from 'src/pages/CscPageVoicebox' import CscPageFaxSettings from 'src/pages/CscPageFaxSettings' @@ -190,6 +191,14 @@ export default function routes (app) { subtitle: i18n.t('Manager Secretary') } }, + { + path: 'pbx-configuration/auto-attendant', + component: CscPagePbxAutoAttendant, + meta: { + title: i18n.t('PBX Configuration'), + subtitle: i18n.t('Auto-attendant') + } + }, { path: 'voicebox', component: CscPageVoicebox, diff --git a/src/store/index.js b/src/store/index.js index fe2043ac..f1bea2af 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -21,6 +21,7 @@ import PbxDevicesModule from './pbx-devices' import PbxCallQueuesModule from './pbx-callqueues' import PbxSoundSetsModule from './pbx-soundsets' import PbxMsConfigsModule from './pbx-ms-configs' +import PbxAutoAttendants from './pbx-auto-attendants' import ReminderModule from './reminder' import SpeedDialModule from './speed-dial' @@ -76,7 +77,8 @@ export default function (/* { ssrContext } */) { pbxCallQueues: PbxCallQueuesModule, pbxSoundSets: PbxSoundSetsModule, pbxMsConfigs: PbxMsConfigsModule, - callForwarding: CallForwardingModule + callForwarding: CallForwardingModule, + pbxAutoAttendants: PbxAutoAttendants }, state: { diff --git a/src/store/pbx-auto-attendants.js b/src/store/pbx-auto-attendants.js new file mode 100644 index 00000000..09b9b45a --- /dev/null +++ b/src/store/pbx-auto-attendants.js @@ -0,0 +1,115 @@ +import { getAutoAttendants, editSubscriberSlots } from '../api/pbx-auto-attendants' +import { getSubscribers } from '../api/subscriber' +import { displayName } from 'src/filters/subscriber' +export default { + namespaced: true, + state: { + slots: [], + newSlots: [], + subscribers: [], + slotsNumbers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + getters: { + slots (state) { + return state.slots + }, + slotsNumbers (state) { + return state.slotsNumbers + }, + newSlots (state) { + return state.newSlots + }, + subscribers (state) { + return state.subscribers.map(subscriber => { + return { + label: displayName(subscriber), + value: subscriber.id + } + }) + } + }, + mutations: { + slots (state, data) { + state.slots = data + }, + newSlots (state, data) { + for (const slot of data) { + state.newSlots.push({ + subscriber_id: slot.subscriber_id, + slots: [] + }) + } + }, + subscriberSlots (state, data) { + const subscriberSlots = state.slots.filter(slot => slot.subscriber_id === data.subscriberId)[0] + subscriberSlots.slots = data.slots + }, + createNewSlot (state, data) { + const subscriberSlots = state.newSlots.filter(slot => slot.subscriber_id === data.subscriberId)[0] + subscriberSlots.slots.push({ + slot: data.slot, + destination: null + }) + }, + editNewSlot (state, data) { + const subscriberSlots = state.newSlots.filter(slot => slot.subscriber_id === data.subscriberId)[0] + subscriberSlots.slots[data.index].destination = data.destination + }, + deleteNewSlot (state, data) { + const subscriberSlots = state.newSlots.filter(slot => slot.subscriber_id === data.subscriberId)[0] + subscriberSlots.slots.splice(data.index, 1) + }, + resetNewSlots (state, subscriberId) { + const subscriberSlots = state.newSlots.filter(slot => slot.subscriber_id === subscriberId)[0] + subscriberSlots.slots.splice(0, subscriberSlots.slots.length) + }, + subscribers (state, subscribers) { + state.subscribers = subscribers + } + }, + actions: { + async fetchAutoAttendants (context, options) { + const autoAttendants = await getAutoAttendants(options) + context.commit('slots', autoAttendants._embedded['ngcp:autoattendants']) + context.commit('newSlots', autoAttendants._embedded['ngcp:autoattendants']) + return autoAttendants.total_count + }, + async fetchSubscribers (context, subscriberName) { + const subscribers = await getSubscribers({ + params: { + display_name: subscriberName || '*' + } + }) + context.commit('subscribers', subscribers.items) + }, + async updateSubscriberSlots (context, options) { + const slots = await editSubscriberSlots(options) + context.commit('subscriberSlots', { + subscriberId: options.subscriberId, + slots: slots + }) + }, + createNewSlot (context, options) { + context.commit('createNewSlot', { + subscriberId: options.subscriberId, + slot: options.slot + }) + }, + editNewSlot (context, options) { + context.commit('editNewSlot', { + subscriberId: options.subscriberId, + index: options.index, + destination: options.destination + }) + }, + deleteNewSlot (context, options) { + context.commit('deleteNewSlot', { + subscriberId: options.subscriberId, + index: options.index + }) + }, + resetAllNewSlots (context, subscriberId) { + context.commit('resetNewSlots', subscriberId) + } + } +}