Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: adobe/aem-core-forms-components
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4747ab859435ba077571df6b05db952c88c96f13
Choose a base ref
..
head repository: adobe/aem-core-forms-components
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a7b5e04f01dd2c9215a673d5fa2fc35946a1477e
Choose a head ref
Showing with 398 additions and 1,719 deletions.
  1. +26 −31 .github/workflows/exporter-validate-pr.yml
  2. +0 −20 ...f-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PasswordImpl.java
  3. +1 −1 bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Password.java
  4. +20 −28 ...re/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PasswordImplTest.java
  5. +26 −0 bundles/af-core/src/test/resources/form/password/exporter-password.json
  6. +1 −40 bundles/af-core/src/test/resources/form/password/test-content.json
  7. +0 −11 ...ontent/dam/formsanddocuments/core-components-it/samples/ruleeditor/navigate-in-panel/.content.xml
  8. +0 −23 .../dam/formsanddocuments/core-components-it/samples/ruleeditor/navigate-in-panel/basic/.content.xml
  9. +0 −23 .../dam/formsanddocuments/core-components-it/samples/ruleeditor/navigate-in-panel/blank/.content.xml
  10. +48 −94 ...c/main/content/jcr_root/content/forms/af/core-components-it/samples/ruleeditor/basic/.content.xml
  11. +0 −3 ...nt/jcr_root/content/forms/af/core-components-it/samples/ruleeditor/navigate-in-panel/.content.xml
  12. +0 −611 ..._root/content/forms/af/core-components-it/samples/ruleeditor/navigate-in-panel/basic/.content.xml
  13. +0 −24 ..._root/content/forms/af/core-components-it/samples/ruleeditor/navigate-in-panel/blank/.content.xml
  14. +0 −14 it/core/pom.xml
  15. +3 −17 it/core/src/main/java/com/adobe/cq/forms/core/components/it/service/HeadlessTransportHandler.java
  16. +23 −79 it/core/src/main/java/com/adobe/cq/forms/core/components/it/service/OAuth2Client.java
  17. +7 −7 ui.frontend/package-lock.json
  18. +1 −1 ui.frontend/package.json
  19. +1 −17 ui.frontend/src/customFunctions.js
  20. +1 −26 ui.frontend/src/view/FormFileInputWidgetBase.js
  21. +1 −5 ui.tests/test-module/libs/commons/guideSelectors.js
  22. +0 −119 ui.tests/test-module/specs/ruleeditor/authoring/navigatePanel.authoring.cy.js
  23. 0 ui.tests/test-module/specs/ruleeditor/{runtime → }/customFunction.runtime.cy.js
  24. +5 −154 ui.tests/test-module/specs/ruleeditor/{authoring → }/ruleEditor.authoring.cy.js
  25. +234 −0 ui.tests/test-module/specs/ruleeditor/ruleEditor.runtime.cy.js
  26. +0 −107 ui.tests/test-module/specs/ruleeditor/runtime/navigatePanel.runtime.cy.js
  27. +0 −120 ui.tests/test-module/specs/ruleeditor/runtime/ruleEditorSanity.runtime.cy.js
  28. +0 −38 ui.tests/test-module/specs/ruleeditor/runtime/saveHandler.runtime.cy.js
  29. +0 −106 ui.tests/test-module/specs/ruleeditor/runtime/submitHandler.runtime.cy.js
  30. 0 ui.tests/test-module/specs/ruleeditor/{runtime → }/uichange.runtime.cy.js
57 changes: 26 additions & 31 deletions .github/workflows/exporter-validate-pr.yml
Original file line number Diff line number Diff line change
@@ -15,12 +15,12 @@ jobs:

