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
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: {

@ -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,

Loading…
Cancel
Save