diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d55892863..87cccfd1ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -335,12 +335,6 @@ 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 diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java index 1c1b3573b1..01bbc23604 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java @@ -50,9 +50,6 @@ private FormConstants() { /** The resource type for checkbox v1 */ public static final String RT_FD_FORM_CHECKBOX_V1 = RT_FD_FORM_PREFIX + "checkbox/v1/checkbox"; - /** The resource type for switch v1 */ - public static final String RT_FD_FORM_SWITCH_V1 = RT_FD_FORM_PREFIX + "switch/v1/switch"; - /** The resource type for date picker v1 */ public static final String RT_FD_FORM_DATE_PICKER_V1 = RT_FD_FORM_PREFIX + "datepicker/v1/datepicker"; @@ -111,9 +108,6 @@ private FormConstants() { public static final String RT_FD_FRAGMENT_CONTAINER_V1 = RT_FD_FORM_PREFIX + "fragmentcontainer/v1/fragmentcontainer"; - /** The resource type for terms and conditions v1 */ - public static final String RT_FD_FORM_TERMS_AND_CONDITIONS_V1 = RT_FD_FORM_PREFIX + "termsandconditions/v1/termsandconditions"; - public static final String FORM_FIELD_TYPE = "form"; public static final String REQ_ATTR_FORMCONTAINER_PATH = "formContainerPath"; diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxImpl.java index 92b66c8c14..ad9319b150 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxImpl.java @@ -1,5 +1,5 @@ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ Copyright 2023 Adobe + ~ Copyright 2022 Adobe ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -15,16 +15,25 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ package com.adobe.cq.forms.core.components.internal.models.v1.form; +import java.util.Map; + +import javax.annotation.Nullable; +import javax.annotation.PostConstruct; + import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Exporter; import org.apache.sling.models.annotations.Model; +import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy; +import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; +import org.jetbrains.annotations.NotNull; import com.adobe.cq.export.json.ComponentExporter; import com.adobe.cq.export.json.ExporterConstants; import com.adobe.cq.forms.core.components.internal.form.FormConstants; import com.adobe.cq.forms.core.components.models.form.CheckBox; -import com.adobe.cq.forms.core.components.util.AbstractCheckboxImpl; +import com.adobe.cq.forms.core.components.util.AbstractOptionsFieldImpl; +import com.adobe.cq.forms.core.components.util.ComponentUtils; @Model( adaptables = { SlingHttpServletRequest.class, Resource.class }, @@ -33,4 +42,54 @@ @Exporter( name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION) -public class CheckBoxImpl extends AbstractCheckboxImpl implements CheckBox {} +public class CheckBoxImpl extends AbstractOptionsFieldImpl implements CheckBox { + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "orientation") + @Nullable + protected String orientationJcr; + private Orientation orientation; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL) + private String checkedValue; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL) + private String uncheckedValue; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL) + private Boolean enableUncheckedValue; + + @PostConstruct + private void initCheckBoxModel() { + orientation = Orientation.fromString(orientationJcr); + if (!Type.BOOLEAN.equals(type)) { + if (Boolean.TRUE.equals(enableUncheckedValue)) { + enums = new String[] { checkedValue, uncheckedValue }; + } else { + enums = new String[] { checkedValue }; + } + } + } + + @Override + public @NotNull Map getCustomLayoutProperties() { + Map customLayoutProperties = super.getCustomLayoutProperties(); + if (orientation != null) { + customLayoutProperties.put("orientation", orientation); + } + return customLayoutProperties; + } + + @Override + public Orientation getOrientation() { + return orientation; + } + + @Override + public Object[] getEnums() { + if (enums == null) { + return null; + } else { + return ComponentUtils.coerce(type, enums); + } + } +} diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SwitchImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SwitchImpl.java deleted file mode 100644 index 62ebeb09a5..0000000000 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SwitchImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ 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.internal.models.v1.form; - -import javax.annotation.PostConstruct; - -import org.apache.sling.api.SlingHttpServletRequest; -import org.apache.sling.api.resource.Resource; -import org.apache.sling.models.annotations.Exporter; -import org.apache.sling.models.annotations.Model; - -import com.adobe.cq.export.json.ComponentExporter; -import com.adobe.cq.export.json.ExporterConstants; -import com.adobe.cq.forms.core.components.internal.form.FormConstants; -import com.adobe.cq.forms.core.components.models.form.Switch; -import com.adobe.cq.forms.core.components.util.AbstractCheckboxImpl; - -@Model( - adaptables = { SlingHttpServletRequest.class, Resource.class }, - adapters = { Switch.class, - ComponentExporter.class }, - resourceType = { FormConstants.RT_FD_FORM_SWITCH_V1 }) -@Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION) -public class SwitchImpl extends AbstractCheckboxImpl implements Switch { - @PostConstruct - public void initSwitchModel() { - if (enumNames != null) { - String[] enumNameArray = enumNames; - enumNames = Boolean.TRUE.equals(enableUncheckedValue) ? new String[] { enumNameArray[0], enumNameArray[1] } - : new String[] { enumNameArray[0] }; - } - } -} diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImpl.java deleted file mode 100644 index 63a81cc98c..0000000000 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ 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.internal.models.v1.form; - -import java.util.List; -import java.util.Map; - -import org.apache.sling.api.SlingHttpServletRequest; -import org.apache.sling.api.resource.Resource; -import org.apache.sling.models.annotations.Default; -import org.apache.sling.models.annotations.Exporter; -import org.apache.sling.models.annotations.Model; -import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy; -import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; -import org.jetbrains.annotations.NotNull; - -import com.adobe.cq.export.json.ComponentExporter; -import com.adobe.cq.export.json.ExporterConstants; -import com.adobe.cq.forms.core.components.internal.form.FormConstants; -import com.adobe.cq.forms.core.components.models.form.FieldType; -import com.adobe.cq.forms.core.components.models.form.TermsAndConditions; -import com.fasterxml.jackson.annotation.JsonIgnore; - -@Model( - adaptables = { SlingHttpServletRequest.class, Resource.class }, - adapters = { TermsAndConditions.class, - ComponentExporter.class }, - resourceType = { FormConstants.RT_FD_FORM_TERMS_AND_CONDITIONS_V1 }) - -@Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION) -public class TermsAndConditionsImpl extends PanelImpl implements TermsAndConditions { - - private static final String CUSTOM_TNC_PROPERTY = "fd:tnc"; - - private static final String FIELD_TYPE = "fieldType"; - - @JsonIgnore - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL) - @Default(booleanValues = true) - private boolean showApprovalOption; - - @JsonIgnore - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL) - @Default(booleanValues = false) - private boolean showLink; - - @JsonIgnore - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL) - @Default(booleanValues = false) - private boolean showAsPopup; - - @Override - public boolean isShowApprovalOption() { - return showApprovalOption; - } - - @Override - public boolean isShowLink() { - return showLink; - } - - @Override - public boolean isShowAsPopup() { - return showAsPopup; - } - - @Override - public @NotNull String getId() { - return super.getId(); - } - - @Override - public @NotNull Map getProperties() { - Map properties = super.getProperties(); - if (resource.getValueMap().containsKey(CUSTOM_TNC_PROPERTY)) { - properties.put(CUSTOM_TNC_PROPERTY, true); - } - return properties; - } - - @Override - protected List getFilteredChildrenResources() { - List childResources = getFilteredChildrenResources(resource); - // the tnc component will either have links or consent text based upon showLink value - if (showLink) { - childResources.removeIf(child -> FieldType.PLAIN_TEXT.getValue().equals(child.getValueMap().get(FIELD_TYPE))); - - } else { - childResources.removeIf(child -> FieldType.CHECKBOX_GROUP.getValue().equals(child.getValueMap().get(FIELD_TYPE))); - } - return childResources; - } -} 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 05f75471e6..a7106b9f97 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,10 +21,21 @@ /** * Interface for a label * - * @since com.adobe.cq.forms.core.components.models.form 4.6.0 + * @since com.adobe.cq.forms.core.components.models.form 0.0.1 */ @ConsumerType -public interface Label extends TextContent { +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; + } /** * Returns {@code true} if label should be visible, otherwise {@code false}. @@ -37,4 +48,15 @@ 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 93770a63bd..2b949352d7 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,7 +17,6 @@ import org.osgi.annotation.versioning.ProviderType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -58,17 +57,5 @@ 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/Switch.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Switch.java deleted file mode 100644 index 9b4f4b9c6c..0000000000 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Switch.java +++ /dev/null @@ -1,26 +0,0 @@ -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ 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.osgi.annotation.versioning.ConsumerType; - -/** - * Defines the {@code Switch} Sling Model used for the {@code /apps/core/fd/components/form/switch} component. - * - * @since com.adobe.cq.forms.core.components.models 4.7.0 - */ -@ConsumerType -public interface Switch extends CheckBox {} \ No newline at end of file diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/TermsAndConditions.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/TermsAndConditions.java deleted file mode 100644 index 957877b9b2..0000000000 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/TermsAndConditions.java +++ /dev/null @@ -1,50 +0,0 @@ -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ 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.osgi.annotation.versioning.ConsumerType; - -/** - * Defines the form {@code TermsAndConditions} Sling Model used for the - * {@code /apps/core/fd/components/form/termsandconditions/v1/termsandconditions} component. - * - * @since com.adobe.cq.forms.core.components.models.form 4.7.0 - */ -@ConsumerType -public interface TermsAndConditions extends Container, ContainerConstraint { - - String FD_TERMS_AND_CONDITIONS = "fd:tnc"; - - /** - * - * @return {@code true} if approval checkbox should be shown, otherwise {@code false} - */ - boolean isShowApprovalOption(); - - /** - * - * @return {@code true} if links to external Terms & Conditions pages are to be shown, otherwise - * {@code false if consent text is to be shown} - */ - boolean isShowLink(); - - /** - * - * @return @return {@code true} if the content is to be shown as pop-up , otherwise {@code false} - */ - boolean isShowAsPopup(); -} 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 deleted file mode 100644 index 30b7006263..0000000000 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/TextContent.java +++ /dev/null @@ -1,51 +0,0 @@ -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ 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 1aacc8966b..569a0f2118 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.7.0") +@Version("4.5.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/AbstractCheckboxImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractCheckboxImpl.java deleted file mode 100644 index 7059695145..0000000000 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractCheckboxImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ 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.util; - -import javax.annotation.PostConstruct; - -import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy; -import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; - -import com.adobe.cq.forms.core.components.models.form.Base; - -/** - * Abstract class which can be used as base class for {@link Base} implementations. - */ -public abstract class AbstractCheckboxImpl extends AbstractOptionsFieldImpl { - - // when a checkbox is not checked, it will still have a value representing its unchecked state, rather than having - // a null value. This configuration allows for a distinct value when the checkbox is in an unchecked state. - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "enableUncheckedValue") - protected Boolean enableUncheckedValue; - - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL) - private String checkedValue; - - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL) - private String uncheckedValue; - - @PostConstruct - public void initBaseCheckboxModel() { - if (enums != null) { - checkedValue = String.valueOf(getEnums()[0]); - uncheckedValue = getEnums().length > 1 ? String.valueOf(getEnums()[1]) : null; - } - enums = (checkedValue != null) ? (Boolean.TRUE.equals(enableUncheckedValue)) ? new String[] { checkedValue, uncheckedValue } - : new String[] { checkedValue } : null; - } - - @Override - public Object[] getEnums() { - if (enums == null) { - return null; - } else { - return ComponentUtils.coerce(type, enums); - } - } -} 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 10dabbbd46..31fd23f66a 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,9 +29,6 @@ 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. @@ -50,11 +47,7 @@ public abstract class AbstractOptionsFieldImpl extends AbstractFieldImpl impleme @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "enumNames") @Nullable - protected String[] enumNames; - - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "areOptionsRichText") - @Nullable - private Boolean areOptionsRichText; + private String[] enumNames; @Override public boolean isEnforceEnum() { @@ -102,8 +95,6 @@ public Object[] getEnums() { } @Override - @Deprecated - @JsonIgnore public String[] getEnumNames() { if (enumNames != null) { Map map = removeDuplicates(); @@ -117,29 +108,6 @@ public String[] getEnumNames() { return null; } - @Override - public TextContent[] getEnumNamesAsTextContent() { - if (enumNames != null) { - Map map = removeDuplicates(); - String[] enumName = map.values().toArray(new String[0]); - return Arrays.stream(enumName) - .map(p -> new TextContent() { - @Override - @JsonInclude(JsonInclude.Include.NON_NULL) - public @Nullable Boolean isRichText() { - return areOptionsRichText; - } - - @Override - public @Nullable String getValue() { - return translate("enumNames", p); - } - }) - .toArray(TextContent[]::new); - } - return null; - } - @Override public Object[] getDefault() { Object[] typedDefaultValue = null; diff --git a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxGroupImplTest.java b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxGroupImplTest.java index 2a47560728..8f887346e4 100644 --- a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxGroupImplTest.java +++ b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxGroupImplTest.java @@ -25,7 +25,6 @@ import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.sling.api.resource.Resource; import org.apache.sling.testing.mock.sling.servlet.MockSlingHttpServletRequest; -import org.jetbrains.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -295,44 +294,6 @@ void testGetType() { void testGetEnumNames() { CheckBoxGroup checkboxGroup = getCheckBoxGroupUnderTest(PATH_CHECKBOX_GROUP); assertArrayEquals(new String[] { "m", "f", "o" }, checkboxGroup.getEnumNames()); - TextContent textContent1 = new TextContent() { - @Override - public @Nullable Boolean isRichText() { - return null; - } - - @Override - public @Nullable String getValue() { - return "m"; - } - }; - TextContent textContent2 = new TextContent() { - @Override - public @Nullable Boolean isRichText() { - return null; - } - - @Override - public @Nullable String getValue() { - return "f"; - } - }; - TextContent textContent3 = new TextContent() { - @Override - public @Nullable Boolean isRichText() { - return null; - } - - @Override - public @Nullable String getValue() { - return "o"; - } - }; - TextContent[] textContent = new TextContent[] { textContent1, textContent2, textContent3 }; - for (int i = 0; i < checkboxGroup.getEnumNamesAsTextContent().length; i++) { - assertEquals(textContent[i].getValue(), checkboxGroup.getEnumNamesAsTextContent()[i].getValue()); - assertEquals(textContent[i].isRichText(), checkboxGroup.getEnumNamesAsTextContent()[i].isRichText()); - } } @Test @@ -343,9 +304,6 @@ void testGetEnumNamesWithDuplicateEnumValues() { map.put("1", "Item 2"); map.put("0", "Item 3"); assertArrayEquals(map.values().toArray(new String[0]), checkboxGroup.getEnumNames()); - String[] checkboxGroupValues = Arrays.stream(checkboxGroup.getEnumNamesAsTextContent()).map(d -> d.getValue()).toArray( - size -> new String[checkboxGroup.getEnumNamesAsTextContent().length]); - assertArrayEquals(map.values().toArray(new String[0]), checkboxGroupValues); } @Test @@ -419,8 +377,5 @@ void testInsertionOrderForEnumNames() { Set set = new LinkedHashSet<>(Arrays.asList("Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen", "Twenty")); assertArrayEquals(set.toArray(new String[0]), checkboxGroup.getEnumNames()); - String[] checkboxGroupValues = Arrays.stream(checkboxGroup.getEnumNamesAsTextContent()).map(d -> d.getValue()).toArray( - size -> new String[checkboxGroup.getEnumNamesAsTextContent().length]); - assertArrayEquals(set.toArray(new String[0]), checkboxGroupValues); } } diff --git a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxImplTest.java b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxImplTest.java index b3d8c6efbb..071ce8d418 100644 --- a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxImplTest.java +++ b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxImplTest.java @@ -27,8 +27,12 @@ import com.adobe.cq.forms.core.Utils; import com.adobe.cq.forms.core.components.internal.form.FormConstants; -import com.adobe.cq.forms.core.components.models.form.*; +import com.adobe.cq.forms.core.components.models.form.Base; +import com.adobe.cq.forms.core.components.models.form.CheckBox; import com.adobe.cq.forms.core.components.models.form.CheckBox.Orientation; +import com.adobe.cq.forms.core.components.models.form.ConstraintType; +import com.adobe.cq.forms.core.components.models.form.FieldType; +import com.adobe.cq.forms.core.components.models.form.Label; import com.adobe.cq.forms.core.context.FormsCoreComponentTestContext; import com.adobe.cq.wcm.style.ComponentStyleInfo; import io.wcm.testing.mock.aem.junit5.AemContext; @@ -305,16 +309,6 @@ void testGetEnum() { } - @Test - void testGetNullEnumNames() { - CheckBox checkbox = getCheckBoxUnderTest(PATH_CHECKBOX); - assertNull(checkbox.getEnumNamesAsTextContent()); - assertNull(checkbox.getEnumNames()); - CheckBox noEnumCheckbox = getCheckBoxUnderTest(PATH_CHECKBOX_NOENUM); - assertNull(noEnumCheckbox.getEnumNamesAsTextContent()); - assertNull(noEnumCheckbox.getEnumNames()); - } - @Test void testGetNullEnum() { CheckBox noEnumCheckbox = getCheckBoxUnderTest(PATH_CHECKBOX_NOENUM); diff --git a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/DropDownImplTest.java b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/DropDownImplTest.java index ed9b4da4b1..824078c932 100644 --- a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/DropDownImplTest.java +++ b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/DropDownImplTest.java @@ -25,7 +25,6 @@ import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.sling.api.resource.Resource; import org.apache.sling.testing.mock.sling.servlet.MockSlingHttpServletRequest; -import org.jetbrains.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -380,44 +379,6 @@ void testGetMultiSelectMaxItems() { void testGetEnumNames() { DropDown dropdown = Utils.getComponentUnderTest(PATH_DROPDOWN_1, DropDown.class, context); assertArrayEquals(new String[] { "m", "f", "o" }, dropdown.getEnumNames()); - TextContent textContent1 = new TextContent() { - @Override - public @Nullable Boolean isRichText() { - return null; - } - - @Override - public @Nullable String getValue() { - return "m"; - } - }; - TextContent textContent2 = new TextContent() { - @Override - public @Nullable Boolean isRichText() { - return null; - } - - @Override - public @Nullable String getValue() { - return "f"; - } - }; - TextContent textContent3 = new TextContent() { - @Override - public @Nullable Boolean isRichText() { - return null; - } - - @Override - public @Nullable String getValue() { - return "o"; - } - }; - TextContent[] textContent = new TextContent[] { textContent1, textContent2, textContent3 }; - for (int i = 0; i < dropdown.getEnumNamesAsTextContent().length; i++) { - assertEquals(textContent[i].getValue(), dropdown.getEnumNamesAsTextContent()[i].getValue()); - assertEquals(textContent[i].isRichText(), dropdown.getEnumNamesAsTextContent()[i].isRichText()); - } } @Test @@ -428,10 +389,6 @@ void testGetEnumNamesWithDuplicateEnumValues() { map.put("1", "Item 2"); map.put("0", "Item 3"); assertArrayEquals(map.values().toArray(new String[0]), dropdown.getEnumNames()); - String[] dropdownValues = Arrays.stream(dropdown.getEnumNamesAsTextContent()).map(d -> d.getValue()).toArray( - size -> new String[dropdown - .getEnumNamesAsTextContent().length]); - assertArrayEquals(map.values().toArray(new String[0]), dropdownValues); } @Test @@ -481,9 +438,5 @@ void testInsertionOrderForEnumNames() { Set set = new LinkedHashSet<>(Arrays.asList("Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen", "Twenty")); assertArrayEquals(set.toArray(new String[0]), dropdown.getEnumNames()); - String[] dropdownValues = Arrays.stream(dropdown.getEnumNamesAsTextContent()).map(d -> d.getValue()).toArray( - size -> new String[dropdown - .getEnumNamesAsTextContent().length]); - assertArrayEquals(set.toArray(new String[0]), dropdownValues); } } diff --git a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImplTest.java b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImplTest.java index 3df63727d1..22dcf6f74a 100644 --- a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImplTest.java +++ b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/RadioButtonImplTest.java @@ -24,7 +24,6 @@ import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.sling.testing.mock.sling.servlet.MockSlingHttpServletRequest; -import org.jetbrains.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -308,42 +307,10 @@ void testGetType() { assertEquals(BaseConstraint.Type.STRING, radioButtonMock.getType()); } - @Test - void testDeprecatedGetEnumNames() { - RadioButton radioButton = getRadioButtonUnderTest(PATH_RADIOBUTTON_CUSTOMIZED); - assertArrayEquals(new String[] { "

Item 1

", "

Item 2

" }, radioButton.getEnumNames()); - } - @Test void testGetEnumNames() { RadioButton radioButton = getRadioButtonUnderTest(PATH_RADIOBUTTON_CUSTOMIZED); - TextContent textContent1 = new TextContent() { - @Override - public @Nullable Boolean isRichText() { - return true; - } - - @Override - public @Nullable String getValue() { - return "

Item 1

"; - } - }; - TextContent textContent2 = new TextContent() { - @Override - public @Nullable Boolean isRichText() { - return true; - } - - @Override - public @Nullable String getValue() { - return "

Item 2

"; - } - }; - TextContent[] textContent = new TextContent[] { textContent1, textContent2 }; - for (int i = 0; i < radioButton.getEnumNamesAsTextContent().length; i++) { - assertEquals(textContent[i].getValue(), radioButton.getEnumNamesAsTextContent()[i].getValue()); - assertEquals(textContent[i].isRichText(), radioButton.getEnumNamesAsTextContent()[i].isRichText()); - } + assertArrayEquals(new String[] { "Item 1", "Item 2" }, radioButton.getEnumNames()); } @Test @@ -354,10 +321,6 @@ void testGetEnumNamesWithDuplicateEnumValues() { map.put("1", "Item 2"); map.put("0", "Item 3"); assertArrayEquals(map.values().toArray(new String[0]), radioButton.getEnumNames()); - String[] radioButtonValues = Arrays.stream(radioButton.getEnumNamesAsTextContent()).map(d -> d.getValue()).toArray( - size -> new String[radioButton - .getEnumNamesAsTextContent().length]); - assertArrayEquals(map.values().toArray(new String[0]), radioButtonValues); } @Test @@ -426,9 +389,5 @@ void testInsertionOrderForEnumNames() { Set set = new LinkedHashSet<>(Arrays.asList("Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen", "Twenty")); assertArrayEquals(set.toArray(new String[0]), radioButton.getEnumNames()); - String[] radioButtonValues = Arrays.stream(radioButton.getEnumNamesAsTextContent()).map(d -> d.getValue()).toArray( - size -> new String[radioButton - .getEnumNamesAsTextContent().length]); - assertArrayEquals(set.toArray(new String[0]), radioButtonValues); } } diff --git a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SwitchImplTest.java b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SwitchImplTest.java deleted file mode 100644 index 33c3f03ae3..0000000000 --- a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SwitchImplTest.java +++ /dev/null @@ -1,347 +0,0 @@ -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ 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.internal.models.v1.form; - -import java.util.Collections; -import java.util.Map; - -import org.apache.sling.api.resource.Resource; -import org.apache.sling.testing.mock.sling.servlet.MockSlingHttpServletRequest; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mockito; - -import com.adobe.cq.forms.core.Utils; -import com.adobe.cq.forms.core.components.internal.form.FormConstants; -import com.adobe.cq.forms.core.components.models.form.*; -import com.adobe.cq.forms.core.context.FormsCoreComponentTestContext; -import com.adobe.cq.wcm.style.ComponentStyleInfo; -import io.wcm.testing.mock.aem.junit5.AemContext; -import io.wcm.testing.mock.aem.junit5.AemContextExtension; - -import static org.junit.Assert.*; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; - -@ExtendWith(AemContextExtension.class) -public class SwitchImplTest { - private static final String BASE = "/form/switch"; - private static final String CONTENT_ROOT = "/content"; - private static final String PATH_SWITCH = CONTENT_ROOT + "/switch"; - - private static final String PATH_SWITCH_CUSTOMIZED = CONTENT_ROOT + "/switch-customized"; - - private static final String PATH_SWITCH_ENABLEUNCHECKEDOFF = CONTENT_ROOT + "/switch-enableUncheckedValueFalse"; - private static final String PATH_SWITCH_ENABLEUNCHECKED_BOOLEAN = CONTENT_ROOT + "/switch-boolean"; - private static final String PATH_SWITCH_ENABLEUNCHECKEDOFF_BOOLEAN = CONTENT_ROOT + "/switch-enableUncheckedValueFalse-boolean"; - private final AemContext context = FormsCoreComponentTestContext.newAemContext(); - - @BeforeEach - void setUp() { - context.load().json(BASE + FormsCoreComponentTestContext.TEST_CONTENT_JSON, CONTENT_ROOT); - } - - @Test - void testExportedType() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals(FormConstants.RT_FD_FORM_SWITCH_V1, switchObj.getExportedType()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getExportedType()).thenCallRealMethod(); - assertEquals("", switchMock.getExportedType()); - } - - @Test - void testFieldType() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals(FieldType.CHECKBOX.getValue(), switchObj.getFieldType()); - } - - @Test - void testGetLabel() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals("def", switchObj.getLabel().getValue()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getLabel()).thenCallRealMethod(); - assertEquals(null, switchMock.getLabel()); - - Label labelMock = Mockito.mock(Label.class); - Mockito.when(labelMock.isRichText()).thenCallRealMethod(); - assertEquals(null, labelMock.isRichText()); - Mockito.when(labelMock.getValue()).thenCallRealMethod(); - assertEquals(null, labelMock.getValue()); - Mockito.when(labelMock.isVisible()).thenCallRealMethod(); - assertEquals(null, labelMock.isVisible()); - } - - @Test - void testGetName() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals("abc", switchObj.getName()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getName()).thenCallRealMethod(); - assertEquals(null, switchMock.getName()); - } - - @Test - void testGetDataRef() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals("a.b", switchObj.getDataRef()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getDataRef()).thenCallRealMethod(); - assertEquals(null, switchMock.getDataRef()); - } - - @Test - void testGetDescription() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals("dummy", switchObj.getDescription()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getDescription()).thenCallRealMethod(); - assertEquals(null, switchMock.getDescription()); - } - - @Test - void testGetScreenReaderText() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals("'Custom screen reader text'", switchObj.getScreenReaderText()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getScreenReaderText()).thenCallRealMethod(); - assertEquals(null, switchMock.getScreenReaderText()); - } - - @Test - void testIsVisible() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals(null, switchObj.isVisible()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.isVisible()).thenCallRealMethod(); - assertEquals(null, switchMock.isVisible()); - } - - @Test - void testIsVisibleForCustomizedSwitch() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH_CUSTOMIZED); - assertEquals(false, switchObj.isVisible()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.isVisible()).thenCallRealMethod(); - assertEquals(null, switchMock.isVisible()); - } - - @Test - void testIsEnabled() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals(null, switchObj.isEnabled()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.isEnabled()).thenCallRealMethod(); - assertEquals(null, switchMock.isEnabled()); - } - - @Test - void testIsEnabledForCustomizedSwitch() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH_CUSTOMIZED); - assertEquals(false, switchObj.isEnabled()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.isEnabled()).thenCallRealMethod(); - assertEquals(null, switchMock.isEnabled()); - } - - @Test - void testIsReadOnly() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals(null, switchObj.isReadOnly()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.isReadOnly()).thenCallRealMethod(); - assertEquals(null, switchMock.isReadOnly()); - } - - @Test - void testIsReadOnlyForCustomizedSwitch() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH_CUSTOMIZED); - assertEquals(true, switchObj.isReadOnly()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.isReadOnly()).thenCallRealMethod(); - assertEquals(null, switchMock.isReadOnly()); - } - - @Test - void testIsRequired() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals(null, switchObj.isRequired()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.isRequired()).thenCallRealMethod(); - assertEquals(null, switchMock.isRequired()); - } - - @Test - void testIsRequiredForCustomizedSwitch() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH_CUSTOMIZED); - assertEquals(true, switchObj.isRequired()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.isRequired()).thenCallRealMethod(); - assertEquals(null, switchMock.isRequired()); - } - - @Test - void testGetPlaceHolder() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals(null, switchObj.getPlaceHolder()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getPlaceHolder()).thenCallRealMethod(); - assertEquals(null, switchMock.getPlaceHolder()); - } - - @Test - void testGetDisplayFormat() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals(null, switchObj.getDisplayFormat()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getDisplayFormat()).thenCallRealMethod(); - assertEquals(null, switchMock.getDisplayFormat()); - } - - @Test - void testGetEditFormat() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals(null, switchObj.getEditFormat()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getEditFormat()).thenCallRealMethod(); - assertEquals(null, switchMock.getEditFormat()); - } - - @Test - void testGetDataFormat() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals(null, switchObj.getDataFormat()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getDataFormat()).thenCallRealMethod(); - assertEquals(null, switchMock.getDataFormat()); - } - - @Test - void testGetTooltip() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertEquals("test-short-description", switchObj.getTooltip()); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getTooltip()).thenCallRealMethod(); - assertEquals(null, switchMock.getTooltip()); - } - - @Test - void testGetConstraintMessages() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - Map constraintsMessages = switchObj.getConstraintMessages(); - assertEquals(constraintsMessages.get(ConstraintType.TYPE), "incorrect type"); - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getConstraintMessages()).thenCallRealMethod(); - assertEquals(Collections.emptyMap(), switchMock.getConstraintMessages()); - } - - @Test - void testJSONExport() throws Exception { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - Utils.testJSONExport(switchObj, Utils.getTestExporterJSONPath(BASE, PATH_SWITCH)); - } - - @Test - void testJSONExportForCustomized() throws Exception { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH_CUSTOMIZED); - Utils.testJSONExport(switchObj, Utils.getTestExporterJSONPath(BASE, PATH_SWITCH_CUSTOMIZED)); - } - - @Test - void testGetProperties() throws Exception { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - Map properties = switchObj.getProperties(); - assertFalse(properties.isEmpty()); - // get custom properties of "afs:layout" - Map customProperties = (Map) properties.get(Base.CUSTOM_PROPERTY_WRAPPER); - assertFalse((boolean) customProperties.get("tooltipVisible")); - } - - @Test - void testGetProperties_should_return_empty_if_no_custom_properties() { - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getProperties()).thenCallRealMethod(); - assertTrue(switchMock.getProperties().isEmpty()); - } - - @Test - void testGetShortDescription() { - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.getTooltip()).thenCallRealMethod(); - assertEquals(null, switchMock.getTooltip()); - } - - @Test - void testIsShortDescriptionVisible() { - Switch switchMock = Mockito.mock(Switch.class); - Mockito.when(switchMock.isTooltipVisible()).thenCallRealMethod(); - assertEquals(false, switchMock.isTooltipVisible()); - } - - @Test - void testGetEnum() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH); - assertArrayEquals(new String[] { "OFF", "ON" }, switchObj.getEnumNames()); - assertArrayEquals(new String[] { "0", "1" }, switchObj.getEnums()); - } - - @Test - void testStyleSystemClasses() { - ComponentStyleInfo componentStyleInfoMock = mock(ComponentStyleInfo.class); - Resource resource = spy(context.resourceResolver().getResource(PATH_SWITCH)); - Mockito.doReturn(componentStyleInfoMock).when(resource).adaptTo(ComponentStyleInfo.class); - MockSlingHttpServletRequest request = context.request(); - request.setResource(resource); - Mockito.doReturn("mystyle").when(componentStyleInfoMock).getAppliedCssClasses(); - Switch switchObj = request.adaptTo(Switch.class); - String appliedCssClasses = switchObj.getAppliedCssClasses(); - assertEquals("mystyle", appliedCssClasses); - } - - @Test - void shouldOnlyHaveOnEnumIfEnableUncheckedValueOff() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH_ENABLEUNCHECKEDOFF); - assertArrayEquals(new String[] { "1" }, switchObj.getEnums()); - } - - @Test - void shouldOnlyHaveOnEnumValueIfEnableUncheckedValueOff() { - Switch switchObj = getSwitchUnderTest(PATH_SWITCH_ENABLEUNCHECKEDOFF); - assertArrayEquals(new String[] { "ON" }, switchObj.getEnumNames()); - } - - @Test - void shouldOnlyHaveOnEnumAndEnumValueIfEnableUncheckedValueOffBoolean() { - Switch switchObjBool = getSwitchUnderTest(PATH_SWITCH_ENABLEUNCHECKEDOFF_BOOLEAN); - assertArrayEquals(new Boolean[] { true }, switchObjBool.getEnums()); - assertArrayEquals(new String[] { "ON" }, switchObjBool.getEnumNames()); - } - - @Test - void shouldOnlyHaveOnEnumAndEnumValueIfEnableUncheckedValueOnBoolean() { - Switch switchObjBool = getSwitchUnderTest(PATH_SWITCH_ENABLEUNCHECKED_BOOLEAN); - assertArrayEquals(new Boolean[] { true, false }, switchObjBool.getEnums()); - assertArrayEquals(new String[] { "true", "false" }, switchObjBool.getEnumNames()); - } - - private Switch getSwitchUnderTest(String resourcePath) { - context.currentResource(resourcePath); - MockSlingHttpServletRequest request = context.request(); - return request.adaptTo(Switch.class); - } -} diff --git a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImplTest.java b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImplTest.java deleted file mode 100644 index 57c936958b..0000000000 --- a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImplTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ 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.internal.models.v1.form; - -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.StreamSupport; - -import org.apache.sling.api.resource.Resource; -import org.junit.Assert; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mockito; - -import com.adobe.cq.export.json.SlingModelFilter; -import com.adobe.cq.forms.core.Utils; -import com.adobe.cq.forms.core.components.internal.form.FormConstants; -import com.adobe.cq.forms.core.components.models.form.TermsAndConditions; -import com.adobe.cq.forms.core.context.FormsCoreComponentTestContext; -import com.day.cq.wcm.api.NameConstants; -import com.day.cq.wcm.msm.api.MSMNameConstants; -import io.wcm.testing.mock.aem.junit5.AemContext; -import io.wcm.testing.mock.aem.junit5.AemContextExtension; - -import static org.junit.Assert.assertEquals; - -@ExtendWith(AemContextExtension.class) -public class TermsAndConditionsImplTest { - - private static final String BASE = "/form/termsandconditions"; - private static final String CONTENT_ROOT = "/content"; - - private static final String PATH_TNC = CONTENT_ROOT + "/termsandconditions"; - - private static final String PATH_NOWRAP_TNC = CONTENT_ROOT + "/termsandconditionsNoWrapData"; - - private final AemContext context = FormsCoreComponentTestContext.newAemContext(); - - @BeforeEach - public void setUp() { - context.load().json(BASE + FormsCoreComponentTestContext.TEST_CONTENT_JSON, CONTENT_ROOT); - context.registerService(SlingModelFilter.class, new SlingModelFilter() { - - private final Set IGNORED_NODE_NAMES = new HashSet() { - { - add(NameConstants.NN_RESPONSIVE_CONFIG); - add(MSMNameConstants.NT_LIVE_SYNC_CONFIG); - add("cq:annotations"); - } - }; - - @Override - public Map filterProperties(Map map) { - return map; - } - - @Override - public Iterable filterChildResources(Iterable childResources) { - return StreamSupport - .stream(childResources.spliterator(), false) - .filter(r -> !IGNORED_NODE_NAMES.contains(r.getName())) - .collect(Collectors.toList()); - } - }); - } - - @Test - void testExportedType() throws Exception { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); - assertEquals(FormConstants.RT_FD_FORM_TERMS_AND_CONDITIONS_V1, tnc.getExportedType()); - TermsAndConditions tncMock = Mockito.mock(TermsAndConditions.class); - Mockito.when(tncMock.getExportedType()).thenCallRealMethod(); - assertEquals("", tncMock.getExportedType()); - } - - @Test - public void testGetProperties() { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); - Assert.assertTrue(tnc.isShowApprovalOption()); - Assert.assertTrue(tnc.isShowAsPopup()); - Assert.assertFalse(tnc.isShowLink()); - } - - @Test - public void testCustomFDProperty() { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); - Map props = tnc.getProperties(); - Assert.assertTrue(props.containsKey("fd:tnc")); - Assert.assertTrue((Boolean) props.get("fd:tnc")); - - } - - @Test - void testJSONExport() throws Exception { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); - Utils.testJSONExport(tnc, Utils.getTestExporterJSONPath(BASE, PATH_TNC)); - } - - @Test - void testJSONExport_showLink() throws Exception { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_NOWRAP_TNC, TermsAndConditions.class, context); - Utils.testJSONExport(tnc, Utils.getTestExporterJSONPath(BASE, PATH_NOWRAP_TNC)); - } - - @Test - void testNoWrap() { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_NOWRAP_TNC, TermsAndConditions.class, context); - Assert.assertNull(tnc.getType()); - } -} diff --git a/bundles/af-core/src/test/resources/form/checkbox/exporter-checkbox-customized.json b/bundles/af-core/src/test/resources/form/checkbox/exporter-checkbox-customized.json index ba7d14efd9..d5d240886f 100644 --- a/bundles/af-core/src/test/resources/form/checkbox/exporter-checkbox-customized.json +++ b/bundles/af-core/src/test/resources/form/checkbox/exporter-checkbox-customized.json @@ -26,7 +26,8 @@ }, "properties": { "afs:layout": { - "tooltipVisible": false + "tooltipVisible": false, + "orientation": "horizontal" }, "fd:dor": { "dorExclusion": false diff --git a/bundles/af-core/src/test/resources/form/checkbox/exporter-checkbox.json b/bundles/af-core/src/test/resources/form/checkbox/exporter-checkbox.json index 4f31ccd987..557a88e2af 100644 --- a/bundles/af-core/src/test/resources/form/checkbox/exporter-checkbox.json +++ b/bundles/af-core/src/test/resources/form/checkbox/exporter-checkbox.json @@ -6,7 +6,8 @@ "tooltip": "test-short-description", "properties": { "afs:layout" : { - "tooltipVisible": false + "tooltipVisible": false, + "orientation" : "horizontal" }, "fd:dor": { "dorExclusion":false diff --git a/bundles/af-core/src/test/resources/form/checkbox/test-content.json b/bundles/af-core/src/test/resources/form/checkbox/test-content.json index fcd2a19b6d..b6a9622d3c 100644 --- a/bundles/af-core/src/test/resources/form/checkbox/test-content.json +++ b/bundles/af-core/src/test/resources/form/checkbox/test-content.json @@ -39,6 +39,7 @@ "typeMessage" : "incorrect type", "tooltip": "test-short-description", "type" : "string", + "enum" : [true, false], "fieldType": "checkbox", "checkedValue": "yes", "uncheckedValue": "no", diff --git a/bundles/af-core/src/test/resources/form/checkboxgroup/exporter-checkboxgroup-datalayer.json b/bundles/af-core/src/test/resources/form/checkboxgroup/exporter-checkboxgroup-datalayer.json index de77a5d84f..986b3f2b6a 100644 --- a/bundles/af-core/src/test/resources/form/checkboxgroup/exporter-checkboxgroup-datalayer.json +++ b/bundles/af-core/src/test/resources/form/checkboxgroup/exporter-checkboxgroup-datalayer.json @@ -9,12 +9,8 @@ "readOnly": false, "enforceEnum": true, "enumNames": [ - { - "value": "Cat Person" - }, - { - "value": "Dog Person" - } + "Cat Person", + "Dog Person" ], "label": { "value": "Personality" diff --git a/bundles/af-core/src/test/resources/form/checkboxgroup/exporter-checkboxgroup.json b/bundles/af-core/src/test/resources/form/checkboxgroup/exporter-checkboxgroup.json index f82ba6229a..b71aa10538 100644 --- a/bundles/af-core/src/test/resources/form/checkboxgroup/exporter-checkboxgroup.json +++ b/bundles/af-core/src/test/resources/form/checkboxgroup/exporter-checkboxgroup.json @@ -16,15 +16,9 @@ "readOnly": true, "enforceEnum": true, "enumNames": [ - { - "value": "m" - }, - { - "value": "f" - }, - { - "value": "o" - } + "m", + "f", + "o" ], "default": [ 0, diff --git a/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown-1.json b/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown-1.json index b20398a150..60987e7d27 100644 --- a/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown-1.json +++ b/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown-1.json @@ -15,15 +15,9 @@ "readOnly": false, "enforceEnum": true, "enumNames": [ - { - "value": "m" - }, - { - "value": "f" - }, - { - "value": "o" - } + "m", + "f", + "o" ], "label": { "visible": true, diff --git a/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown-datalayer.json b/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown-datalayer.json index f02d9514a7..4b7d3b72e6 100644 --- a/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown-datalayer.json +++ b/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown-datalayer.json @@ -9,12 +9,8 @@ "readOnly": false, "enforceEnum": true, "enumNames": [ - { - "value": "Owl" - }, - { - "value": "Wolf" - } + "Owl", + "Wolf" ], "label": { "value": "Favorite Animal" diff --git a/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown.json b/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown.json index 64e232f04e..7ecce9aa4e 100644 --- a/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown.json +++ b/bundles/af-core/src/test/resources/form/dropdown/exporter-dropdown.json @@ -4,17 +4,7 @@ "name": "abc", "type": "string", "enforceEnum": true, - "enumNames": [ - { - "value": "m" - }, - { - "value": "f" - }, - { - "value": "o" - } - ], + "enumNames": ["m", "f", "o"], "enum": ["0", "1", "2"], "label": { "value": "def" diff --git a/bundles/af-core/src/test/resources/form/dropdown/exporter-multiselect-dropdown.json b/bundles/af-core/src/test/resources/form/dropdown/exporter-multiselect-dropdown.json index 9547715155..43860b3db0 100644 --- a/bundles/af-core/src/test/resources/form/dropdown/exporter-multiselect-dropdown.json +++ b/bundles/af-core/src/test/resources/form/dropdown/exporter-multiselect-dropdown.json @@ -15,15 +15,9 @@ }, "enforceEnum": true, "enumNames": [ - { - "value": "m" - }, - { - "value": "f" - }, - { - "value": "o" - } + "m", + "f", + "o" ], "default": [ 0, diff --git a/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton-customized.json b/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton-customized.json index 7225f64b53..988424436a 100644 --- a/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton-customized.json +++ b/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton-customized.json @@ -16,14 +16,8 @@ }, "enforceEnum": true, "enumNames": [ - { - "richText": true, - "value": "

Item 1

" - }, - { - "richText": true, - "value": "

Item 2

" - } + "Item 1", + "Item 2" ], "default": "0", "screenReaderText": "'custom text'", diff --git a/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton-datalayer.json b/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton-datalayer.json index 870734a41e..6662d77b6d 100644 --- a/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton-datalayer.json +++ b/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton-datalayer.json @@ -9,12 +9,8 @@ "readOnly": false, "enforceEnum": true, "enumNames": [ - { - "value": "Male" - }, - { - "value": "Female" - } + "Male", + "Female" ], "label": { "value": "Gender" diff --git a/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton.json b/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton.json index 9fd2561296..078687521f 100644 --- a/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton.json +++ b/bundles/af-core/src/test/resources/form/radiobutton/exporter-radiobutton.json @@ -5,14 +5,8 @@ "type": "string", "enforceEnum": true, "enumNames": [ - { - "richText": true, - "value": "

Item 1

" - }, - { - "richText": true, - "value": "

Item 2

" - } + "Item 1", + "Item 2" ], "label": { "value": "Radio Button" diff --git a/bundles/af-core/src/test/resources/form/radiobutton/test-content.json b/bundles/af-core/src/test/resources/form/radiobutton/test-content.json index 076198ea4c..d68b10d0c8 100644 --- a/bundles/af-core/src/test/resources/form/radiobutton/test-content.json +++ b/bundles/af-core/src/test/resources/form/radiobutton/test-content.json @@ -8,14 +8,13 @@ "orientation": "vertical", "jcr:lastModifiedBy": "admin", "jcr:created": "Tue Sep 13 2022 15:17:35 GMT+0530", - "areOptionsRichText": true, "enum": [ "0", "1" ], "enumNames": [ - "

Item 1

", - "

Item 2

" + "Item 1", + "Item 2" ], "jcr:lastModified": "Tue Sep 13 2022 15:18:50 GMT+0530", "fieldType": "radio-group" @@ -38,15 +37,14 @@ "dorColspan": "4", "assistPriority": "custom", "jcr:created": "Tue Sep 13 2022 15:17:35 GMT+0530", - "areOptionsRichText": true, "enum": [ "0", "1" ], "type": "string", "enumNames": [ - "

Item 1

", - "

Item 2

" + "Item 1", + "Item 2" ], "visible": false, "readOnly": true, diff --git a/bundles/af-core/src/test/resources/form/switch/exporter-switch-customized.json b/bundles/af-core/src/test/resources/form/switch/exporter-switch-customized.json deleted file mode 100644 index f928d561d6..0000000000 --- a/bundles/af-core/src/test/resources/form/switch/exporter-switch-customized.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "id": "switch-eebab31c57", - "dataRef": "a.b", - "fieldType": "checkbox", - "name": "switch-customized", - "visible": false, - "description": "switch-customized", - "tooltip": "test-short-description", - "type": "string", - "required": true, - "enabled": false, - "constraintMessages": { - "type": "incorrect type" - }, - "readOnly": true, - "enforceEnum": true, - "label": { - "visible": true, - "value": "switch-customized" - }, - "screenReaderText": "'Custom screen reader text'", - "events": { - "custom:setProperty": [ - "$event.payload" - ] - }, - "properties": { - "afs:layout": { - "tooltipVisible": false - }, - "fd:dor": { - "dorExclusion": false - }, - "fd:path": "/content/switch-customized" - }, - "enum": [ - "0", - "1" - ], - "enumNames": [ - { - "value": "OFF" - }, - { - "value": "ON" - } - ], - ":type": "core/fd/components/form/switch/v1/switch" -} diff --git a/bundles/af-core/src/test/resources/form/switch/exporter-switch.json b/bundles/af-core/src/test/resources/form/switch/exporter-switch.json deleted file mode 100644 index 4a173cf3d5..0000000000 --- a/bundles/af-core/src/test/resources/form/switch/exporter-switch.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - ":type": "core/fd/components/form/switch/v1/switch", - "constraintMessages": { - "type": "incorrect type" - }, - "dataRef": "a.b", - "description": "dummy", - "enforceEnum": true, - "enum": [ - "0", - "1" - ], - "enumNames": [ - { - "value": "OFF" - }, - { - "value": "ON" - } - ], - "events": { - "custom:setProperty": [ - "$event.payload" - ] - }, - "fieldType": "checkbox", - "id": "switch-db8ba77543", - "label": { - "value": "def" - }, - "name": "abc", - "properties": { - "afs:layout": { - "tooltipVisible": false - }, - "fd:dor": { - "dorExclusion": false - }, - "fd:path": "/content/switch" - }, - "screenReaderText": "'Custom screen reader text'", - "tooltip": "test-short-description", - "type": "string" -} \ No newline at end of file diff --git a/bundles/af-core/src/test/resources/form/switch/test-content.json b/bundles/af-core/src/test/resources/form/switch/test-content.json deleted file mode 100644 index f87337532b..0000000000 --- a/bundles/af-core/src/test/resources/form/switch/test-content.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "switch" : { - "jcr:primaryType": "nt:unstructured", - "sling:resourceType" : "core/fd/components/form/switch/v1/switch", - "name" : "abc", - "jcr:title" : "def", - "description" : "dummy", - "assistPriority" : "custom", - "dataRef" : "a.b", - "custom" : "Custom screen reader text", - "typeMessage" : "incorrect type", - "tooltip": "test-short-description", - "type" : "string", - "enum": [ - "0", - "1" - ], - "enumNames": [ - "OFF", - "ON" - ], - "enableUncheckedValue": true, - "fieldType": "checkbox", - "fd:rules" : { - "jcr:primaryType": "nt:unstructured" - }, - "fd:events" : { - "jcr:primaryType": "nt:unstructured" - } - }, - "switch-customized" : { - "jcr:primaryType": "nt:unstructured", - "sling:resourceType" : "core/fd/components/form/switch/v1/switch", - "name" : "switch-customized", - "jcr:title" : "switch-customized", - "description" : "switch-customized", - "visible" : false, - "enabled" : false, - "required" : true, - "readOnly" : true, - "hideTitle" : false, - "assistPriority" : "custom", - "dataRef" : "a.b", - "custom" : "Custom screen reader text", - "typeMessage" : "incorrect type", - "tooltip": "test-short-description", - "type" : "string", - "enum": [ - "0", - "1" - ], - "enumNames": [ - "OFF", - "ON" - ], - "fieldType": "checkbox", - "enableUncheckedValue": true, - "fd:rules" : { - "jcr:primaryType": "nt:unstructured" - }, - "fd:events" : { - "jcr:primaryType": "nt:unstructured" - } - }, - "switchNoEnum" : { - "jcr:primaryType": "nt:unstructured", - "sling:resourceType" : "core/fd/components/form/switch/v1/switch", - "name" : "abc", - "jcr:title" : "def", - "description" : "dummy", - "assistPriority" : "custom", - "dataRef" : "a.b", - "custom" : "Custom screen reader text", - "typeMessage" : "incorrect type", - "tooltip": "test-short-description", - "type" : "boolean", - "fieldType": "checkbox", - "enum": [ - "0", - "1" - ], - "enumNames": [ - "OFF", - "ON" - ], - "fd:rules" : { - "jcr:primaryType": "nt:unstructured" - }, - "fd:events" : { - "jcr:primaryType": "nt:unstructured" - } - }, - "switch-enableUncheckedValueFalse" : { - "jcr:primaryType": "nt:unstructured", - "sling:resourceType" : "core/fd/components/form/switch/v1/switch", - "name" : "abc", - "jcr:title" : "def", - "description" : "dummy", - "assistPriority" : "custom", - "dataRef" : "a.b", - "custom" : "Custom screen reader text", - "typeMessage" : "incorrect type", - "tooltip": "test-short-description", - "type" : "string", - "enum": [ - "1" - ], - "enumNames": [ - "ON" - ], - "enableUncheckedValue": false, - "fieldType": "checkbox", - "fd:rules" : { - "jcr:primaryType": "nt:unstructured" - }, - "fd:events" : { - "jcr:primaryType": "nt:unstructured" - } - }, - "switch-boolean" : { - "jcr:primaryType": "nt:unstructured", - "sling:resourceType" : "core/fd/components/form/switch/v1/switch", - "name" : "abc", - "jcr:title" : "def", - "description" : "dummy", - "assistPriority" : "custom", - "dataRef" : "a.b", - "custom" : "Custom screen reader text", - "typeMessage" : "incorrect type", - "tooltip": "test-short-description", - "type" : "boolean", - "enum": [ - true, - false - ], - "enumNames": [ - "true", - "false" - ], - "enableUncheckedValue": true, - "fieldType": "checkbox", - "fd:rules" : { - "jcr:primaryType": "nt:unstructured" - }, - "fd:events" : { - "jcr:primaryType": "nt:unstructured" - } - }, - "switch-enableUncheckedValueFalse-boolean" : { - "jcr:primaryType": "nt:unstructured", - "sling:resourceType" : "core/fd/components/form/switch/v1/switch", - "name" : "abc", - "jcr:title" : "def", - "description" : "dummy", - "assistPriority" : "custom", - "dataRef" : "a.b", - "custom" : "Custom screen reader text", - "typeMessage" : "incorrect type", - "tooltip": "test-short-description", - "type" : "boolean", - "enum": [ - true - ], - "enumNames": [ - "ON" - ], - "enableUncheckedValue": false, - "fieldType": "checkbox", - "fd:rules" : { - "jcr:primaryType": "nt:unstructured" - }, - "fd:events" : { - "jcr:primaryType": "nt:unstructured" - } - } -} diff --git a/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditions.json b/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditions.json deleted file mode 100644 index 9db7aecead..0000000000 --- a/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditions.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "id": "termsandconditions-dac51d5ed9", - "fieldType": "panel", - "name": "termsandconditions1694159302516", - "type": "object", - "properties": { - "fd:dor": { - "dorExclusion": false, - "dorExcludeTitle": false, - "dorExcludeDescription": false - }, - "fd:path": "/content/termsandconditions", - "fd:tnc": true - }, - "label": { - "value": "Terms And Conditions" - }, - "events": { - "custom:setProperty": [ - "$event.payload" - ] - }, - ":itemsOrder": [ - "text", - "approvalcheckbox" - ], - ":items": { - "text": { - "id": "text-37c101fc2b", - "fieldType": "plain-text", - "name": "consenttext", - "value": "Text related to the terms and conditions come here", - "richText": false, - "events": { - "custom:setProperty": [ - "$event.payload" - ] - }, - "properties": { - "fd:path": "/content/termsandconditions/text" - }, - ":type": "core/fd/components/form/text/v1/text" - }, - "approvalcheckbox": { - "id": "checkbox-150eb94d3e", - "fieldType": "checkbox", - "name": "approvalcheckbox", - "type": "string", - "enabled": false, - "enforceEnum": true, - "label": { - "value": "I agree to the terms & conditions" - }, - "events": { - "custom:setProperty": [ - "$event.payload" - ] - }, - "properties": { - "fd:dor": { - "dorExclusion": false - }, - "fd:path": "/content/termsandconditions/approvalcheckbox" - }, - "enum": [ - "true" - ], - ":type": "core/fd/components/form/checkbox/v1/checkbox" - } - }, - ":type": "core/fd/components/form/termsandconditions/v1/termsandconditions" -} diff --git a/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditionsNoWrapData.json b/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditionsNoWrapData.json deleted file mode 100644 index b7a56e1246..0000000000 --- a/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditionsNoWrapData.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "id": "termsandconditions-5e021cc31d", - "fieldType": "panel", - "name": "termsandconditions1694159302516", - "properties": { - "fd:dor": { - "dorExclusion": false, - "dorExcludeTitle": false, - "dorExcludeDescription": false - }, - "fd:path": "/content/termsandconditionsNoWrapData", - "fd:tnc": true - }, - "label": { - "value": "Terms And Conditions" - }, - "events": { - "custom:setProperty": [ - "$event.payload" - ] - }, - ":itemsOrder": [ - "approvalcheckbox", - "link" - ], - ":items": { - "approvalcheckbox": { - "id": "checkbox-9d01a4893a", - "fieldType": "checkbox", - "name": "approvalcheckbox", - "type": "string", - "enabled": false, - "enforceEnum": true, - "label": { - "value": "I agree to the terms & conditions" - }, - "events": { - "custom:setProperty": [ - "$event.payload" - ] - }, - "properties": { - "fd:dor": { - "dorExclusion": false - }, - "fd:path": "/content/termsandconditionsNoWrapData/approvalcheckbox" - }, - "enum": [ - "true" - ], - ":type": "core/fd/components/form/checkbox/v1/checkbox" - }, - "link": { - "id": "checkboxgroup-577c0892d3", - "fieldType": "checkbox-group", - "name": "link1694159323342", - "type": "string", - "enforceEnum": true, - "label": { - "value": "" - }, - "events": { - "custom:setProperty": [ - "$event.payload" - ] - }, - "properties": { - "afs:layout": { - "orientation": "vertical" - }, - "fd:dor": { - "dorExclusion": false - }, - "fd:path": "/content/termsandconditionsNoWrapData/link" - }, - "enum": [ - "yourlink" - ], - ":type": "core/fd/components/form/checkboxgroup/v1/checkboxgroup", - "enumNames": [ - { - "value": "label for the link" - } - ] - } - }, - ":type": "core/fd/components/form/termsandconditions/v1/termsandconditions" -} diff --git a/bundles/af-core/src/test/resources/form/termsandconditions/test-content.json b/bundles/af-core/src/test/resources/form/termsandconditions/test-content.json deleted file mode 100644 index b7ef1cf3c5..0000000000 --- a/bundles/af-core/src/test/resources/form/termsandconditions/test-content.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "termsandconditions": { - "showApprovalOption": true, - "jcr:title": "Terms And Conditions", - "fd:tnc": true, - "showAsPopup": true, - "name": "termsandconditions1694159302516", - "sling:resourceType": "core/fd/components/form/termsandconditions/v1/termsandconditions", - "wrapData": true, - "fieldType": "panel", - "text": { - "jcr:primaryType": "nt:unstructured", - "jcr:title": "", - "name": "consenttext", - "value": "Text related to the terms and conditions come here", - "hideTitle": "true", - "sling:resourceType": "core/fd/components/form/text/v1/text", - "fieldType": "plain-text" - }, - "approvalcheckbox": { - "jcr:primaryType": "nt:unstructured", - "jcr:title": "I agree to the terms & conditions", - "enabled": "false", - "name": "approvalcheckbox", - "checkedValue": "true", - "sling:resourceType": "core/fd/components/form/checkbox/v1/checkbox", - "fieldType": "checkbox" - }, - "link": { - "jcr:primaryType": "nt:unstructured", - "jcr:title": "", - "orientation": "vertical", - "enum": [ - "yourlink" - ], - "name": "link1694159323342", - "title": "I agree to the terms & conditions", - "enumNames": [ - "label for the link" - ], - "sling:resourceType": "core/fd/components/form/checkboxgroup/v1/checkboxgroup", - "fieldType": "checkbox-group" - } - }, - "termsandconditionsNoWrapData": { - "showApprovalOption": true, - "jcr:title": "Terms And Conditions", - "fd:tnc": true, - "showAsPopup": true, - "showLink": true, - "name": "termsandconditions1694159302516", - "sling:resourceType": "core/fd/components/form/termsandconditions/v1/termsandconditions", - "wrapData": false, - "fieldType": "panel", - "text": { - "jcr:primaryType": "nt:unstructured", - "jcr:title": "", - "name": "consenttext", - "value": "Text related to the terms and conditions come here", - "hideTitle": "true", - "sling:resourceType": "core/fd/components/form/text/v1/text", - "fieldType": "plain-text" - }, - "approvalcheckbox": { - "jcr:primaryType": "nt:unstructured", - "jcr:title": "I agree to the terms & conditions", - "enabled": "false", - "name": "approvalcheckbox", - "checkedValue": "true", - "sling:resourceType": "core/fd/components/form/checkbox/v1/checkbox", - "fieldType": "checkbox" - }, - "link": { - "jcr:primaryType": "nt:unstructured", - "jcr:title": "", - "orientation": "vertical", - "enum": [ - "yourlink" - ], - "name": "link1694159323342", - "title": "I agree to the terms & conditions", - "enumNames": [ - "label for the link" - ], - "sling:resourceType": "core/fd/components/form/checkboxgroup/v1/checkboxgroup", - "fieldType": "checkbox-group" - } - } -} diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/checkbox.less b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/checkbox.less deleted file mode 100644 index e46730b395..0000000000 --- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/checkbox.less +++ /dev/null @@ -1,17 +0,0 @@ -.cmp-adaptiveform-checkbox { - .containerMixin(); - .descriptionMixin(); - .validInvalidMixin(); - &__help-container { - flex-direction: row-reverse; - display: flex - } - &__widget-container { - flex-direction: row; - align-items: baseline; - display: flex - } - &__widget { - .itemWidgetMixin(); - } -} diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/common.less b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/common.less index dea4b4ef21..8343a735e9 100644 --- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/common.less +++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/common.less @@ -170,16 +170,4 @@ background: url(./resources/tick_hover.svg) 0.5rem 50% / 0.8125rem no-repeat,@very-light-gray; background-size: 12px; } -} - -.termsAndConditionsText() { - color: @light-gray; - max-height: 160px; - border: 1px solid #ccc; - border-radius: .25rem; - margin-bottom: .25rem; - padding-left: 1rem; - padding-right: 1rem; - font-size: .875rem; - overflow: auto -} +} \ No newline at end of file diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/termsandconditions.less b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/termsandconditions.less deleted file mode 100644 index 553e85c019..0000000000 --- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/termsandconditions.less +++ /dev/null @@ -1,18 +0,0 @@ -.cmp-adaptiveform-termsandcondition { - .containerMixin(); - &__label { - flex: 1; - font-size: 1.25rem - } - &__label-container { - justify-content: space-between; - align-items: center; - display: flex - } - &____content-container { - margin-top: 10px - } - &__text { - .termsAndConditionsText(); - } -} diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/index.less b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/index.less index 8cce5935ee..16144c9e01 100644 --- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/index.less +++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/clientlibs/forms-clientlib-site/styles/components/index.less @@ -37,5 +37,3 @@ @import 'adaptive-form/title.less'; @import 'adaptive-form/wizard.less'; @import 'adaptive-form/verticaltabs.less'; -@import 'adaptive-form/checkbox.less'; -@import 'adaptive-form/termsandconditions.less'; diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/emailinput/_cq_template.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/emailinput/_cq_template.xml index b9e9d87e14..f097d0d61d 100644 --- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/emailinput/_cq_template.xml +++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/emailinput/_cq_template.xml @@ -2,5 +2,4 @@ diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/pageheader/_cq_template.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/pageheader/_cq_template.xml index 9c604fe58f..71337b2882 100644 --- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/pageheader/_cq_template.xml +++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/pageheader/_cq_template.xml @@ -20,7 +20,9 @@ fieldType="page-header"> + jcr:title="Logo" + sling:resourceType="wcm/foundation/components/image" + name="logoImage"/> - \ No newline at end of file diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/switch/_cq_template.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/switch/_cq_template.xml deleted file mode 100644 index 1291bb47f0..0000000000 --- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/switch/_cq_template.xml +++ /dev/null @@ -1,7 +0,0 @@ - - \ No newline at end of file diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/termsandconditions/.content.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/termsandconditions/.content.xml deleted file mode 100644 index 9390fcd533..0000000000 --- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/termsandconditions/.content.xml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/termsandconditions/_cq_template/.content.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/termsandconditions/_cq_template/.content.xml deleted file mode 100644 index 95a10387e4..0000000000 --- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/termsandconditions/_cq_template/.content.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - diff --git a/examples/ui.content/src/main/content/jcr_root/conf/core-components-examples/settings/wcm/policies/.content.xml b/examples/ui.content/src/main/content/jcr_root/conf/core-components-examples/settings/wcm/policies/.content.xml index c16f4c344c..8af95469c2 100644 --- a/examples/ui.content/src/main/content/jcr_root/conf/core-components-examples/settings/wcm/policies/.content.xml +++ b/examples/ui.content/src/main/content/jcr_root/conf/core-components-examples/settings/wcm/policies/.content.xml @@ -206,35 +206,6 @@ jcr:primaryType="nt:unstructured"/> - - - - - - - - - - - - - - - diff --git a/examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/adaptive-form/.content.xml b/examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/adaptive-form/.content.xml index 65ace20958..d7c73deb0c 100644 --- a/examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/adaptive-form/.content.xml +++ b/examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/adaptive-form/.content.xml @@ -30,7 +30,6 @@ - diff --git a/examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/adaptive-form/switch/.content.xml b/examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/adaptive-form/switch/.content.xml deleted file mode 100644 index 48385b4ff9..0000000000 --- a/examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/adaptive-form/switch/.content.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/adaptive-form/termsandconditions/.content.xml b/examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/adaptive-form/termsandconditions/.content.xml deleted file mode 100644 index 824a08cbbb..0000000000 --- a/examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/adaptive-form/termsandconditions/.content.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/de.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/de.xml index 0184cfce56..04ee0e1ebd 100755 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/de.xml +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/de.xml @@ -129,21 +129,6 @@ jcr:primaryType="nt:folder" sling:key="guideContainer##wizard##jcr:title##299" sling:message="Zauberer"/> - <_x0039_6b6493f-b93e-4b2d-8b38-3633a3fe6286 - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##jcr:title##3329" - sling:message="<p><b>Tier auswählen</b></p>"/> - - <_x0037_c44f84b-8830-4270-ba63-8aa9de935572 - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##1" - sling:message="<p><u>Katze</u></p>"/> - - - <_x0031_33de41e-050d-4628-8b22-34b8b6dfa9fa - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##1" - sling:message="<p><u>Gato</u></p>"/> - - <_x0037_e28c9de-7712-4f7b-969d-0c90f92935af - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##0" - sling:message="<p><i>Chien</i></p>"/> - <_x0032_869e60b-f2eb-4e35-8d17-0673f7d870bc - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##1" - sling:message="<p><u>Chat</u></p>"/> diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/hi.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/hi.xml index 9ab5e0f0b2..81f80c0637 100755 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/hi.xml +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/hi.xml @@ -129,19 +129,4 @@ jcr:primaryType="nt:folder" sling:key="guideContainer##wizard##jcr:title##299" sling:message="जादूगर"/> - <_x0035_3786ca1-ac18-4151-8e13-db1ec440cb44 - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##jcr:title##3329" - sling:message="<p><b>पशु का चयन करें</b></p>"/> - - diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/it.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/it.xml index 06a9c39887..88d4a55147 100755 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/it.xml +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/it.xml @@ -129,19 +129,4 @@ jcr:primaryType="nt:folder" sling:key="guideContainer##wizard##jcr:title##299" sling:message="mago"/> - <_x0038_fa19b1d-324d-453f-895f-60c86adb001c - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##jcr:title##3329" - sling:message="<p><b>Seleziona animale</b></p>"/> - <_x0030_ac73bc4-9c29-470f-9a99-a1c7f685a5b9 - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##0" - sling:message="<p><i>Cane</i></p>"/> - <_x0038_23d3ccb-d875-4a8d-9ff9-2a2859d7bdbd - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##1" - sling:message="<p><u>Gatto</u></p>"/> diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ja.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ja.xml index 10e9a6fce7..5ade060385 100755 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ja.xml +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ja.xml @@ -129,19 +129,4 @@ jcr:primaryType="nt:folder" sling:key="guideContainer##wizard##jcr:title##299" sling:message="魔法使い"/> - <_x0030_9640d23-a956-457d-82fa-671bf0750fce - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##jcr:title##3329" - sling:message="<p><b>動物を選択</b></p>"/> - - <_x0038_a1f5c5f-4a24-4c48-a433-ce761870bbb1 - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##1" - sling:message="<p><u>猫</u></p>"/> diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ko-kr.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ko-kr.xml index c68ecb7698..4650cd9bff 100755 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ko-kr.xml +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ko-kr.xml @@ -129,19 +129,4 @@ jcr:primaryType="nt:folder" sling:key="guideContainer##wizard##jcr:title##299" sling:message="마법사"/> - <_x0030_d52109d-2260-4962-b0a4-a589fceb42cd - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##jcr:title##3329" - sling:message="<p><b>동물 선택</b></p>"/> - <_x0030_ab74673-ed86-4d13-853e-86fbcb638588 - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##0" - sling:message="<p><i>개</i></p>"/> - diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/pt-br.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/pt-br.xml index 6f41b8ee49..59242cfbb7 100755 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/pt-br.xml +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/pt-br.xml @@ -129,19 +129,4 @@ jcr:primaryType="nt:folder" sling:key="guideContainer##wizard##jcr:title##299" sling:message="mago"/> - - <_x0031_b25629c-4816-4847-a9d1-63e421b47930 - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##0" - sling:message="<p><i>Cão</i></p>"/> - diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ru-ru.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ru-ru.xml index 67653db508..855f673d2b 100755 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ru-ru.xml +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/ru-ru.xml @@ -129,19 +129,4 @@ jcr:primaryType="nt:folder" sling:key="guideContainer##wizard##jcr:title##299" sling:message="колдун"/> - - - <_x0038_d8b15a1-c3c9-4816-abd6-7e69bc3c477a - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##1" - sling:message="<p><u>Кошка</u></p>"/> diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/zh-cn.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/zh-cn.xml index edd3fd1865..ff03638494 100755 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/zh-cn.xml +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/zh-cn.xml @@ -129,19 +129,4 @@ jcr:primaryType="nt:folder" sling:key="guideContainer##wizard##jcr:title##299" sling:message="巫师"/> - <_x0034_6fd8a2d-db44-4204-aca8-a4e8ecb178f7 - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##jcr:title##3329" - sling:message="<p><b>选择动物</b></p>"/> - - <_x0037_79cf790-b54b-429e-b5b2-ebed6ea0cbb7 - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##1" - sling:message="<p><u>猫</u></p>"/> diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/zh-tw.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/zh-tw.xml index d317556721..fd7a76f7e6 100755 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/zh-tw.xml +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/af2-form-translation/_jcr_content/dictionary/zh-tw.xml @@ -129,19 +129,4 @@ jcr:primaryType="nt:folder" sling:key="guideContainer##wizard##jcr:title##299" sling:message="巫師"/> - <_x0036_0c96847-776f-406a-9de3-a669f70ca113 - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##jcr:title##3329" - sling:message="<p><b>選擇動物</b></p>"/> - <_x0037_75e6e65-0828-4020-95f6-355249b69aaf - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##0" - sling:message="<p><i>狗</i></p>"/> - <_x0030_a911e93-4cd9-416d-ac7a-1f348014bbed - jcr:mixinTypes="[sling:Message]" - jcr:primaryType="nt:folder" - sling:key="guideContainer##checkboxgroup7##enumNames##7570##1" - sling:message="<p><u>貓</u></p>"/> diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/setfocus/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/setfocus/.content.xml deleted file mode 100644 index b35abde581..0000000000 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/setfocus/.content.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/termsandconditions/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/termsandconditions/.content.xml deleted file mode 100755 index 7256712059..0000000000 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/termsandconditions/.content.xml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/termsandconditions/basic/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/termsandconditions/basic/.content.xml deleted file mode 100755 index 109206d96b..0000000000 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/termsandconditions/basic/.content.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/accessibility/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/accessibility/.content.xml index d967a6f18e..a08ef85bd0 100644 --- a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/accessibility/.content.xml +++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/accessibility/.content.xml @@ -2692,26 +2692,6 @@ name="text1685010111735" textIsRich="true" value="<p><strong style="font-size: 1rem;">I understand that</strong>:<br> </p> <ul> <li>Child Support can make relevant enquiries to make sure I receive the correct entitlement.</li> <li>giving false or misleading information is a serious offence.</li> </ul>"/> - - diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/checkboxgroup/basic/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/checkboxgroup/basic/.content.xml index 9dc2b02920..30e1d78040 100755 --- a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/checkboxgroup/basic/.content.xml +++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/checkboxgroup/basic/.content.xml @@ -153,28 +153,6 @@ textIsRich="[true,true]" type="number[]" visible="{Boolean}true"/> - diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/emailinput/basic/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/emailinput/basic/.content.xml index a18c2ced25..8eab359537 100755 --- a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/emailinput/basic/.content.xml +++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/emailinput/basic/.content.xml @@ -20,7 +20,7 @@ jcr:primaryType="nt:unstructured" name="emailinput1" jcr:title="Email Input 1" - pattern="^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$" + pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$" validatePictureClauseMessage="validation picture clause error message!" sling:resourceType="forms-components-examples/components/form/emailinput"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/switch/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/switch/.content.xml deleted file mode 100755 index 8f415a05ec..0000000000 --- a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/switch/.content.xml +++ /dev/null @@ -1,5 +0,0 @@ - -