aboutsummaryrefslogtreecommitdiff
path: root/src/components/settings_modal/helpers/choice_setting.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/settings_modal/helpers/choice_setting.js')
-rw-r--r--src/components/settings_modal/helpers/choice_setting.js51
1 files changed, 10 insertions, 41 deletions
diff --git a/src/components/settings_modal/helpers/choice_setting.js b/src/components/settings_modal/helpers/choice_setting.js
index 3da559fe..8aa5f54b 100644
--- a/src/components/settings_modal/helpers/choice_setting.js
+++ b/src/components/settings_modal/helpers/choice_setting.js
@@ -1,51 +1,20 @@
-import { get, set } from 'lodash'
import Select from 'src/components/select/select.vue'
import ModifiedIndicator from './modified_indicator.vue'
-import ServerSideIndicator from './server_side_indicator.vue'
+import ProfileSettingIndicator from './profile_setting_indicator.vue'
+import Setting from './setting.js'
+
export default {
components: {
Select,
ModifiedIndicator,
- ServerSideIndicator
+ ProfileSettingIndicator
},
- props: [
- 'path',
- 'disabled',
- 'options',
- 'expert'
- ],
- computed: {
- pathDefault () {
- const [firstSegment, ...rest] = this.path.split('.')
- return [firstSegment + 'DefaultValue', ...rest].join('.')
- },
- state () {
- const value = get(this.$parent, this.path)
- if (value === undefined) {
- return this.defaultState
- } else {
- return value
- }
- },
- defaultState () {
- return get(this.$parent, this.pathDefault)
- },
- isServerSide () {
- return this.path.startsWith('serverSide_')
- },
- isChanged () {
- return !this.path.startsWith('serverSide_') && this.state !== this.defaultState
- },
- matchesExpertLevel () {
- return (this.expert || 0) <= this.$parent.expertLevel
- }
- },
- methods: {
- update (e) {
- set(this.$parent, this.path, e)
- },
- reset () {
- set(this.$parent, this.path, this.defaultState)
+ ...Setting,
+ props: {
+ ...Setting.props,
+ options: {
+ type: Array,
+ required: true
}
}
}