Skip to content

Commit

Permalink
Merge pull request #945 from adobe/revert-928-adobe/devToMaster
Browse files Browse the repository at this point in the history
Revert "Adobe/dev to master"
  • Loading branch information
barshat7 authored Oct 25, 2023
2 parents 83db0b4 + 6d3891c commit 4102846
Show file tree
Hide file tree
Showing 196 changed files with 297 additions and 6,837 deletions.
6 changes: 0 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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 },
Expand All @@ -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<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);
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand All @@ -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;
}

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

import org.osgi.annotation.versioning.ProviderType;

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

/**
Expand Down Expand Up @@ -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();
}

This file was deleted.

Loading

0 comments on commit 4102846

Please sign in to comment.