Add multi choice list support and fix single choice list

single choice list now
- uses raw radio input instead of the one from ODS because it's broken
- implements default value selection if no value is set
This commit is contained in:
Benedikt Kulmann
2020-04-23 19:49:40 +02:00
parent 48f79ad03f
commit ac67fee09a
11 changed files with 210 additions and 80 deletions

View File

File diff suppressed because one or more lines are too long

View File

@@ -750,7 +750,7 @@ type ListOption struct {
// *ListOption_StringValue
// *ListOption_IntValue
Option isListOption_Option `protobuf_oneof:"option"`
Selected bool `protobuf:"varint,3,opt,name=selected,proto3" json:"selected,omitempty"`
Default bool `protobuf:"varint,3,opt,name=default,proto3" json:"default,omitempty"`
DisplayValue string `protobuf:"bytes,4,opt,name=display_value,json=displayValue,proto3" json:"display_value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@@ -819,9 +819,9 @@ func (m *ListOption) GetIntValue() int64 {
return 0
}
func (m *ListOption) GetSelected() bool {
func (m *ListOption) GetDefault() bool {
if m != nil {
return m.Selected
return m.Default
}
return false
}
@@ -863,68 +863,67 @@ func init() {
}
var fileDescriptor_6c7cab62fa432213 = []byte{
// 994 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x5b, 0x6f, 0x1b, 0x45,
0x14, 0xee, 0xda, 0xb9, 0xd8, 0x27, 0xcd, 0x6d, 0x1a, 0xa8, 0x71, 0x13, 0x70, 0x36, 0x2f, 0x34,
0x10, 0x6f, 0x48, 0x9e, 0x88, 0x54, 0xd4, 0x26, 0x84, 0xa4, 0x90, 0x94, 0x6a, 0x23, 0xf1, 0x00,
0x02, 0x6b, 0xbc, 0x1e, 0xec, 0xa1, 0xb3, 0x33, 0xdb, 0x9d, 0xd9, 0x5c, 0x14, 0x55, 0x02, 0x5e,
0x78, 0x44, 0x82, 0x47, 0xde, 0x90, 0x78, 0x03, 0xfe, 0x0c, 0x7f, 0x81, 0x1f, 0x82, 0xf6, 0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xb2, 0xbf, 0x11, 0x9c, 0x75, 0xae,
0x45, 0xa2, 0x23, 0xa8, 0x7e, 0x48, 0xce, 0x89, 0xcf, 0x43, 0x12, 0x35, 0x4f, 0x31, 0x8b, 0xb1,
0x8f, 0xf6, 0x92, 0xfa, 0x1d, 0x7b, 0x54, 0xb3, 0xa5, 0x7d, 0x50, 0x6e, 0x8f, 0xda, 0x22, 0x94,
0x91, 0xee, 0xc8, 0xc8, 0xe7, 0xe9, 0x0f, 0x5e, 0x6f, 0x49, 0x3d, 0xf6, 0xfe, 0x09, 0x00, 0x00,
0xff, 0xff, 0xc7, 0xed, 0x58, 0x58, 0x00, 0x0a, 0x00, 0x00,
}

View File

@@ -130,6 +130,6 @@ message ListOption {
string string_value = 1;
int64 int_value = 2;
}
bool selected = 3;
bool default = 3;
string display_value = 4;
}

View File

@@ -193,7 +193,7 @@
"type": "string",
"format": "int64"
},
"selected": {
"default": {
"type": "boolean",
"format": "boolean"
},

View File

@@ -9,6 +9,7 @@
<div class="uk-position-relative"
:is="getSettingComponent(setting)"
:id="getElementId(bundle, setting)"
:bundle="bundle"
:setting="setting"
/>
</div>
@@ -18,6 +19,7 @@
<script>
import SettingBoolean from "./settings/SettingBoolean.vue";
import SettingMultiChoice from "./settings/SettingMultiChoice.vue";
import SettingNumber from "./settings/SettingNumber.vue";
import SettingSingleChoice from "./settings/SettingSingleChoice.vue";
import SettingString from "./settings/SettingString.vue";
@@ -41,6 +43,7 @@ export default {
},
components: {
SettingBoolean,
SettingMultiChoice,
SettingNumber,
SettingSingleChoice,
SettingString,

View File

@@ -8,6 +8,10 @@
export default {
name: 'SettingBoolean',
props: {
bundle: {
type: Object,
required: true
},
setting: {
type: Object,
required: true

View File

@@ -0,0 +1,86 @@
<template>
<div>
<oc-button :id="buttonElementId" class="uk-width-expand">
<span v-if="selectedOptions !== null && selectedOptions.length > 0">
{{ selectedOptionsDisplayValues }}
</span>
<span v-else>
{{ setting.placeholder || $gettext('Please select') }}
</span>
</oc-button>
<oc-drop
:drop-id="dropElementId"
:toggle="`#${buttonElementId}`"
mode="click"
:options="{ offset: 0, delayHide: 0, flip: false }"
>
<ul class="uk-list">
<li
v-for="(option, index) in setting.multiChoiceValue.options"
:key="getOptionElementId(index)"
>
<label :for="getOptionElementId(index)">
<input
:id="getOptionElementId(index)"
type="checkbox"
class="oc-checkbox"
:value="option"
v-model="selectedOptions"
@input="onSelectedOption"
/>
{{ option.displayValue }}
</label>
</li>
</ul>
</oc-drop>
</div>
</template>
<script>
export default {
name: 'SettingMultiChoice',
props: {
bundle: {
type: Object,
required: true
},
setting: {
type: Object,
required: true
}
},
data() {
return {
selectedOptions: null
}
},
computed: {
selectedOptionsDisplayValues() {
return Array.from(this.selectedOptions).map(option => option.displayValue).join(', ')
},
dropElementId() {
return `multi-choice-drop-${this.bundle.key}-${this.setting.key}`
},
buttonElementId() {
return `multi-choice-toggle-${this.bundle.key}-${this.setting.key}`
},
},
methods: {
getOptionElementId(index) {
return `${this.bundle.key}-${this.setting.key}-${index}`
},
onSelectedOption() {
// TODO: propagate selection to parent
// TODO: show a spinner while the request for saving the value is running!
}
},
mounted() {
this.selectedOptions = null
// TODO: load the settings value of the authenticated user and set it in `selectedOptions`
// if not set, yet, apply defaults from settings bundle definition
if (this.selectedOptions === null) {
this.selectedOptions = this.setting.multiChoiceValue.options.filter(option => option.default)
}
}
}
</script>

View File

@@ -25,6 +25,10 @@
export default {
name: 'SettingNumber',
props: {
bundle: {
type: Object,
required: true
},
setting: {
type: Object,
required: true

View File

@@ -9,15 +9,27 @@
</span>
</oc-button>
<oc-drop
close-on-click
:drop-id="dropElementId"
:toggle="`#${buttonElementId}`"
mode="click"
:options="{ offset: 0, delayHide: 0, flip: false }"
>
<ul class="uk-list">
<li v-for="(option, index) in setting.singleChoiceValue.options" :key="`${setting.key}-${index}`">
<oc-radio :label="option.displayValue" :value="selectedOption" @input="setSelectedOption(option)" />
<li
v-for="(option, index) in setting.singleChoiceValue.options"
:key="getOptionElementId(index)"
>
<label :for="getOptionElementId(index)">
<input
:id="getOptionElementId(index)"
type="radio"
class="oc-radiobutton"
v-model="selectedOption"
:value="option"
@input="onSelectedOption"
/>
{{ option.displayValue }}
</label>
</li>
</ul>
</oc-drop>
@@ -28,6 +40,10 @@
export default {
name: 'SettingSingleChoice',
props: {
bundle: {
type: Object,
required: true
},
setting: {
type: Object,
required: true
@@ -40,21 +56,31 @@ export default {
},
computed: {
dropElementId() {
return `single-choice-drop-${this.setting.key}`
return `single-choice-drop-${this.bundle.key}-${this.setting.key}`
},
buttonElementId() {
return `single-choice-toggle-${this.setting.key}`
return `single-choice-toggle-${this.bundle.key}-${this.setting.key}`
},
},
methods: {
setSelectedOption(option) {
this.selectedOption = option
getOptionElementId(index) {
return `${this.bundle.key}-${this.setting.key}-${index}`
},
onSelectedOption() {
// TODO: propagate selection to parent
// TODO: show a spinner while the request for saving the value is running!
}
},
mounted() {
// TODO: load the settings value of the authenticated user and set it in `selected`
this.selectedOption = null
// TODO: load the settings value of the authenticated user and set it in `selectedOption`
// if not set, yet, apply default from settings bundle definition
if (this.selectedOption === null) {
const defaults = this.setting.singleChoiceValue.options.filter(option => option.default)
if (defaults.length === 1) {
this.selectedOption = defaults[0]
}
}
}
}
</script>

View File

@@ -23,6 +23,10 @@
export default {
name: 'SettingString',
props: {
bundle: {
type: Object,
required: true
},
setting: {
type: Object,
required: true

View File

@@ -8,6 +8,10 @@
export default {
name: 'SettingUnknown',
props: {
bundle: {
type: Object,
required: true
},
setting: {
type: Object,
required: true