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

Theme editor changes #1477

Open
wants to merge 49 commits into
base: ThemeEditorSupportCC
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1f2b8df
fixing flaky test (#1450)
im-shiv Oct 18, 2024
81f1f81
Fixing vulnerability in GH action (#1452)
rismehta Oct 19, 2024
8498814
Translation support for strings in switch (#1456)
pavi41 Oct 22, 2024
d652a8b
Configured custom validation messages in file attachment (#1459)
pavi41 Oct 23, 2024
ae68f51
Fixing gh workflow (#1460)
rismehta Oct 23, 2024
d0c158a
Move areOptionsRichText above Options (#1465)
anshikag-adobe Oct 24, 2024
5092694
FORMS-17046 Focus on panel with static text not working via custom fu…
rismehta Oct 24, 2024
6bbccfc
FORMS-15852 xss security fix for svg upload in file attachment (#1462)
rajatofficial Oct 28, 2024
58264b8
FORMS-17068 Fetch custom properties from CoreComponentCustomPropertie…
girotraapankaj Oct 29, 2024
7c29f5d
sanitized text should have target attribute in links (#1463)
im-shiv Nov 4, 2024
67c19ad
FORMS-17091 initializing label in button view (#1471)
im-shiv Nov 6, 2024
f022b22
Fixing GH workflow (#1472)
rismehta Nov 6, 2024
ac662e9
[FORMS-13474] HTML5 datalist enhancement in dropdown component (#1470)
anshikag-adobe Nov 7, 2024
146b814
custom function registration using action url from backend (#1469)
barshat7 Nov 8, 2024
5a4284a
Revert "[FORMS-13474] HTML5 datalist enhancement in dropdown componen…
rismehta Nov 8, 2024
cb3d09d
Moving CI to latest rotary image (#1475)
rismehta Nov 12, 2024
84199fc
Merge pull request #1479 from adobe/dev-to-master-15-Nov-24
rismehta Nov 15, 2024
cbf1bec
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
barshat7 Nov 15, 2024
fc0f207
@releng [maven-scm] :prepare for next development iteration
barshat7 Nov 15, 2024
cda3a4c
Update VERSIONS.md and README.md to include version 3.0.72
Nov 15, 2024
b04af84
Theme Editor POC CC Style Configs
Jul 21, 2024
4a73f66
Fixed minor bug for base error class selector
Jul 21, 2024
d3efcd0
Adding style config for hCaptcha and reCaptcha
Jul 22, 2024
8c02cf9
Updating style for Buttons
Jul 24, 2024
fefe869
Updating style for Footer
Jul 24, 2024
f7dfd90
Updated style for Checkbox
Jul 24, 2024
9100359
Updating style for input components
Jul 24, 2024
f689d89
Updating style for file input
Jul 24, 2024
e33e44d
Updating style for image
Jul 24, 2024
e4f4577
Updating style for radio button
Jul 25, 2024
4ad8689
Updating style for switch
Jul 25, 2024
b8cb312
Updating style for tnc
Jul 25, 2024
f7151a7
Updating style for captcha
Jul 25, 2024
7b7376f
Updating style for email and accordion
Jul 25, 2024
dbdcd0e
Updating style for wizard
Jul 29, 2024
9084cbd
Updating style for tabsontop
Jul 29, 2024
cdd5552
Updating style for vertical tabs
Jul 29, 2024
fb03428
Updating style for panel container
Jul 29, 2024
6e056ab
Updating themeConfig of container
Jul 29, 2024
66b48bd
updating style for base
Jul 29, 2024
ce98e17
Updating ids for theme editor support
Oct 16, 2024
c6fc345
Updating reference to core components
Oct 17, 2024
c0d9c9c
Clientlib changes
Nov 4, 2024
ff8cf40
Updating labels for UI
Nov 6, 2024
c82c3bc
Removing GuideException
Nov 13, 2024
89c25f2
Additions in CheckboxGroup style config
Nov 14, 2024
e3b3fa7
Updating VERTICAL and HORIZONTAL classes for checkbox and radiobutton
Nov 21, 2024
ef62442
Updating errormessage div styles for components
Nov 21, 2024
d99ae6b
Updating error and success states for components
Nov 22, 2024
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
2 changes: 1 addition & 1 deletion .circleci/ci/it-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ try {

//todo: remove this later, once aem image is released, since sites rotary aem base image has "2.25.4"
//let wcmVersion = ci.sh('mvn help:evaluate -Dexpression=core.wcm.components.version -q -DforceStdout', true);
let wcmVersion = "2.26.0";
let wcmVersion = "2.27.0";
ci.stage("Integration Tests");
ci.dir(qpPath, () => {
// Connect to QP
Expand Down
2 changes: 1 addition & 1 deletion .circleci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
entrypoint: tail -f /dev/null # Keeps the container running

circleci-aem-cloudready:
image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:17689-rel-openjdk11
image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:c3484b0d7a-openjdk11
depends_on:
- circleci-qp
# Add any additional configurations or environment variables if needed
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/exporter-validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
head_file=$(git show ${{ github.head_ref }}:$file)

# Compare the JSON keys
base_keys=$(echo "$base_file" | jq -r 'paths | map(tostring) | join(".")')
head_keys=$(echo "$head_file" | jq -r 'paths | map(tostring) | join(".")')
base_keys=$(echo "$base_file" | jq -r 'paths | map(tostring) | join(".")' | sed 's/\./\\./g')
head_keys=$(echo "$head_file" | jq -r 'paths | map(tostring) | join(".")' | sed 's/\./\\./g')

# Check for removed keys
removed_keys=$(comm -23 <(echo "$base_keys" | sort) <(echo "$head_keys" | sort))
Expand All @@ -45,11 +45,11 @@ jobs:
echo "$removed_keys"
exit 1
fi

# Check for changed values
for key in $base_keys; do
base_value=$(echo "$base_file" | jq -r ".$key")
head_value=$(echo "$head_file" | jq -r ".$key")
base_value=$(echo "$base_file" | jq -r --arg key "$key" '.[$key]')
head_value=$(echo "$head_file" | jq -r --arg key "$key" '.[$key]')

if [ "$base_value" != "$head_value" ]; then
echo "Backward incompatibility change detected in $file. The value of key '$key' was changed from '$base_value' to '$head_value'."
Expand All @@ -59,4 +59,4 @@ jobs:
done

echo "All exporter JSON files have only additions. No backward incompatibility changes detected."
shell: bash
shell: bash
25 changes: 20 additions & 5 deletions .github/workflows/spec-validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,34 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Validate branch names
id: validate
run: |
echo "Validating branch names..."
if ! [[ "${{ github.event.pull_request.head.ref }}" =~ ^[a-zA-Z0-9._/-]+$ ]]; then
echo "Invalid characters in head ref"
exit 1
fi
if ! [[ "${{ github.event.pull_request.base.ref }}" =~ ^[a-zA-Z0-9._/-]+$ ]]; then
echo "Invalid characters in base ref"
exit 1
fi
echo "::set-output name=head_ref::${{ github.event.pull_request.head.ref }}"
echo "::set-output name=base_ref::${{ github.event.pull_request.base.ref }}"

- name: Fetch Base and Head References
run: |
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
git fetch origin ${{ github.head_ref }}:${{ github.head_ref }}
git fetch origin ${{ steps.validate.outputs.head_ref }}:${{ steps.validate.outputs.head_ref }}
git fetch origin ${{ steps.validate.outputs.base_ref }}:${{ steps.validate.outputs.base_ref }}
if: github.event_name == 'pull_request'

- name: Validate Changes and Commit Message
run: |
# Check for changes in specification files inside the resources folder
changed_files=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }})
changed_files=$(git diff --name-only ${{ steps.validate.outputs.base_ref }} ${{ steps.validate.outputs.head_ref }})

# Fetch the commit messages from the PR
commit_messages=$(git log --pretty=oneline ${{ github.base_ref }}..${{ github.head_ref }})
commit_messages=$(git log --pretty=oneline ${{ steps.validate.outputs.base_ref }}..${{ steps.validate.outputs.head_ref }})

# Check if any commit message contains a specific keyword or pattern (e.g., "RTC")
if echo "$commit_messages" | grep -q 'RTC' && echo "$changed_files" | grep -E 'resources/schema/.*\.json$'; then
Expand All @@ -34,4 +49,4 @@ jobs:
echo "Either commit message doesn't contain 'RTC' keyword or specification files haven't changed. Build failed. Please check if your changes are working in visual rule editor"
exit 1
fi
shell: bash
shell: bash
30 changes: 23 additions & 7 deletions .github/workflows/sync-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,31 @@ jobs:
git config --global user.email "ci-build@aemforms"
git config --global user.name "ci-build"

- name: Validate branch names
id: validate
run: |
echo "Validating branch names..."
if ! [[ "${{ github.event.pull_request.head.ref }}" =~ ^[a-zA-Z0-9._/-]+$ ]]; then
echo "Invalid characters in head ref"
exit 1
fi
if ! [[ "${{ github.event.pull_request.base.ref }}" =~ ^[a-zA-Z0-9._/-]+$ ]]; then
echo "Invalid characters in base ref"
exit 1
fi
echo "::set-output name=head_ref::${{ github.event.pull_request.head.ref }}"
echo "::set-output name=base_ref::${{ github.event.pull_request.base.ref }}"

- name: Sync with Base Branch
if: ${{ github.event.pull_request.base.ref != 'master' }}
run: |
git fetch origin
git checkout ${{ github.event.pull_request.base.ref }}
git pull origin ${{ github.event.pull_request.base.ref }}
git checkout ${{ github.event.pull_request.head.ref }}
git pull origin ${{ github.event.pull_request.head.ref }}
git rebase ${{ github.event.pull_request.base.ref }}
git push --force origin ${{ github.event.pull_request.head.ref }}
git fetch origin ${{ steps.validate.outputs.head_ref }}
git fetch origin ${{ steps.validate.outputs.base_ref }}
git checkout ${{ steps.validate.outputs.base_ref }}
git pull origin ${{ steps.validate.outputs.base_ref }}
git checkout ${{ steps.validate.outputs.head_ref }}
git pull origin ${{ steps.validate.outputs.head_ref }}
git rebase ${{ steps.validate.outputs.base_ref }}
git push --force origin ${{ steps.validate.outputs.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The latest version of the AEM Forms Core Components, require the below minimum s

| Forms Core Components | WCM Core Components | AEM Forms as a cloud service | Java | Maven |
|-----------------------|---------------------| ---------------------------- | ----- | ------ |
| 3.0.70 | 2.24.6 | Continual | 11 | 3.3.9+ |
| 3.0.72 | 2.24.6 | Continual | 11 | 3.3.9+ |

For a list of requirements for previous versions, see [Historical System Requirements](VERSIONS.md).

Expand Down
1 change: 1 addition & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ See below for a full list of minimum system requirements for historical versions

| Forms Core Components | WCM Core Components | AEM Forms as a cloud service | Java | Maven |
|-----------------------|---------------------| ---------------------------- | ----- | ------ |
| 3.0.72 | 2.24.6 | Continual | 11 | 3.3.9+ |
| 3.0.70 | 2.24.6 | Continual | 11 | 3.3.9+ |
| 3.0.68 | 2.24.6 | Continual | 11 | 3.3.9+ |
| 3.0.66 | 2.24.6 | Continual | 11 | 3.3.9+ |
Expand Down
2 changes: 1 addition & 1 deletion all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-parent</artifactId>
<version>3.0.71-SNAPSHOT</version>
<version>3.0.73-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

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 @@ -20,7 +20,7 @@
<parent>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-parent</artifactId>
<version>3.0.71-SNAPSHOT</version>
<version>3.0.73-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.adobe.cq.forms.core.components.internal.constants;

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2024 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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

public class ThemeConstants {

public static final String RELATIVE_PATH_METADATA = "/metadata";
public static final String THEME_OVERRIDE = "themeOverride";
public static final String THEME_REF = "themeRef";
public static final String PROPERTY_CLIENTLIB_CATEGORY = "clientlibCategory";

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
import java.io.StringWriter;
import java.io.Writer;

import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
import org.apache.sling.models.annotations.injectorspecific.SlingObject;
Expand All @@ -28,6 +30,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adobe.cq.forms.core.components.internal.constants.ThemeConstants;
import com.adobe.cq.forms.core.components.models.form.FormContainer;
import com.adobe.cq.forms.core.components.models.form.FormStructureParser;
import com.adobe.cq.forms.core.components.util.ComponentUtils;
Expand Down Expand Up @@ -59,6 +62,36 @@ public String getClientLibRefFromFormContainer() {
return getPropertyFromFormContainer(resource, FormContainer.PN_CLIENT_LIB_REF);
}

@Override
public String getThemeClientLibRefFromFormContainer() {
String themeContentPath = null;
String themeClientLibRef = null;
if (request != null) {
themeContentPath = (String) request.getAttribute(ThemeConstants.THEME_OVERRIDE); // theme editor use-case
}
if (StringUtils.isBlank(themeContentPath)) {
if (request != null) {
themeContentPath = request.getParameter(ThemeConstants.THEME_OVERRIDE); // embed component use-case
}
if (StringUtils.isBlank(themeContentPath)) {
themeContentPath = getPropertyFromFormContainer(resource, ThemeConstants.THEME_REF); // normal including theme in form
// runtime
}
}
// get client library from theme content path
if (StringUtils.isNotBlank(themeContentPath)) {
Resource themeResource = resource.getResourceResolver().getResource(themeContentPath + ThemeConstants.RELATIVE_PATH_METADATA);
if (themeResource != null) {
ValueMap themeProps = themeResource.getValueMap();
themeClientLibRef = themeProps.get(ThemeConstants.PROPERTY_CLIENTLIB_CATEGORY, "");
} else {
logger.error("Invalid Theme Name {}", themeContentPath);
}
}

return themeClientLibRef;
}

@Override
public Boolean containsFormContainer() {
return containsFormContainer(resource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@
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.Self;
import org.apache.sling.models.annotations.injectorspecific.SlingObject;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
import org.apache.sling.models.annotations.injectorspecific.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adobe.aemds.guide.common.GuideContainer;
import com.adobe.aemds.guide.service.CoreComponentCustomPropertiesProvider;
import com.adobe.aemds.guide.service.GuideSchemaType;
import com.adobe.aemds.guide.utils.GuideConstants;
import com.adobe.aemds.guide.utils.GuideUtils;
Expand Down Expand Up @@ -79,6 +77,11 @@ public class FormContainerImpl extends AbstractContainerImpl implements FormCont
private static final String FD_IS_HAMBURGER_MENU_ENABLED = "fd:isHamburgerMenuEnabled";
public static final String FD_FORM_DATA_ENABLED = "fd:formDataEnabled";
public static final String FD_ROLE_ATTRIBUTE = "fd:roleAttribute";
private static final String FD_CUSTOM_FUNCTIONS_URL = "fd:customFunctionsUrl";
private static final String FD_DATA_URL = "fd:dataUrl";

@OSGiService(injectionStrategy = InjectionStrategy.OPTIONAL)
private CoreComponentCustomPropertiesProvider coreComponentCustomPropertiesProvider;

@SlingObject(injectionStrategy = InjectionStrategy.OPTIONAL)
@Nullable
Expand Down Expand Up @@ -318,7 +321,14 @@ public String getLanguageDirection() {

@Override
public @NotNull Map<String, Object> getProperties() {
Map<String, Object> properties = super.getProperties();
Map<String, Object> properties = new LinkedHashMap<>();
if (coreComponentCustomPropertiesProvider != null) {
Map<String, Object> customProperties = coreComponentCustomPropertiesProvider.getProperties();
if (customProperties != null) {
properties.putAll(customProperties);
}
}
properties.putAll(super.getProperties());
if (getSchemaType() != null) {
properties.put(FD_SCHEMA_TYPE, getSchemaType());
}
Expand All @@ -335,6 +345,9 @@ public String getLanguageDirection() {
properties.put(FD_ROLE_ATTRIBUTE, getRoleAttribute());
properties.put(FD_FORM_DATA_ENABLED, formDataEnabled);
properties.put(ReservedProperties.FD_AUTO_SAVE_PROPERTY_WRAPPER, this.autoSaveConfig);
properties.put(FD_CUSTOM_FUNCTIONS_URL, getCustomFunctionUrl());
properties.put(FD_DATA_URL, getDataUrl());

return properties;
}

Expand Down Expand Up @@ -388,4 +401,9 @@ public String getName() {
return FormContainer.super.getName();
}

@Override
public String getCustomFunctionUrl() {
return getContextPath() + ADOBE_GLOBAL_API_ROOT + FORMS_RUNTIME_API_GLOBAL_ROOT + "/customfunctions/" + getId();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,16 @@ default void visit(Consumer<ComponentExporter> callback) throws Exception {}
default String getParentPagePath() {
return null;
}

/**
* Returns the url from where the custom functions should be registered
*
* @return custom function registration url
* @since com.adobe.cq.forms.core.components.models.form 5.9.5
*/
@JsonIgnore
default String getCustomFunctionUrl() {
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ public interface FormStructureParser {
*/
String getClientLibRefFromFormContainer();

/**
*
* @returns reference to the client lib of the theme from form container
*/
String getThemeClientLibRefFromFormContainer();

/**
* Checks if this resource contains a form container
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* </p>
*/

@Version("5.7.5")
@Version("5.9.5")
package com.adobe.cq.forms.core.components.models.form;

import org.osgi.annotation.versioning.Version;
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.adobe.aemds.guide.model.HCaptchaConfiguration;
import com.adobe.aemds.guide.model.ReCaptchaConfigurationModel;
import com.adobe.aemds.guide.model.TurnstileConfiguration;
import com.adobe.aemds.guide.service.CloudConfigurationProvider;
import com.adobe.aemds.guide.service.GuideException;
import com.adobe.cq.forms.core.Utils;
Expand Down Expand Up @@ -54,10 +55,20 @@ public ReCaptchaConfigurationModel getRecaptchaCloudConfiguration(Resource resou
return null;
}

@Override
public String getCustomFunctionUrl(Resource resource) {
return null;
}

@Override
public HCaptchaConfiguration getHCaptchaCloudConfiguration(Resource resource) throws GuideException {
return hCaptchaConfiguration;
}

@Override
public TurnstileConfiguration getTurnstileCloudConfiguration(Resource resource) throws GuideException {
return null;
}
};

@BeforeEach
Expand Down
Loading
Loading