- name: Fetch Base and Head References
run: |
git fetch origin ${{ github.base_ref }} --depth=1 || true
git fetch origin ${{ github.head_ref }} --depth=1 || true
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
git fetch origin ${{ github.head_ref }}:${{ github.head_ref }}
- name: Validate JSON Changes
run: |
changed_files=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep 'exporter.*\.json$')
changed_files=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep 'exporter.*\.json$')
if [ -z "$changed_files" ]; then
echo "No exporter JSON files have changed."
@@ -29,39 +29,34 @@ jobs:
# Loop through each changed file
for file in $changed_files; do
# Check if the file exists in both branches
if git cat-file -e origin/${{ github.base_ref }}:$file 2>/dev/null && git cat-file -e origin/${{ github.head_ref }}:$file 2>/dev/null; then
# Fetch the base and head versions of the file
base_file=$(git show origin/${{ github.base_ref }}:$file)
head_file=$(git show origin/${{ github.head_ref }}:$file)
# Fetch the base and head versions of the file
base_file=$(git show ${{ github.base_ref }}:$file)
head_file=$(git show ${{ github.head_ref }}:$file)
# Compare the JSON keys
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')
# 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(".")')
# Check for removed keys
removed_keys=$(comm -23 <(echo "$base_keys" | sort) <(echo "$head_keys" | sort))
# Check for removed keys
removed_keys=$(comm -23 <(echo "$base_keys" | sort) <(echo "$head_keys" | sort))
if [ -n "$removed_keys" ]; then
echo "Backward incompatibility change detected in $file. The following keys were removed:"
echo "$removed_keys"
if [ -n "$removed_keys" ]; then
echo "Backward incompatibility change detected in $file. The following keys were removed:"
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")
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'."
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")
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'."
exit 1
fi
done
else
echo "Skipping file $file as it exists in one branch but not the other."
fi
done
done
echo "All exporter JSON files have only additions. No backward incompatibility changes detected."
shell: bash
shell: bash
Original file line number Diff line number Diff line change
@@ -65,16 +65,6 @@ public Integer getMaxLength() {
return maxLength;
}

@Override
public Long getMinimum() {
return minimum;
}

@Override
public Long getMaximum() {
return maximum;
}

