pleroma-fe/src/components/settings_modal/helpers/choice_setting.js

54 lines
1.1 KiB
JavaScript
Raw Normal View History

import Select from 'src/components/select/select.vue'
import Setting from './setting.js'
export default {
...Setting,
components: {
...Setting.components,
Select
},
props: {
...Setting.props,
overrideOptions: {
type: Boolean,
required: false
},
options: {
type: Array,
required: false
},
optionLabelMap: {
type: Object,
required: false,
default: {}
}
},
computed: {
...Setting.computed,
realOptions () {
if (this.overrideOptions) {
return this.options
}
2023-03-21 22:46:40 +02:00
if (this.realSource === 'admin') {
2025-12-03 12:19:20 +02:00
if (
!this.backendDescriptionSuggestions?.length ||
this.backendDescriptionSuggestions?.length === 0
) {
2025-11-28 02:02:39 +02:00
return this.options
}
return this.backendDescriptionSuggestions.map(x => ({
key: x,
value: x,
label: this.optionLabelMap[x] || x
}))
}
return this.options
}
},
methods: {
...Setting.methods,
getValue (e) {
return e
}
}
}