From 9f0d2795e9d66db319d9aa8c6bbf55faa7a31e81 Mon Sep 17 00:00:00 2001 From: Hans-Peter Herzog Date: Mon, 1 Aug 2022 12:41:55 +0200 Subject: [PATCH] TT#177101 Issue - PBXConfiguration - PBXSeats - Show SoundSet name if selected Change-Id: I0e39018b5cb13c792e5efe1c04e2022eff33f493 --- .../pages/PbxConfiguration/CscPbxSeat.vue | 21 ++++++++++++++++++- src/store/pbx.js | 14 +++++-------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/components/pages/PbxConfiguration/CscPbxSeat.vue b/src/components/pages/PbxConfiguration/CscPbxSeat.vue index d1a186c1..981fc050 100644 --- a/src/components/pages/PbxConfiguration/CscPbxSeat.vue +++ b/src/components/pages/PbxConfiguration/CscPbxSeat.vue @@ -223,7 +223,7 @@ radio emit-value map-options - :options="soundSetOptions" + :options="internalSoundSetOptions" :label="$t('Sound Set')" :disable="loading" > @@ -391,6 +391,25 @@ export default { } else { return '' } + }, + internalSoundSetOptions () { + const items = [] + if (this.soundSet) { + items.push({ + label: this.soundSet.name, + value: this.soundSet.id + }) + } + if (_.isArray(this.soundSetOptions)) { + this.soundSetOptions.forEach((soundSet) => { + if (this.soundSet && this.soundSet.id !== soundSet.value) { + items.push(soundSet) + } else if (!this.soundSet) { + items.push(soundSet) + } + }) + } + return items } }, watch: { diff --git a/src/store/pbx.js b/src/store/pbx.js index 12aec9a2..7cd4bf4a 100644 --- a/src/store/pbx.js +++ b/src/store/pbx.js @@ -90,16 +90,12 @@ export default { }, getSoundSetOptions (state) { const options = [] - let defaultLabel = i18n.t('Default') + const defaultLabel = i18n.t('Default') state.soundSetList.forEach((soundSet) => { - if (soundSet.contract_default) { - defaultLabel = i18n.t('Default') + ' (' + soundSet.name + ')' - } else { - options.push({ - label: soundSet.name, - value: soundSet.id - }) - } + options.push({ + label: soundSet.name, + value: soundSet.id + }) }) options.unshift({ label: defaultLabel,