Show only JSON encoding strategy for multi value fields
This commit is contained in:
@@ -92,6 +92,11 @@ export default {
|
||||
required: true,
|
||||
},
|
||||
|
||||
isMulti: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
// default store-ident
|
||||
storeIdent: {
|
||||
type: String,
|
||||
@@ -121,17 +126,18 @@ export default {
|
||||
|
||||
// strategy before omit
|
||||
undoOmit: this.defaultStrategy,
|
||||
|
||||
// list of available strategies
|
||||
strategies: [
|
||||
{ value: types.Plain, text: this.$t('strategies.plain.label') },
|
||||
{ value: types.Alias, text: this.$t('strategies.alias.label') },
|
||||
{ value: types.JSON, text: this.$t('strategies.json.label') },
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
strategies () {
|
||||
return [
|
||||
{ value: types.Plain, text: this.$t('strategies.plain.label'), disabled: this.isMulti },
|
||||
{ value: types.Alias, text: this.$t('strategies.alias.label'), disabled: this.isMulti },
|
||||
{ value: types.JSON, text: this.$t('strategies.json.label') },
|
||||
].filter(({ disabled }) => !disabled)
|
||||
},
|
||||
|
||||
showIdentInput () {
|
||||
return [types.JSON, types.Alias, types.Plain].includes(this.strategy)
|
||||
},
|
||||
|
||||
@@ -35,11 +35,12 @@
|
||||
:description="$t('module-fields.description')"
|
||||
>
|
||||
<dal-field-store-encoding
|
||||
v-for="({ field, storeIdent, label }) in moduleFields"
|
||||
v-for="({ field, storeIdent, label, isMulti }) in moduleFields"
|
||||
:key="field"
|
||||
:config="moduleFieldEncoding[field] || {}"
|
||||
:field="field"
|
||||
:label="label"
|
||||
:is-multi="isMulti"
|
||||
:default-strategy="moduleFieldDefaultEncodingStrategy"
|
||||
:store-ident="storeIdent"
|
||||
@change="applyModuleFieldStrategyConfig(field, $event)"
|
||||
@@ -162,6 +163,7 @@ export default {
|
||||
field: f.name,
|
||||
label: f.label || f.name,
|
||||
storeIdent: f.name,
|
||||
isMulti: f.isMulti,
|
||||
}
|
||||
|
||||
// In case of a JSON encoding strategy, default to values
|
||||
|
||||
Reference in New Issue
Block a user