Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adobe/dev to master #948

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
49885cf
Update af-core version (#900)
ravise5 Oct 3, 2023
cf7eb2e
Fixing versions.md script (#906)
rismehta Oct 4, 2023
7b6fbd7
FORMS-11162 - Accessibility Issue - Forms iframe head tag issue (#907)
pankaj-parashar Oct 5, 2023
6b84a82
FORMS-3696 adding rich text support for labels (#904)
im-shiv Oct 6, 2023
cc27b26
fix multiple form embedded issue in site page (#909)
amit-mnnit Oct 9, 2023
08189ee
FORMS-11284 fixing enum name display on hide (#911)
im-shiv Oct 9, 2023
f46f89a
Terms and Conditions Component (#889)
barshat7 Oct 10, 2023
e6bd194
use wcm image for integration testing (#917)
barshat7 Oct 10, 2023
5775ec0
FORMS-11340 adding locale test case for rich text (#918)
im-shiv Oct 11, 2023
e70eb15
Terms and Conditions: string change in edit dialog (#919)
barshat7 Oct 11, 2023
de50c02
Forms 7896 switch component2 (#878)
egmox Oct 11, 2023
822d352
FORMS-10078: updated default pattern to align with v1 (#820)
egmox Oct 11, 2023
d2bb9c5
FORMS-10978 - Support for Qualified name in core components (#901)
TalmizAhmed Oct 12, 2023
e58a50c
Example Canvas Themes for CheckbBox and TermsAndConditions
Oct 13, 2023
442e776
FORMS-11128 Localized Add Item string (#923)
girotraapankaj Oct 13, 2023
74cee3b
Merge pull request #924 from adobe/checkbox_tnc_example_themes
barshat7 Oct 13, 2023
2f83127
Forms-11276 : Text component does not appear in the viewport when the…
AnurudraS Oct 13, 2023
80d54f6
unhide checkbox, termsandconditions, switch (#927)
barshat7 Oct 13, 2023
1748210
fixed switch rich text issue (#929)
egmox Oct 16, 2023
dd2bb89
FORMS-11402 fixing initial rte value copying (#930)
im-shiv Oct 16, 2023
3c45dde
added theme for aem corecomponents.dev (#931)
egmox Oct 17, 2023
34fa341
overriding default height of rte editor (#938)
im-shiv Oct 19, 2023
d7102d9
replaced foundation image and text with wcm core components (#939)
egmox Oct 19, 2023
069b503
Setfocus issuefixes (#936)
barshat7 Oct 19, 2023
f4700ed
revert switch component
Oct 20, 2023
6a5d154
changed based on only checkbox
Oct 20, 2023
1274abb
revert-switch test coverage fix
Oct 20, 2023
ff965f1
Merge pull request #940 from adobe/revert-switch
barshat7 Oct 20, 2023
af3a1a7
Merge branch 'master' into adobe/devToMaster
barshat7 Oct 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ jobs:
# update readme.md
sed -i -E "s/(\| $LAST_VERSION\s*\|) [0-9]+\.[0-9]+\.[0-9]+ \s*\| /| $NEW_VERSION | $WCM_CORE_COMPONENTS_VERSION | /g" README.md

# Check if package-lock.json is modified
if [[ $(git status --porcelain | grep "package-lock.json") ]]; then
# Discard the changes to package-lock.json (if needed)
git checkout -- '**/package-lock.json'
fi

git add VERSIONS.md README.md
git commit -m "Update VERSIONS.md and README.md to include version ${NEW_VERSION}"
git push origin $RELEASE_BRANCH
Expand Down
2 changes: 1 addition & 1 deletion bundles/af-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -678,4 +678,4 @@
</developer>
</developers>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ 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";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2022 Adobe
~ 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.
Expand All @@ -15,25 +15,16 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
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.AbstractOptionsFieldImpl;
import com.adobe.cq.forms.core.components.util.ComponentUtils;
import com.adobe.cq.forms.core.components.util.AbstractCheckboxImpl;

@Model(
adaptables = { SlingHttpServletRequest.class, Resource.class },
Expand All @@ -42,54 +33,4 @@
@Exporter(
name = ExporterConstants.SLING_MODEL_EXPORTER_NAME,
extensions = ExporterConstants.SLING_MODEL_EXTENSION)
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<String, Object> getCustomLayoutProperties() {
Map<String, Object> 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);
}
}
}
public class CheckBoxImpl extends AbstractCheckboxImpl implements CheckBox {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ 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<String, Object> getProperties() {
Map<String, Object> properties = super.getProperties();
if (resource.getValueMap().containsKey(CUSTOM_TNC_PROPERTY)) {
properties.put(CUSTOM_TNC_PROPERTY, true);
}
return properties;
}

@Override
protected List<Resource> getFilteredChildrenResources() {
List<Resource> 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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,10 @@
/**
* Interface for a label
*
* @since com.adobe.cq.forms.core.components.models.form 0.0.1
* @since com.adobe.cq.forms.core.components.models.form 4.6.0
*/
@ConsumerType
public interface Label {

/**
* Returns {@code true} if label is rich text, otherwise {@code false}.
*
* @return {@code true} if label is rich text, otherwise {@code false}
* @since com.adobe.cq.forms.core.components.models.form 0.0.1
*/
@Nullable
default Boolean isRichText() {
return null;
}
public interface Label extends TextContent {

/**
* Returns {@code true} if label should be visible, otherwise {@code false}.
Expand All @@ -48,15 +37,4 @@ default Boolean isVisible() {
return null;
}

/**
* Returns the value of this label.
*
* @return the value of this label
* @since com.adobe.cq.forms.core.components.models.form 0.0.1
*/
@Nullable
default String getValue() {
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.osgi.annotation.versioning.ProviderType;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
Expand Down Expand Up @@ -57,5 +58,17 @@ default boolean isEnforceEnum() {
* @return the list of enum names
* @since com.adobe.cq.forms.core.components.models.form 0.0.1
*/
@Deprecated
@JsonIgnore
String[] getEnumNames();

/**
* Returns a list of RichText to be displayed to the end user.
* The length of enum and enumNames array must match
*
* @return the list of enum names
* @since com.adobe.cq.forms.core.components.models.form 4.6.0
*/
@JsonProperty("enumNames")
TextContent[] getEnumNamesAsTextContent();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ 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();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2023 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
package com.adobe.cq.forms.core.components.models.form;

import org.jetbrains.annotations.Nullable;
import org.osgi.annotation.versioning.ProviderType;

/**
* Interface to represent text as rich content
*
* @since com.adobe.cq.forms.core.components.models.form 4.6.0
*/
@ProviderType
public interface TextContent {

/**
* Returns {@code true} if text is rich, otherwise {@code false}.
*
* @return {@code true} if text is rich, otherwise {@code false}
* @since com.adobe.cq.forms.core.components.models.form 4.6.0
*/
@Nullable
default Boolean isRichText() {
return null;
}

/**
* Returns a user friendly text to display for the possible options to be shown to the end user.
*
* @return the content of this text
* @since com.adobe.cq.forms.core.components.models.form 4.6.0
*/
@Nullable
default String getValue() {
return null;
}

}
Loading
Loading