From 96c126aca34504ce3abdb843415884a84bd20db6 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Fri, 27 Aug 2021 09:55:48 +0100 Subject: [PATCH] Fixes #3712 - Core worflow perform action "select" should not make multiple values selectable. --- .../controllers/_ui_element/_application_selector.coffee | 8 ++++++-- .../controllers/_ui_element/core_workflow_perform.coffee | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_ui_element/_application_selector.coffee b/app/assets/javascripts/app/controllers/_ui_element/_application_selector.coffee index f39dd7eab..c13490d9b 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/_application_selector.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/_application_selector.coffee @@ -485,8 +485,7 @@ class App.UiElement.ApplicationSelector if attribute.value && attribute.value[groupAndAttribute] config['value'] = @buildValueConfigValue(elementFull, elementRow, groupAndAttribute, elements, meta, attribute) if 'multiple' of config - config.multiple = true - config.nulloption = false + config = @buildValueConfigMultiple(config, meta) if config.relation is 'User' config.multiple = false config.nulloption = false @@ -516,6 +515,11 @@ class App.UiElement.ApplicationSelector else elementRow.find('.js-value').removeClass('hide') + @buildValueConfigMultiple: (config, meta) -> + config.multiple = true + config.nulloption = false + return config + @humanText: (condition) -> none = App.i18n.translateContent('No filter.') return [none] if _.isEmpty(condition) diff --git a/app/assets/javascripts/app/controllers/_ui_element/core_workflow_perform.coffee b/app/assets/javascripts/app/controllers/_ui_element/core_workflow_perform.coffee index 51206c064..f0ec961b7 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/core_workflow_perform.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/core_workflow_perform.coffee @@ -125,6 +125,14 @@ class App.UiElement.core_workflow_perform extends App.UiElement.ApplicationSelec super(elementFull, elementRow, groupAndAttribute, elements, meta, attribute) + @buildValueConfigMultiple: (config, meta) -> + if _.contains(['add_option', 'remove_option', 'set_fixed_to'], meta.operator) + config.multiple = true + else + config.multiple = false + config.nulloption = false + return config + @HasPreCondition: -> return false