From 17008e6d01379efa3f4a236e13bffd6ba9e4b8c4 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Tue, 24 Sep 2024 10:04:20 +0200 Subject: [PATCH 1/4] Support textarea widget for multifield (array) properties --- .../angularjs-partials/multifield.html | 27 ++++++++++++++++--- .../propertyInputTextarea.html | 2 ++ .../js/widgets/multifield.directive.js | 6 +++++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/bundle/src/main/resources/angularjs-partials/multifield.html b/bundle/src/main/resources/angularjs-partials/multifield.html index 696a84bd..951f0e33 100644 --- a/bundle/src/main/resources/angularjs-partials/multifield.html +++ b/bundle/src/main/resources/angularjs-partials/multifield.html @@ -34,8 +34,14 @@ ng-model="effectiveValue.value" /> + @@ -57,8 +63,14 @@ ng-model="value.value" /> + @@ -81,8 +93,15 @@
- +
diff --git a/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/multifield.directive.js b/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/multifield.directive.js index e4e5f2a0..e7e0aa7c 100644 --- a/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/multifield.directive.js +++ b/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/multifield.directive.js @@ -55,6 +55,12 @@ scope.validation = props.validation; scope.validationMessage = props.validationMessage ? Granite.I18n.get(props.validationMessage) : undefined; + // special handling for textarea + if (props.widgetType === "textarea") { + scope.type = "textarea"; + scope.textareaRows = props.textareaRows; + } + setValueArray(scope.property.effectiveValue, scope.effectiveValues); setValueArray(scope.property.value, scope.values); From fc102783e5c63d97811d48f16c53795b8889ff01 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Tue, 24 Sep 2024 10:05:07 +0200 Subject: [PATCH 2/4] update changelog --- changes.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changes.xml b/changes.xml index 440fbd8b..79ab7932 100644 --- a/changes.xml +++ b/changes.xml @@ -23,6 +23,12 @@ xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd"> + + + Support textarea widget for multifield (array) properties. + + + Dropdown widget with multiple values: Preserve order of selected items when displaying configuration. From e4e4bce9ca89f6be284e0893e59bc41149d1713c Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Tue, 24 Sep 2024 10:07:54 +0200 Subject: [PATCH 3/4] unify indentation --- .../angularjs-partials/multifield.html | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/bundle/src/main/resources/angularjs-partials/multifield.html b/bundle/src/main/resources/angularjs-partials/multifield.html index 951f0e33..ebcb1a6d 100644 --- a/bundle/src/main/resources/angularjs-partials/multifield.html +++ b/bundle/src/main/resources/angularjs-partials/multifield.html @@ -35,11 +35,11 @@ + bo-if="type==='textarea'" + disabled + readonly + ng-attr-rows="{{textareaRows}}" + ng-model="effectiveValue.value"> + bo-if="type==='textarea'" + disabled + readonly + ng-attr-rows="{{textareaRows}}" + ng-model="value.value">
- - + Date: Tue, 24 Sep 2024 10:17:18 +0200 Subject: [PATCH 4/4] unify code layout --- bundle/src/main/resources/angularjs-partials/multifield.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundle/src/main/resources/angularjs-partials/multifield.html b/bundle/src/main/resources/angularjs-partials/multifield.html index ebcb1a6d..9a540c51 100644 --- a/bundle/src/main/resources/angularjs-partials/multifield.html +++ b/bundle/src/main/resources/angularjs-partials/multifield.html @@ -95,7 +95,8 @@