Integrate loaded settings values into ui

Not yet done for single choice and multi choice, but getting there...
This commit is contained in:
Benedikt Kulmann
2020-05-07 07:42:50 +02:00
parent 8a6a06fcb8
commit e44654dc9d
21 changed files with 2416 additions and 1494 deletions
+10 -2
View File
@@ -5,6 +5,7 @@
</template>
<script>
import isNil from "lodash/isNil"
export default {
name: 'SettingBoolean',
props: {
@@ -15,6 +16,10 @@ export default {
setting: {
type: Object,
required: true
},
persistedValue: {
type: Object,
required: false
}
},
data() {
@@ -35,10 +40,13 @@ export default {
}
},
mounted() {
// TODO: load the settings value of the authenticated user and apply it to the value
if (this.value === null) {
if (!isNil(this.persistedValue)) {
this.value = this.persistedValue.boolValue
}
if (isNil(this.value) && !isNil(this.setting.boolValue.default)) {
this.value = this.setting.boolValue.default
}
this.initialValue = this.value
}
}
</script>