From ef7e8649a5e97f7a14988d037f08351eefa6f986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Fri, 10 Feb 2023 12:06:26 +0100 Subject: [PATCH] Show only JSON encoding strategy for multi value fields --- .../Admin/Module/DalFieldStoreEncoding.vue | 20 ++++++++++++------- .../components/Admin/Module/DalSettings.vue | 4 +++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/client/web/compose/src/components/Admin/Module/DalFieldStoreEncoding.vue b/client/web/compose/src/components/Admin/Module/DalFieldStoreEncoding.vue index bc69bf17d8..73ec2a186f 100644 --- a/client/web/compose/src/components/Admin/Module/DalFieldStoreEncoding.vue +++ b/client/web/compose/src/components/Admin/Module/DalFieldStoreEncoding.vue @@ -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) }, diff --git a/client/web/compose/src/components/Admin/Module/DalSettings.vue b/client/web/compose/src/components/Admin/Module/DalSettings.vue index f3ef98da9d..4723342b99 100644 --- a/client/web/compose/src/components/Admin/Module/DalSettings.vue +++ b/client/web/compose/src/components/Admin/Module/DalSettings.vue @@ -35,11 +35,12 @@ :description="$t('module-fields.description')" >