diff --git a/src/api/conversations.js b/src/api/conversations.js index 1acb932d..71b45819 100644 --- a/src/api/conversations.js +++ b/src/api/conversations.js @@ -7,6 +7,7 @@ import { import { LIST_DEFAULT_ROWS, apiDownloadFile, + get, getList, httpApi } from 'src/api/common' @@ -140,6 +141,13 @@ export function getOutgoingBlocked (id) { }) } +export async function getVoicemail (voicemailId) { + return await get({ + resource: 'voicemails', + resourceId: voicemailId + }) +} + export async function deleteVoicemail (id) { const res = await httpApi.delete(`api/voicemails/${id}`) return res.status >= 200 diff --git a/src/components/CscDialogTranscript.vue b/src/components/CscDialogTranscript.vue new file mode 100644 index 00000000..aef98540 --- /dev/null +++ b/src/components/CscDialogTranscript.vue @@ -0,0 +1,69 @@ + + + + + + + + + + {{ text }} + + + {{ $t('No transcript available.') }} + + + + + + + diff --git a/src/components/pages/Conversations/CscConversationItem.vue b/src/components/pages/Conversations/CscConversationItem.vue index e6a89d85..9a5bdd8d 100644 --- a/src/components/pages/Conversations/CscConversationItem.vue +++ b/src/components/pages/Conversations/CscConversationItem.vue @@ -30,6 +30,7 @@ :block-both-label="blockBothLabel" :block-both-possible="unblockedBoth || blockedBoth" @download-voice-mail="downloadVoiceMail" + @get-voicemail-transcript="getVoicemailTranscript" @play-voice-mail="playVoiceMail" @start-call="startCall" @toggle-block-incoming="toggleBlockIncoming" @@ -71,6 +72,7 @@ export default { emits: [ 'download-fax', 'delete-voicemail', + 'get-voicemail-transcript', 'toggle-block-both', 'toggle-block-outgoing', 'toggle-block-incoming', @@ -133,6 +135,9 @@ export default { downloadVoiceMail (voiceMail) { this.$emit('download-voice-mail', voiceMail) }, + getVoicemailTranscript (voiceMail) { + this.$emit('get-voicemail-transcript', voiceMail) + }, playVoiceMail (voiceMail) { this.$emit('play-voice-mail', voiceMail) }, diff --git a/src/components/pages/Conversations/CscVoiceMailItem.vue b/src/components/pages/Conversations/CscVoiceMailItem.vue index 01485c5f..0430fb10 100644 --- a/src/components/pages/Conversations/CscVoiceMailItem.vue +++ b/src/components/pages/Conversations/CscVoiceMailItem.vue @@ -1,5 +1,13 @@ + + import CscAudioPlayer from 'components/CscAudioPlayer' +import CscDialogTranscript from 'components/CscDialogTranscript' import CscMoreMenu from 'components/CscMoreMenu' import CscPopupMenuItem from 'components/CscPopupMenuItem' import CscPopupMenuItemDelete from 'components/CscPopupMenuItemDelete' import CscPopupMenuItemStartCall from 'components/CscPopupMenuItemStartCall' import { showGlobalError } from 'src/helpers/ui' import { RequestState } from 'src/store/common' -import { mapGetters, mapState } from 'vuex' +import { mapActions, mapGetters, mapState } from 'vuex' export default { name: 'CscVoiceMailItem', @@ -101,7 +116,8 @@ export default { CscPopupMenuItemStartCall, CscPopupMenuItem, CscMoreMenu, - CscAudioPlayer + CscAudioPlayer, + CscDialogTranscript }, props: { voiceMail: { @@ -129,7 +145,16 @@ export default { default: false } }, - emits: ['delete-voicemail', 'toggle-block-both', 'toggle-block-outgoing', 'toggle-block-incoming', 'start-call', 'download-voice-mail', 'play-voice-mail'], + emits: [ + 'delete-voicemail', + 'toggle-block-both', + 'toggle-block-outgoing', + 'toggle-block-incoming', + 'start-call', + 'download-voice-mail', + 'play-voice-mail', + 'get-voicemail-transcript' + ], data () { return { platform: this.$q.platform.is @@ -144,12 +169,27 @@ export default { 'playVoiceMailErrors', 'playVoiceMailStates' ]), + ...mapGetters('transcriptions', [ + 'getTranscriptText', + 'getTranscriptStatus' + ]), + ...mapState('transcriptions', [ + 'transcriptState', + 'transcript', + 'transcriptError' + ]), direction () { if (this.voiceMail.direction === 'out') { return 'to' } return 'from' }, + isLoadingTranscript () { + return this.transcriptState === 'requesting' + }, + isTranscriptReady () { + return this.getTranscriptStatus === 'done' + }, voicemailCaller () { return this.voiceMail.caller_phonebook_name || this.voiceMail.caller }, @@ -163,6 +203,7 @@ export default { voiceMailLoaded () { return this.playVoiceMailState(this.voiceMail.id) === 'succeeded' } + }, watch: { playVoiceMailStates: { @@ -172,9 +213,17 @@ export default { showGlobalError(this.playVoiceMailErrors[this.voiceMail.id]) } } + }, + transcriptState (state) { + if (state === RequestState.failed) { + return showGlobalError(this.transcriptError) + } } }, methods: { + ...mapActions('transcriptions', [ + 'clearTranscriptData' + ]), playVoiceMail () { this.$emit('play-voice-mail', { id: this.voiceMail.id, @@ -189,6 +238,14 @@ export default { this.$refs.voicemailPlayer.setPlayingTrue() this.$refs.voicemailPlayer.setPausedFalse() }, + getVoicemailTranscript () { + this.$emit('get-voicemail-transcript', this.voiceMail.id) + this.$refs.transcriptDialog.show() + }, + hideTranscriptDialog () { + this.$refs.transcriptDialog.hide() + this.clearTranscriptData() + }, startCall () { this.$emit('start-call', this.voiceMail.callee) }, diff --git a/src/i18n/de.json b/src/i18n/de.json index 10d7acf5..e9a41965 100644 --- a/src/i18n/de.json +++ b/src/i18n/de.json @@ -44,10 +44,10 @@ "Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).": "Erlauben Sie „mail2fax“-E-Mails nur an diese IP (die IP oder der Hostname ist im \\\"Received\\\" vorhanden).", "Allowed extensions are between {min} and {max}": "Erlaubte Durchwahlen haben eine Länge zwischen {min} und {max} Zahlen", "Always": "Ständig", - "An error occured while trying to assign the speed dial slot. Please try again": "Kurzwahl-Eintrag konnte nicht zugewiesen werden. Bitte erneut versuchen", - "An error occured while trying to load the speed dials. Please try again": "Kurzwahlliste konnte nicht geladen werden. Bitte erneut versuchen", - "An error occured while trying to send the fax. Please try again": "Fax konnte nicht gesendet werden. Bitte erneut versuchen", - "An error occured while trying to unassign the speed dial slot. Please try again": "Kurzwahl-Eintrag konnte nicht geändert werden. Bitte erneut versuchen", + "An error occurred while trying to assign the speed dial slot. Please try again": "Kurzwahl-Eintrag konnte nicht zugewiesen werden. Bitte erneut versuchen", + "An error occurred while trying to load the speed dials. Please try again": "Kurzwahlliste konnte nicht geladen werden. Bitte erneut versuchen", + "An error occurred while trying to send the fax. Please try again": "Fax konnte nicht gesendet werden. Bitte erneut versuchen", + "An error occurred while trying to unassign the speed dial slot. Please try again": "Kurzwahl-Eintrag konnte nicht geändert werden. Bitte erneut versuchen", "An error occurred:": "Ein Fehler ist aufgetreten:", "Application": "Anwendung", "Apps": "Apps", @@ -283,6 +283,7 @@ "Join conference with name": "Mit Namen der Konferenz beitreten", "July": "Juli", "June": "Juni", + "Label": "Etikett", "Lamp/Key": "Lampe/Taste", "Lamps/Keys": "Lampen/Tasten", "Language": "Sprache", @@ -357,6 +358,7 @@ "No seats created yet": "Noch keine Nebenstellen erstellt", "No sound sets created yet": "Noch keine Soundsets erstellt", "No speed dials found": "Keine Kurzwahlen gefunden", + "No transcript available.": "Kein Transkript verfügbar.", "Normal": "Normal", "Not modified yet": "Noch nicht geändert", "November": "November", @@ -556,6 +558,7 @@ "Timerange": "Zeitraum", "To": "An", "Today": "Heute", + "Transcript": "Transkript", "Transfer": "Weiterleiten", "Tu": "Di", "Tuesday": "Dienstag", diff --git a/src/i18n/en.json b/src/i18n/en.json index d6626a5c..a4b8e711 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -277,6 +277,7 @@ "January": "January", "July": "July", "June": "June", + "Label": "Label", "Lamp/Key": "Lamp/Key", "Lamps/Keys": "Lamps/Keys", "Language": "Language", @@ -343,6 +344,7 @@ "No seats created yet": "No seats created yet", "No sound sets created yet": "No sound sets created yet", "No speed dials found": "No speed dials found", + "No transcript available.": "No transcript available.", "Normal": "Normal", "Not modified yet": "Not modified yet", "November": "November", @@ -539,6 +541,7 @@ "Timerange": "Timerange", "To": "To", "Today": "Today", + "Transcript": "Transcript", "Transfer": "Transfer", "Tu": "Tu", "Tuesday": "Tuesday", diff --git a/src/i18n/es.json b/src/i18n/es.json index 31c8fc8c..7079661b 100644 --- a/src/i18n/es.json +++ b/src/i18n/es.json @@ -44,10 +44,10 @@ "Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).": "Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).", "Allowed extensions are between {min} and {max}": "Las extensiones permitidas están entre {min} y {max}", "Always": "Siempre", - "An error occured while trying to assign the speed dial slot. Please try again": "Ocurrió un error al intentar asignar la ranura de marcación rápida. Por favor, inténtelo nuevamente.", - "An error occured while trying to load the speed dials. Please try again": "Se produjo un error al intentar cargar las marcaciones rápidas. Por favor, inténtelo nuevamente.", - "An error occured while trying to send the fax. Please try again": "Se produjo un error al intentar enviar el fax. Por favor, inténtelo nuevamente.", - "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.", + "An error occurred while trying to assign the speed dial slot. Please try again": "Ocurrió un error al intentar asignar la ranura de marcación rápida. Por favor, inténtelo nuevamente.", + "An error occurred while trying to load the speed dials. Please try again": "Se produjo un error al intentar cargar las marcaciones rápidas. Por favor, inténtelo nuevamente.", + "An error occurred while trying to send the fax. Please try again": "Se produjo un error al intentar enviar el fax. Por favor, inténtelo nuevamente.", + "An error occurred 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.", "An error occurred:": "Ocurrió un error:", "Application": "Aplicación", "Apps": "Aplicaciones", @@ -283,6 +283,7 @@ "Join conference with name": "Unirse a la conferencia con nombre", "July": "Julio", "June": "Junio", + "Label": "Etiqueta", "Lamp/Key": "Indicador/Tecla", "Lamps/Keys": "Indicadores/Teclas", "Language": "Idioma", @@ -356,6 +357,7 @@ "No seats created yet": "Aún no se han creado asientos", "No sound sets created yet": "Aún no se han creado conjuntos de sonido", "No speed dials found": "No se encontraron marcaciones rápidas", + "No transcript available.": "No hay transcripción disponible.", "Normal": "Normal", "Not modified yet": "No se ha modificado todavía", "November": "Noviembre", @@ -557,6 +559,7 @@ "Timerange": "Rango de tiempo", "To": "Para", "Today": "Hoy", + "Transcript": "Transcripción", "Transfer": "Transfer", "Tu": "Tu", "Tuesday": "Martes", diff --git a/src/i18n/fr.json b/src/i18n/fr.json index e30e5174..dce24ab9 100644 --- a/src/i18n/fr.json +++ b/src/i18n/fr.json @@ -44,10 +44,10 @@ "Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).": "Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).", "Allowed extensions are between {min} and {max}": "Les extensions autorisées sont comprises entre {min} et {max}", "Always": "Toujours", - "An error occured while trying to assign the speed dial slot. Please try again": "Une erreur s'est produite lors de la tentative d'attribution de l'emplacement de numérotation abrégée. Veuillez réessayer", - "An error occured while trying to load the speed dials. Please try again": "Une erreur s'est produite lors du chargement des numéros abrégés. Veuillez réessayer", - "An error occured while trying to send the fax. Please try again": "Une erreur est survenue lors de l’envoi du Fax. Veuillez réessayer", - "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", + "An error occurred while trying to assign the speed dial slot. Please try again": "Une erreur s'est produite lors de la tentative d'attribution de l'emplacement de numérotation abrégée. Veuillez réessayer", + "An error occurred while trying to load the speed dials. Please try again": "Une erreur s'est produite lors du chargement des numéros abrégés. Veuillez réessayer", + "An error occurred while trying to send the fax. Please try again": "Une erreur est survenue lors de l’envoi du Fax. Veuillez réessayer", + "An error occurred 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", "An error occurred:": "Une erreur s’est produite:", "Application": "Application", "Apps": "Apps", @@ -283,6 +283,7 @@ "Join conference with name": "Rejoindre la conférence avec le nom", "July": "Juillet", "June": "Juin", + "Label": "Étiquette", "Lamp/Key": "Lampe/clé", "Lamps/Keys": "Lampes/clés", "Language": "Langue", @@ -357,6 +358,7 @@ "No seats created yet": "Aucun siège n'a encore été créé", "No sound sets created yet": "Aucun jeu de sons n'a encore été créé", "No speed dials found": "Aucun numéro abrégé trouvé", + "No transcript available.": "Aucune transcription disponible.", "Normal": "Normal", "Not modified yet": "Pas encore modifié", "November": "Novembre", @@ -556,6 +558,7 @@ "Timerange": "Période", "To": "À", "Today": "Aujourd'hui", + "Transcript": "Transcription", "Transfer": "Transférer", "Tu": "Ma", "Tuesday": "Mardi", diff --git a/src/i18n/it.json b/src/i18n/it.json index 30ac9b76..1291c60a 100644 --- a/src/i18n/it.json +++ b/src/i18n/it.json @@ -43,10 +43,10 @@ "Allow mail2fax emails only to this IP (the IP or hostname is present in the \\\"Received\\\" header).": "Consenti email mail2fax solo da questo IP (l'IP o il nome host è presente nell'intestazione \\\"Received\\\").", "Allowed extensions are between {min} and {max}": "Le estensioni consentite sono tra {min} e {max}", "Always": "Sempre", - "An error occured while trying to assign the speed dial slot. Please try again": "Si è verificato un errore durante l'assegnazione dello slot di chiamata rapida. Si prega di riprovare", - "An error occured while trying to load the speed dials. Please try again": "Si è verificato un errore durante il caricamento delle chiamate rapide. Si prega di riprovare", - "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", + "An error occurred while trying to assign the speed dial slot. Please try again": "Si è verificato un errore durante l'assegnazione dello slot di chiamata rapida. Si prega di riprovare", + "An error occurred while trying to load the speed dials. Please try again": "Si è verificato un errore durante il caricamento delle chiamate rapide. Si prega di riprovare", + "An error occurred while trying to send the fax. Please try again": "Si è verificato un errore durante l'invio del fax. Si prega di riprovare", + "An error occurred while trying to unassign the speed dial slot. Please try again": "Si è verificato un errore nella cancellazione della selezione rapida. Si prega di riprovare", "An error occurred:": "Si è verificato un errore:", "Apps": "App", "April": "Aprile", @@ -279,6 +279,7 @@ "Join conference with name": "Partecipa alla conferenza con nome", "July": "Luglio", "June": "Giugno", + "Label": "Etichetta", "Lamp/Key": "Lampada/Tasto", "Lamps/Keys": "Lampade/Tasti", "Language": "Lingua", @@ -350,6 +351,7 @@ "No seats created yet": "Nessuna postazione creata", "No sound sets created yet": "Non è stato creato alcun set di suoni", "No speed dials found": "Nessuna impostazione di chiamata rapida", + "No transcript available.": "Nessuna trascrizione disponibile.", "Normal": "Normale", "Not modified yet": "Non ancora modificato", "November": "Novembre", @@ -548,6 +550,7 @@ "Timerange": "Intervallo di tempo", "To": "A", "Today": "Oggi", + "Transcript": "Trascrizione", "Transfer": "Trasferisci", "Tu": "Ma", "Tuesday": "Martedì", diff --git a/src/pages/CscPageCallRecording.vue b/src/pages/CscPageCallRecording.vue index 256fd973..ddeee04a 100644 --- a/src/pages/CscPageCallRecording.vue +++ b/src/pages/CscPageCallRecording.vue @@ -3,6 +3,14 @@ + @@ -138,6 +146,15 @@ + import CscAudioPlayer from 'components/CscAudioPlayer' +import CscDialogTranscript from 'components/CscDialogTranscript' import CscPageSticky from 'components/CscPageSticky' import CscRemoveDialog from 'components/CscRemoveDialog' import CscCallRecordingFilters from 'components/pages/CallRecording/CscCallRecordingFilters' @@ -179,13 +197,14 @@ import moment from 'moment' import { LIST_DEFAULT_ROWS } from 'src/api/common' import { showGlobalError, showToast } from 'src/helpers/ui' import { mapWaitingActions } from 'vue-wait' -import { mapGetters } from 'vuex' +import { mapActions, mapGetters, mapState } from 'vuex' export default { name: 'CscPageCallRecording', components: { CscAudioPlayer, CscPageSticky, - CscCallRecordingFilters + CscCallRecordingFilters, + CscDialogTranscript }, data () { return { @@ -274,7 +293,22 @@ export default { computed: { ...mapGetters('callRecordings', [ 'recordings' - ]) + ]), + ...mapGetters('transcriptions', [ + 'getTranscriptText', + 'getTranscriptStatus' + ]), + ...mapState('transcriptions', [ + 'transcriptState', + 'transcript', + 'transcriptError' + ]), + isLoadingTranscript () { + return this.transcriptState === 'requesting' + }, + isTranscriptReady () { + return this.getTranscriptStatus === 'done' + } }, watch: { recordings () { @@ -318,6 +352,10 @@ export default { playStreamFile: 'csc-call-recordings', fetchFile: 'csc-call-recordings' }), + ...mapActions('transcriptions', [ + 'clearTranscriptData', + 'getCallRecordingsTranscript' + ]), ...mapGetters('user', [ 'getSubscriber' ]), @@ -370,6 +408,17 @@ export default { showGlobalError(this.$t('Something went wrong. Please retry later')) } }, + getTranscript (data) { + this.getCallRecordingsTranscript({ + transcript: data.transcript, + transcriptStatus: data.transcript_status + }) + this.$refs.transcriptDialog.show() + }, + hideTranscriptDialog () { + this.$refs.transcriptDialog.hide() + this.clearTranscriptData() + }, isRowExpanded (id) { const rowStatus = this.rowStatus.filter((row) => row.id === id)[0] || null return rowStatus && rowStatus.expanded @@ -416,7 +465,7 @@ export default { .table-td-no-padding padding: 0px !important // needed to override .q-table td .table-td-action-cont - min-width: 140px + min-width: 170px .player-btns bottom: 9px left: 8px diff --git a/src/pages/CscPageConversations.vue b/src/pages/CscPageConversations.vue index 65ecab41..0b3af056 100644 --- a/src/pages/CscPageConversations.vue +++ b/src/pages/CscPageConversations.vue @@ -64,6 +64,7 @@ :blocked-incoming="blockedIncoming(item)" :blocked-outgoing="blockedOutgoing(item)" @start-call="startCall" + @get-voicemail-transcript="getVoicemailTranscription" @download-fax="downloadFax" @download-voice-mail="downloadVoiceMail" @play-voice-mail="playVoiceMail" @@ -294,11 +295,15 @@ export default { ...mapWaitingActions('conversations', { nextPage: 'csc-conversations', deleteVoicemail: 'csc-conversations', + getVoicemailTranscript: 'csc-conversations', toggleBlockIncoming: 'csc-conversations', toggleBlockOutgoing: 'csc-conversations', toggleBlockBoth: 'csc-conversations', deleteFax: 'csc-conversations' }), + ...mapWaitingActions('transcriptions', { + getVoicemailTranscript: 'csc-transcriptions' + }), ...mapMutations('conversations', [ 'resetList' ]), @@ -427,6 +432,9 @@ export default { this.filterDirection = filter this.forceReload() }, + async getVoicemailTranscription (voicemailId) { + await this.getVoicemailTranscript(voicemailId) + }, addToPhonebookAction (number) { this.$store.commit('user/setPhonebookNumber', number) this.$router.push('subscriber-phonebook/create') diff --git a/src/store/index.js b/src/store/index.js index 3b2c68a2..e054b75c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -20,6 +20,7 @@ import PbxSeatsModule from 'src/store/pbx-seats' import PbxSoundSetsModule from 'src/store/pbx-soundsets' import ReminderModule from 'src/store/reminder' import SpeedDialModule from 'src/store/speed-dial' +import TranscriptionsModule from 'src/store/transcriptions' import UserModule from 'src/store/user' import VoiceboxModule from 'src/store/voicebox' import { createStore } from 'vuex' @@ -57,7 +58,8 @@ export default function (/* { ssrContext } */) { callForwarding: CallForwardingModule, pbxAutoAttendants: PbxAutoAttendants, dashboard: DashboardModule, - customer: Customer + customer: Customer, + transcriptions: TranscriptionsModule }, state: { route: null diff --git a/src/store/speed-dial.js b/src/store/speed-dial.js index ad24b9bb..7dba985d 100644 --- a/src/store/speed-dial.js +++ b/src/store/speed-dial.js @@ -39,13 +39,13 @@ export default { return state.speedDialLoadingState }, speedDialLoadingError (state) { - return state.speedDialLoadingError || i18n.global.t('An error occured while trying to load the speed dials. Please try again') + return state.speedDialLoadingError || i18n.global.t('An error occurred while trying to load the speed dials. Please try again') }, unassignSlotState (state) { return state.unassignSlotState }, unassignSlotError (state) { - return state.unassignSlotError || i18n.global.t('An error occured while trying to unassign the speed dial slot. Please try again') + return state.unassignSlotError || i18n.global.t('An error occurred while trying to unassign the speed dial slot. Please try again') }, lastUnassignedSlot (state) { return state.lastUnassignedSlot @@ -59,7 +59,7 @@ export default { return state.assignSlotState }, assignSlotError (state) { - return state.assignSlotError || i18n.global.t('An error occured while trying to assign the speed dial slot. Please try again') + return state.assignSlotError || i18n.global.t('An error occurred while trying to assign the speed dial slot. Please try again') }, lastAssignedSlot (state) { return state.lastAssignedSlot diff --git a/src/store/transcriptions.js b/src/store/transcriptions.js new file mode 100644 index 00000000..48f4c3aa --- /dev/null +++ b/src/store/transcriptions.js @@ -0,0 +1,63 @@ +import { getVoicemail } from 'src/api/conversations' +import { RequestState } from 'src/store/common' + +export default { + namespaced: true, + state: { + transcriptState: RequestState.initiated, + transcriptError: null, + transcript: null + }, + getters: { + getTranscriptText (state) { + return state.transcript?.transcript + }, + getTranscriptStatus (state) { + return state.transcript?.transcriptStatus + } + }, + mutations: { + transcriptRequesting (state) { + state.transcriptState = RequestState.requesting + }, + transcriptSucceeded (state, { transcript, transcriptStatus }) { + state.transcriptState = RequestState.succeeded + state.transcript = { + transcript, + transcriptStatus + } + }, + transcriptFailed (state, error) { + state.transcriptState = RequestState.failed + state.transcriptError = error + }, + clearTranscriptData (state) { + state.transcriptState = RequestState.initiated + state.transcriptError = null + state.transcript = null + } + }, + actions: { + getVoicemailTranscript (context, voicemailId) { + context.commit('transcriptRequesting') + getVoicemail(voicemailId).then((data) => { + context.commit('transcriptSucceeded', { + transcript: data.transcript, + transcriptStatus: data.transcript_status + }) + }).catch((err) => { + context.commit('transcriptFailed', err.message) + }) + }, + getCallRecordingsTranscript (context, data) { + context.commit('transcriptSucceeded', { + transcript: data.transcript, + transcriptStatus: data.transcriptStatus + }) + }, + clearTranscriptData (context) { + context.commit('clearTranscriptData') + } + + } +}
+ {{ text }} +
+ {{ $t('No transcript available.') }} +