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
+12 -1
View File
@@ -20,6 +20,7 @@
</template>
<script>
import isNil from "lodash/isNil"
export default {
name: 'SettingString',
props: {
@@ -30,6 +31,10 @@ export default {
setting: {
type: Object,
required: true
},
persistedValue: {
type: Object,
required: false
}
},
data() {
@@ -54,7 +59,13 @@ export default {
}
},
mounted() {
// TODO: load the settings value of the authenticated user and apply it to the value
if (!isNil(this.persistedValue)) {
this.value = this.persistedValue.stringValue
}
if (isNil(this.value) && !isNil(this.setting.stringValue.default)) {
this.value = this.setting.stringValue.default
}
this.initialValue = this.value
}
}
</script>