From b033ae853ced5a490f4d276bbb3cbb154077b782 Mon Sep 17 00:00:00 2001
From: Rishi Mehta <69448117+rismehta@users.noreply.github.com>
Date: Wed, 4 Oct 2023 16:53:21 +0530
Subject: [PATCH 01/16] Fixing versions.md script (#906)
---
.circleci/config.yml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 87cccfd1ea..1d55892863 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -335,6 +335,12 @@ jobs:
# update readme.md
sed -i -E "s/(\| $LAST_VERSION\s*\|) [0-9]+\.[0-9]+\.[0-9]+ \s*\| /| $NEW_VERSION | $WCM_CORE_COMPONENTS_VERSION | /g" README.md
+ # Check if package-lock.json is modified
+ if [[ $(git status --porcelain | grep "package-lock.json") ]]; then
+ # Discard the changes to package-lock.json (if needed)
+ git checkout -- '**/package-lock.json'
+ fi
+
git add VERSIONS.md README.md
git commit -m "Update VERSIONS.md and README.md to include version ${NEW_VERSION}"
git push origin $RELEASE_BRANCH
From f36a80e3d52346e01bce4ed305b9f3d9762cd98f Mon Sep 17 00:00:00 2001
From: Pankaj Parashar
Date: Thu, 5 Oct 2023 17:24:39 +0530
Subject: [PATCH 02/16] FORMS-11162 - Accessibility Issue - Forms iframe head
tag issue (#907)
---
.../core/fd/components/aemform/v1/aemform/iframe.html | 8 ++++----
.../core/fd/components/aemform/v2/aemform/iframe.html | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v1/aemform/iframe.html b/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v1/aemform/iframe.html
index 1f5e531965..d0346766c5 100644
--- a/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v1/aemform/iframe.html
+++ b/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v1/aemform/iframe.html
@@ -14,10 +14,10 @@
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-
-
-
+
+
+
+
${af.formTitle @ context='html'}
diff --git a/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/iframe.html b/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/iframe.html
index fd4a044aea..69a4e8d12e 100644
--- a/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/iframe.html
+++ b/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/iframe.html
@@ -14,10 +14,10 @@
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-
-
-
+
+
+
+
${af.formTitle @ context='html'}
From bb75aa9df712026c8f8d66b34eee3717ea2f62f9 Mon Sep 17 00:00:00 2001
From: Shivam Agarwal <47965724+im-shiv@users.noreply.github.com>
Date: Fri, 6 Oct 2023 18:28:40 +0530
Subject: [PATCH 03/16] FORMS-3696 adding rich text support for labels (#904)
* FORMS-3696 adding rich text support for labels
FORMS-3696 adding rich text support for labels
Co-authored-by: Shivam Agarwal
* FORMS-3696 adding test for deprecated method
* FORMS-3696 adding inline editor logic
* FORMS-3696 addressed review comments
* FORMS-3696 sorting options constraint
* FORMS-3696 adding some more test cases
---------
Co-authored-by: Shivam Agarwal
---
.../core/components/models/form/Label.java | 26 +-
.../models/form/OptionsConstraint.java | 13 +
.../components/models/form/TextContent.java | 51 ++++
.../components/models/form/package-info.java | 2 +-
.../util/AbstractOptionsFieldImpl.java | 32 +++
.../models/v1/form/CheckBoxGroupImplTest.java | 45 ++++
.../models/v1/form/CheckBoxImplTest.java | 16 +-
.../models/v1/form/DropDownImplTest.java | 47 ++++
.../models/v1/form/RadioButtonImplTest.java | 43 ++-
.../exporter-checkboxgroup-datalayer.json | 8 +-
.../checkboxgroup/exporter-checkboxgroup.json | 12 +-
.../form/dropdown/exporter-dropdown-1.json | 12 +-
.../dropdown/exporter-dropdown-datalayer.json | 8 +-
.../form/dropdown/exporter-dropdown.json | 12 +-
.../exporter-multiselect-dropdown.json | 12 +-
.../exporter-radiobutton-customized.json | 10 +-
.../exporter-radiobutton-datalayer.json | 8 +-
.../radiobutton/exporter-radiobutton.json | 10 +-
.../form/radiobutton/test-content.json | 10 +-
.../samples/checkboxgroup/basic/.content.xml | 22 ++
.../af-commons/v1/fieldTemplates/label.html | 4 +-
.../accordion/v1/accordion/accordion.html | 2 +-
.../form/base/v1/base/_cq_dialog/.content.xml | 253 +++++++++++++++++-
.../form/base/v1/base/_cq_editConfig.xml | 122 ++++++++-
.../base/clientlibs/editor/js/editDialog.js | 155 ++++++++++-
.../button/v1/button/_cq_dialog/.content.xml | 7 +-
.../form/button/v1/button/_cq_editConfig.xml | 122 ++++++++-
.../form/button/v1/button/button.html | 2 +-
.../form/checkbox/v1/checkbox/checkbox.html | 2 +-
.../v1/checkboxgroup/checkboxgroup.html | 4 +-
.../v2/container/clientlibs/editorhook/js.txt | 1 +
.../editorhook/js/toolbaractionhook.js | 52 ++++
.../datepicker/v1/datepicker/datepicker.html | 2 +-
.../v1/dropdown/_cq_dialog/.content.xml | 51 +++-
.../form/dropdown/v1/dropdown/dropdown.html | 8 +-
.../emailinput/v1/emailinput/emailinput.html | 2 +-
.../fileinput/v1/fileinput/fileinput.html | 2 +-
.../image/v1/image/_cq_dialog/.content.xml | 6 +
.../v1/numberinput/numberinput.html | 2 +-
.../v1/panelcontainer/_cq_dialog/.content.xml | 8 +
.../v1/panelcontainer/responsiveGrid.html | 2 +-
.../v1/panelcontainer/simple.html | 2 +-
.../v1/radiobutton/radiobutton.html | 4 +-
.../tabsontop/v1/tabsontop/tabsontop.html | 2 +-
.../v1/telephoneinput/telephoneinput.html | 2 +-
.../fd/components/form/text/v1/text/text.html | 3 +-
.../textinput/v1/textinput/textinput.html | 2 +-
.../form/wizard/v1/wizard/wizard.html | 2 +-
.../specs/button/button.authoring.spec.js | 26 +-
.../checkboxgroup.authoring.spec.js | 28 +-
.../checkboxgroup.runtime.spec.js | 8 +
.../specs/image/image.authoring.spec.js | 15 +-
.../panelcontainer.authoring.spec.js | 15 +-
.../radiobutton/radiobutton.authoring.spec.js | 20 ++
.../textinput/textinput.authoring.spec.js | 35 ++-
55 files changed, 1256 insertions(+), 116 deletions(-)
create mode 100644 bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/TextContent.java
create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/clientlibs/editorhook/js/toolbaractionhook.js
diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Label.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Label.java
index a7106b9f97..05f75471e6 100644
--- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Label.java
+++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Label.java
@@ -21,21 +21,10 @@
/**
* Interface for a label
*
- * @since com.adobe.cq.forms.core.components.models.form 0.0.1
+ * @since com.adobe.cq.forms.core.components.models.form 4.6.0
*/
@ConsumerType
-public interface Label {
-
- /**
- * Returns {@code true} if label is rich text, otherwise {@code false}.
- *
- * @return {@code true} if label is rich text, otherwise {@code false}
- * @since com.adobe.cq.forms.core.components.models.form 0.0.1
- */
- @Nullable
- default Boolean isRichText() {
- return null;
- }
+public interface Label extends TextContent {
/**
* Returns {@code true} if label should be visible, otherwise {@code false}.
@@ -48,15 +37,4 @@ default Boolean isVisible() {
return null;
}
- /**
- * Returns the value of this label.
- *
- * @return the value of this label
- * @since com.adobe.cq.forms.core.components.models.form 0.0.1
- */
- @Nullable
- default String getValue() {
- return null;
- }
-
}
diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/OptionsConstraint.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/OptionsConstraint.java
index 2b949352d7..93770a63bd 100644
--- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/OptionsConstraint.java
+++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/OptionsConstraint.java
@@ -17,6 +17,7 @@
import org.osgi.annotation.versioning.ProviderType;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
@@ -57,5 +58,17 @@ default boolean isEnforceEnum() {
* @return the list of enum names
* @since com.adobe.cq.forms.core.components.models.form 0.0.1
*/
+ @Deprecated
+ @JsonIgnore
String[] getEnumNames();
+
+ /**
+ * Returns a list of RichText to be displayed to the end user.
+ * The length of enum and enumNames array must match
+ *
+ * @return the list of enum names
+ * @since com.adobe.cq.forms.core.components.models.form 4.6.0
+ */
+ @JsonProperty("enumNames")
+ TextContent[] getEnumNamesAsTextContent();
}
diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/TextContent.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/TextContent.java
new file mode 100644
index 0000000000..30b7006263
--- /dev/null
+++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/TextContent.java
@@ -0,0 +1,51 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Copyright 2023 Adobe
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package com.adobe.cq.forms.core.components.models.form;
+
+import org.jetbrains.annotations.Nullable;
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Interface to represent text as rich content
+ *
+ * @since com.adobe.cq.forms.core.components.models.form 4.6.0
+ */
+@ProviderType
+public interface TextContent {
+
+ /**
+ * Returns {@code true} if text is rich, otherwise {@code false}.
+ *
+ * @return {@code true} if text is rich, otherwise {@code false}
+ * @since com.adobe.cq.forms.core.components.models.form 4.6.0
+ */
+ @Nullable
+ default Boolean isRichText() {
+ return null;
+ }
+
+ /**
+ * Returns a user friendly text to display for the possible options to be shown to the end user.
+ *
+ * @return the content of this text
+ * @since com.adobe.cq.forms.core.components.models.form 4.6.0
+ */
+ @Nullable
+ default String getValue() {
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/package-info.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/package-info.java
index 569a0f2118..ff809fcbdc 100644
--- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/package-info.java
+++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/package-info.java
@@ -34,7 +34,7 @@
* version, is bound to this proxy component resource type.
*
*/
-@Version("4.5.0")
+@Version("4.6.0")
package com.adobe.cq.forms.core.components.models.form;
import org.osgi.annotation.versioning.Version;
diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractOptionsFieldImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractOptionsFieldImpl.java
index 31fd23f66a..96af116db8 100644
--- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractOptionsFieldImpl.java
+++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractOptionsFieldImpl.java
@@ -29,6 +29,9 @@
import com.adobe.cq.forms.core.components.models.form.Field;
import com.adobe.cq.forms.core.components.models.form.OptionsConstraint;
+import com.adobe.cq.forms.core.components.models.form.TextContent;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
/**
* Abstract class which can be used as base class for options {@link Field} implementations.
@@ -49,6 +52,10 @@ public abstract class AbstractOptionsFieldImpl extends AbstractFieldImpl impleme
@Nullable
private String[] enumNames;
+ @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "areOptionsRichText")
+ @Nullable
+ private Boolean areOptionsRichText;
+
@Override
public boolean isEnforceEnum() {
return enforceEnum;
@@ -95,6 +102,8 @@ public Object[] getEnums() {
}
@Override
+ @Deprecated
+ @JsonIgnore
public String[] getEnumNames() {
if (enumNames != null) {
Map