@Override
public String getFormat() {
return displayFormat;
@@ -85,16 +75,6 @@ public String getPattern() {
return pattern;
}

@Override
public Long getExclusiveMaximum() {
return (Long) exclusiveMaximumValue;
}

@Override
public Long getExclusiveMinimum() {
return (Long) exclusiveMinimumVaue;
}

@PostConstruct
private void initTextInput() {
exclusiveMaximumValue = ComponentUtils.getExclusiveValue(exclusiveMaximum, maximum, null);
Original file line number Diff line number Diff line change
@@ -24,6 +24,6 @@
* @since com.adobe.cq.forms.core.components.models.form 5.9.6
*/
@ConsumerType
public interface Password extends Field, StringConstraint, NumberConstraint {
public interface Password extends Field, StringConstraint {

}
Original file line number Diff line number Diff line change
@@ -16,6 +16,8 @@

package com.adobe.cq.forms.core.components.internal.models.v1.form;

import com.adobe.cq.forms.core.components.internal.form.FormConstants;
import com.adobe.cq.forms.core.components.models.form.TextInput;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -28,6 +30,7 @@
import com.adobe.cq.forms.core.context.FormsCoreComponentTestContext;
import io.wcm.testing.mock.aem.junit5.AemContext;
import io.wcm.testing.mock.aem.junit5.AemContextExtension;
import org.mockito.Mockito;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
@@ -40,9 +43,9 @@ public class PasswordImplTest {
private static final String PATH_PASSWORD_DATALAYER = CONTENT_ROOT + "/password-datalayer";
private static final String PATH_PASSWORD_CUSTOMIZED = CONTENT_ROOT + "/password-customized";

private static final String PATH_PASSWORD = CONTENT_ROOT + "/password";

private static final String PATH_PASSWORD_PATTERN = CONTENT_ROOT + "/password-pattern";
private static final String PATH_NUMBER_PASSWORD_EXCLUSIVE = CONTENT_ROOT + "/number-password-exclusive";
private static final String PATH_NUMBER_PASSWORD_INPUT = CONTENT_ROOT + "/number-password";

private final AemContext context = FormsCoreComponentTestContext.newAemContext();

@@ -51,6 +54,21 @@ void setUp() {
context.load().json(BASE + FormsCoreComponentTestContext.TEST_CONTENT_JSON, CONTENT_ROOT);
}

@Test
void testExportedType() {
Password password = Utils.getComponentUnderTest(PATH_PASSWORD_CUSTOMIZED, Password.class, context);
assertEquals(FormConstants.RT_FD_FORM_PASSWORD_V1, password.getExportedType());
TextInput textInputMock = Mockito.mock(TextInput.class);
Mockito.when(textInputMock.getExportedType()).thenCallRealMethod();
assertEquals("", textInputMock.getExportedType());
}

@Test
void testJSONExport() throws Exception {
Password password = Utils.getComponentUnderTest(PATH_PASSWORD_PATTERN, Password.class, context);
Utils.testJSONExport(password, Utils.getTestExporterJSONPath(BASE, PATH_PASSWORD));
}

@Test
void testFieldType() {
Password password = Utils.getComponentUnderTest(PATH_PASSWORD_CUSTOMIZED, Password.class, context);
@@ -140,32 +158,6 @@ void testMaxLength() {
assertEquals(10, password.getMaxLength().intValue());
}

@Test
void testGetExclusiveMinimum() {
Password password = Utils.getComponentUnderTest(PATH_NUMBER_PASSWORD_EXCLUSIVE, Password.class, context);
assertNull(password.getMinimum());
assertEquals(8L, password.getExclusiveMinimum().longValue());
}

@Test
void testGetExclusiveMaximum() {
Password password = Utils.getComponentUnderTest(PATH_NUMBER_PASSWORD_EXCLUSIVE, Password.class, context);
assertNull(password.getMaximum());
assertEquals(16L, password.getExclusiveMaximum().longValue());
}

@Test
void testGetMinimum() {
Password password = Utils.getComponentUnderTest(PATH_NUMBER_PASSWORD_INPUT, Password.class, context);
assertEquals(8, password.getMinimum().intValue());
}

@Test
void testGetMaximum() {
Password password = Utils.getComponentUnderTest(PATH_NUMBER_PASSWORD_INPUT, Password.class, context);
assertEquals(16, password.getMaximum().intValue());
}

@Test
void testGetDisplayFormat() throws Exception {
Password password = Utils.getComponentUnderTest(PATH_PASSWORD_CUSTOMIZED, Password.class, context);
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "password-91417957c6",
"fieldType": "password",
"name": "password1732174214265",
"visible": true,
"type": "string",
"enabled": true,
"readOnly": false,
"pattern": "^(?=.*\\d.*\\d)[A-Za-z\\d!@]+$",
"label": {
"value": ""
},
"events": {
"custom:setProperty": [
"$event.payload"
]
},
"properties": {
":type": "forms-components-examples/components/form/password",
"fd:dor": {
"dorExclusion": false
},
"fd:path": "/content/password-pattern"
},
":type": "nt:unstructured"
}
Original file line number Diff line number Diff line change
@@ -37,25 +37,6 @@
"visible": true
}
},
"number-password" : {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType" : "core/fd/components/form/textinput/v1/textinput",
"name" : "abc",
"type" : "password",
"jcr:title" : "def",
"hideTitle" : false,
"description" : "dummy",
"visible" : false,
"assistPriority" : "custom",
"dataRef" : "a.b",
"custom" : "Custom screen reader text",
"typeMessage" : "incorrect type",
"tooltip": "test-short-description",
"fieldType": "text-input",
"maximum" : 16,
"minimum" : 8,
"default" : 150
},
"password-pattern" : {
"id": "password-91417957c6",
"fieldType": "password",
@@ -85,27 +66,7 @@
},
":type": "forms-components-examples/components/form/password"
},
"number-password-exclusive" : {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType" : "core/fd/components/form/password/v1/password",
"name" : "abc",
"type" : "password",
"jcr:title" : "def",
"hideTitle" : false,
"description" : "dummy",
"visible" : false,
"assistPriority" : "custom",
"dataRef" : "a.b",
"custom" : "Custom screen reader text",
"typeMessage" : "incorrect type",
"tooltip": "test-short-description",
"fieldType": "text-input",
"maximum" : 16,
"minimum" : 8,
"exclusiveMinimum" : true,
"exclusiveMaximum" : true,
"default" : 150
},

"password-format" : {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType" : "core/fd/components/form/password/v1/password",

This file was deleted.

This file was deleted.

This file was deleted.

Loading