TT#177101 Issue - PBXConfiguration - PBXSeats - Show SoundSet name if selected

Change-Id: I0e39018b5cb13c792e5efe1c04e2022eff33f493
mr11.0
Hans-Peter Herzog 3 years ago
parent 0894dfe583
commit 9f0d2795e9

@ -223,7 +223,7 @@
radio radio
emit-value emit-value
map-options map-options
:options="soundSetOptions" :options="internalSoundSetOptions"
:label="$t('Sound Set')" :label="$t('Sound Set')"
:disable="loading" :disable="loading"
> >
@ -391,6 +391,25 @@ export default {
} else { } else {
return '' 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: { watch: {

@ -90,16 +90,12 @@ export default {
}, },
getSoundSetOptions (state) { getSoundSetOptions (state) {
const options = [] const options = []
let defaultLabel = i18n.t('Default') const defaultLabel = i18n.t('Default')
state.soundSetList.forEach((soundSet) => { state.soundSetList.forEach((soundSet) => {
if (soundSet.contract_default) {
defaultLabel = i18n.t('Default') + ' (' + soundSet.name + ')'
} else {
options.push({ options.push({
label: soundSet.name, label: soundSet.name,
value: soundSet.id value: soundSet.id
}) })
}
}) })
options.unshift({ options.unshift({
label: defaultLabel, label: defaultLabel,

Loading…
Cancel
Save