Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 3 deletions .circleci/ci/it-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const qpPath = '/home/circleci/cq';
const buildPath = '/home/circleci/build';
const { TYPE, BROWSER, AEM, PRERELEASE, FT, CORE_COMPONENTS, WCM_COMPONENTS} = process.env;
const isLatestAddon = AEM === 'addon-latest';
const jacocoAgent = '/home/circleci/.m2/repository/org/jacoco/org.jacoco.agent/0.8.3/org.jacoco.agent-0.8.3-runtime.jar';
const jacocoAgent = '/home/circleci/.m2/repository/org/jacoco/org.jacoco.agent/0.8.12/org.jacoco.agent-0.8.12-runtime.jar';

try {
// # Define the image name
Expand All @@ -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.30.2";
let wcmVersion = "2.32.4";
ci.stage("Integration Tests");
ci.dir(qpPath, () => {
// Connect to QP
Expand Down Expand Up @@ -105,7 +105,7 @@ try {
${ci.addQpFileDependency(config.modules['core-forms-components-it-tests-core'])} \
${ci.addQpFileDependency(config.modules['core-forms-components-it-tests-apps'])} \
${ci.addQpFileDependency(config.modules['core-forms-components-it-tests-content'])} \
--vm-options \\\"-Xmx4096m -XX:MaxPermSize=1024m -Djava.awt.headless=true -javaagent:${jacocoAgent}=destfile=crx-quickstart/jacoco-it.exec\\\" \
--vm-options \\\"-Xmx4096m -Djava.awt.headless=true -javaagent:${jacocoAgent}=destfile=crx-quickstart/jacoco-it.exec\\\" \
${preleaseOpts}`);
});

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:23385-openjdk11
image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:27293-v2-openjdk21
depends_on:
- circleci-qp
# Add any additional configurations or environment variables if needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ private FormConstants() {
/** The resource type for date picker v1 */
public static final String RT_FD_FORM_DATE_PICKER_V1 = RT_FD_FORM_PREFIX + "datepicker/v1/datepicker";

/** The resource type for date picker v2 */
public static final String RT_FD_FORM_DATE_PICKER_V2 = RT_FD_FORM_PREFIX + "datepicker/v2/datepicker";

/** The resource type for number input v1 */
public static final String RT_FD_FORM_NUMBER_INPUT_V1 = RT_FD_FORM_PREFIX + "numberinput/v1/numberinput";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@
adaptables = { SlingHttpServletRequest.class, Resource.class },
adapters = { DatePicker.class,
ComponentExporter.class },
resourceType = {
FormConstants.RT_FD_FORM_DATE_PICKER_V1,
FormConstants.RT_FD_FORM_DATE_PICKER_V2
})
resourceType = { FormConstants.RT_FD_FORM_DATE_PICKER_V1 })
@Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION)
public class DatePickerImpl extends AbstractFieldImpl implements DatePicker {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public enum FormMetaDataType {
PREFILL_ACTION("prefillServiceProvider"),
LANG("lang"),
FORMATTERS("formatters"),
SSV_CLOUD_CONFIG("ssvCloudServiceConfiguration");
SSV_CLOUD_CONFIG("ssvCloudServiceConfiguration"),
FILE_ATTACHMENT_VALIDATOR("fileAttachmentValidator");

private String value;

Expand Down Expand Up @@ -181,12 +182,13 @@ private List<Resource> getDataSourceResources(SlingHttpServletRequest request, R
FormMetaData formMetaData = resourceResolver.adaptTo(FormMetaData.class);
if (formMetaData != null) {
Iterator<FormsManager.ComponentDescription> metaDataList = null;
I18n i18n = new I18n(request.getResourceBundle(request.getLocale()));
switch (type) {
case FORMATTERS:
case LANG:
ContentPolicy policy = ComponentUtils.getPolicy((String) request.getAttribute(Value.CONTENTPATH_ATTRIBUTE),
resourceResolver);
resources.add(getResourceForDropdownDisplay(resourceResolver, "Select", ""));
resources.add(getResourceForDropdownDisplay(resourceResolver, i18n.get("Select"), ""));
if (policy != null) {
ValueMap props = policy.getProperties();
if (props != null) {
Expand All @@ -204,7 +206,7 @@ private List<Resource> getDataSourceResources(SlingHttpServletRequest request, R
}
}
}
resources.add(getResourceForDropdownDisplay(resourceResolver, "Custom", "custom"));
resources.add(getResourceForDropdownDisplay(resourceResolver, i18n.get("Custom"), "custom"));
break;
case SUBMIT_ACTION:
// filter the submit actions by uniqueness and data model
Expand All @@ -223,7 +225,12 @@ private List<Resource> getDataSourceResources(SlingHttpServletRequest request, R
case PREFILL_ACTION:
metaDataList = formMetaData.getPrefillActions();
// Add an explicit empty option so authors can clear an already selected prefill service.
I18n i18n = new I18n(request.getResourceBundle(request.getLocale()));
resources.add(getResourceForDropdownDisplay(resourceResolver, i18n.get("None"), ""));
resources.addAll(this.getResourceListFromComponentDescription(metaDataList, resourceResolver));
break;
case FILE_ATTACHMENT_VALIDATOR:
metaDataList = formMetaData.getFileAttachmentValidators();
// Add an explicit empty option so authors can clear an already selected file attachment validator.
resources.add(getResourceForDropdownDisplay(resourceResolver, i18n.get("None"), ""));
resources.addAll(this.getResourceListFromComponentDescription(metaDataList, resourceResolver));
break;
Expand Down
19 changes: 19 additions & 0 deletions bundles/af-core/src/test/java/com/adobe/cq/forms/core/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.sling.api.scripting.SlingBindings;
import org.apache.sling.testing.mock.sling.servlet.MockSlingHttpServletRequest;
import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -252,4 +253,22 @@ public static Method getPrivateMethod(Class clazz, String privateMethodName) {
return null;
}
}

/**
* Removes the request's {@link SlingBindings} attribute so the AF locale-resolution code in
* {@code GuideUtils} takes its {@code bindings == null} branches.
* <p>
* Call this in tests that set an AF language parameter before adapting/using a model. Newer
* {@code aem-forms-sdk-api} versions resolve the locale via {@code GuideUtils}, and when a
* {@link SlingBindings} is present they look up services through {@code bindings.getSling()}:
* {@code getSanitizedLocale(...)} fetches the runtime-only Granite {@code ToggleRouter} (absent
* from the test classpath → {@link NoClassDefFoundError}), and {@code getLocaleParamFromRequest(...)}
* fetches {@code GuideLocalizationService} via {@code getSling()} without null-guarding it. Both
* are skipped entirely when the {@code SlingBindings} attribute is absent, and the locale is then
* taken from the {@code afAcceptLang} request parameter (which these tests set) — the same result
* expected in production for that parameter, since no {@code ToggleRouter} is registered in tests.
*/
public static void disableLocaleFeatureToggleLookup(MockSlingHttpServletRequest request) {
request.setAttribute(SlingBindings.class.getName(), null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public String getCustomFunctionUrl(Resource resource) {
return null;
}

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

@Override
public HCaptchaConfiguration getHCaptchaCloudConfiguration(Resource resource) throws GuideException {
return hCaptchaConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public String getCustomFunctionUrl(Resource resource) {
return null;
}

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

@Override
public HCaptchaConfiguration getHCaptchaCloudConfiguration(Resource resource) throws GuideException {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ void testTitleWithLocale() throws Exception {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(GuideConstants.AF_LANGUAGE_PARAMETER, "de");
request.setParameterMap(paramMap);
Utils.disableLocaleFeatureToggleLookup(request);
Title title = request.adaptTo(Title.class);
assertEquals("Title", title.getText());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public String getCustomFunctionUrl(Resource resource) {
return null;
}

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

@Override
public HCaptchaConfiguration getHCaptchaCloudConfiguration(Resource resource) throws GuideException {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ private FormContainer getFormContainerWithLocaleUnderTest(String resourcePath) t
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(GuideConstants.AF_LANGUAGE_PARAMETER, "de");
request.setParameterMap(paramMap);
Utils.disableLocaleFeatureToggleLookup(request);
context.currentResource().adaptTo(FormContainer.class);
return request.adaptTo(FormContainer.class);
}
Expand All @@ -507,6 +508,7 @@ private FormContainer getFormContainerWithRTLLocaleUnderTest(String resourcePath
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(GuideConstants.AF_LANGUAGE_PARAMETER, "ar-ae");
request.setParameterMap(paramMap);
Utils.disableLocaleFeatureToggleLookup(request);
context.currentResource().adaptTo(FormContainer.class);
return request.adaptTo(FormContainer.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ void testTitleWithLocale() throws Exception {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(GuideConstants.AF_LANGUAGE_PARAMETER, "de");
request.setParameterMap(paramMap);
Utils.disableLocaleFeatureToggleLookup(request);
FormTitle title = request.adaptTo(FormTitle.class);
assertEquals("Title", title.getText());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
cssProcessor="[default:none,min:none]"
jsProcessor="[default:none,min:none]"
categories="[core.forms.components.it.runtime.all]"
embed="[core.forms.components.runtime.base,core.forms.components.it.container.v1.runtime,core.forms.components.datePicker.v1.runtime,core.forms.components.datePicker.v2.runtime,core.forms.components.textinput.v1.runtime,core.forms.components.numberinput.v1.runtime,core.forms.components.panelcontainer.v1.runtime,core.forms.components.radiobutton.v1.runtime,core.forms.components.text.v1.runtime,core.forms.components.checkboxgroup.v1.runtime,core.forms.components.button.v1.runtime,core.forms.components.image.v1.runtime,core.forms.components.dropdown.v1.runtime,core.forms.components.fileinput.v2.runtime,core.forms.components.accordion.v1.runtime,core.forms.components.tabs.v1.runtime,core.forms.components.wizard.v1.runtime,core.forms.components.verticaltabs.v1.runtime,core.forms.components.recaptcha.v1.runtime,core.forms.components.checkbox.v1.runtime,core.forms.components.fragment.v1.runtime,core.forms.components.switch.v1.runtime,core.forms.components.termsandconditions.v1.runtime, core.forms.components.it.textinput.v1.runtime, core.forms.components.hcaptcha.v1.runtime, core.forms.components.turnstile.v1.runtime]"/>
embed="[core.forms.components.runtime.base,core.forms.components.it.container.v1.runtime,core.forms.components.datePicker.v1.runtime,core.forms.components.textinput.v1.runtime,core.forms.components.numberinput.v1.runtime,core.forms.components.panelcontainer.v1.runtime,core.forms.components.radiobutton.v1.runtime,core.forms.components.text.v1.runtime,core.forms.components.checkboxgroup.v1.runtime,core.forms.components.button.v1.runtime,core.forms.components.image.v1.runtime,core.forms.components.dropdown.v1.runtime,core.forms.components.fileinput.v2.runtime,core.forms.components.accordion.v1.runtime,core.forms.components.tabs.v1.runtime,core.forms.components.wizard.v1.runtime,core.forms.components.verticaltabs.v1.runtime,core.forms.components.recaptcha.v1.runtime,core.forms.components.checkbox.v1.runtime,core.forms.components.fragment.v1.runtime,core.forms.components.switch.v1.runtime,core.forms.components.termsandconditions.v1.runtime, core.forms.components.it.textinput.v1.runtime, core.forms.components.hcaptcha.v1.runtime, core.forms.components.turnstile.v1.runtime]"/>
2 changes: 1 addition & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>aem-forms-sdk-api</artifactId>
<version>2024.09.08.00-240800</version>
<version>2026.06.27.00-260700</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,26 @@
</cui>
</uiSettings>
</thankYouMessage>
<fileAttachmentValidator
granite:class="cmp-adaptiveform-container__fileattachmentvalidator"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
disabled="false"
emptyText="Select"
fieldDescription="Select a file attachment validator service."
fieldLabel="File Attachment Validator"
name="./fileAttachmentValidator"
renderReadOnly="false">
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="core/fd/components/form/container/v1/datasource"
guideDataModel="basic"
type="fileAttachmentValidator"/>
<granite:rendercondition
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/renderconditions/featuretoggle"
toggleName="FT_FORMS-23497"/>
</fileAttachmentValidator>
<ssvCloudServicePath
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@
<wizardPanel
jcr:primaryType="nt:unstructured"
target="/mnt/override/libs/core/fd/components/form/wizard/v2/wizard/cq:styleConfig/items/wizardPanel"/>
<tablePanel
jcr:primaryType="nt:unstructured"
target="/mnt/override/libs/core/fd/components/form/table/v1/table/cq:styleConfig/items/tablePanel"/>
</items>
</panel>
<Image
Expand Down
Loading
Loading