Skip to content

Commit 601db25

Browse files
authored
Merge pull request #1231 from adobe/devtomaster_10May2024
Devtomaster 10 may2024
2 parents 01924b5 + 65568ce commit 601db25

File tree

10 files changed

+56
-13
lines changed

10 files changed

+56
-13
lines changed

.circleci/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
entrypoint: tail -f /dev/null # Keeps the container running
77

88
circleci-aem-cloudready:
9-
image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:15860-1-openjdk11
9+
image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:7f6c9fff9b-openjdk11
1010
depends_on:
1111
- circleci-qp
1212
# Add any additional configurations or environment variables if needed

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/FragmentImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ public List<Resource> getFragmentChildren() {
124124
return filteredChildComponents;
125125
}
126126

127+
@JsonIgnore
128+
public Resource getFragmentContainer() {
129+
return fragmentContainer;
130+
}
131+
127132
@JsonIgnore
128133
public String getFragmentTitle() {
129134
String fragmentTitle = "";

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Fragment.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,12 @@ public interface Fragment extends Panel {
4343
* @since com.adobe.cq.forms.core.components.models.form 4.4.0
4444
*/
4545
List<Resource> getFragmentChildren();
46+
47+
/**
48+
* Returns fragment container resource
49+
*
50+
* @return
51+
* @since com.adobe.cq.forms.core.components.models.form 5.4.1
52+
*/
53+
Resource getFragmentContainer();
4654
}

bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/FragmentImplTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ void testFragmentChildren() {
111111
assertEquals("textinput", fragment.getFragmentChildren().get(0).getName());
112112
}
113113

114+
@Test
115+
void testFragmentContainerResource() {
116+
Fragment fragment = Utils.getComponentUnderTest(PATH_FRAGMENT, Fragment.class, context);
117+
Resource fragmentContainer = fragment.getFragmentContainer();
118+
assertNotNull(fragmentContainer);
119+
assertEquals("/content/affragment/jcr:content/guideContainer", fragmentContainer.getPath());
120+
}
121+
114122
@Test
115123
void testJSONExport() throws Exception {
116124
Fragment fragment = Utils.getComponentUnderTest(PATH_FRAGMENT, Fragment.class, context);

it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/fragment/test-fragment/.content.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@
3030
sling:resourceType="forms-components-examples/components/form/textinput"
3131
fieldType="text-input"
3232
name="fragmenttextinput"/>
33+
<textinput1
34+
jcr:created="{Date}2024-05-08T20:17:24.203+05:30"
35+
jcr:lastModified="{Date}2024-05-08T20:17:24.203+05:30"
36+
jcr:primaryType="nt:unstructured"
37+
jcr:title="Responsive Text Input"
38+
sling:resourceType="forms-components-examples/components/form/textinput"
39+
fieldType="text-input"
40+
name="textinput1715179644273">
41+
<cq:responsive jcr:primaryType="nt:unstructured">
42+
<default
43+
jcr:primaryType="nt:unstructured"
44+
offset="1"
45+
width="9"/>
46+
</cq:responsive>
47+
</textinput1>
3348
</guideContainer>
3449
</jcr:content>
3550
</jcr:root>

parent/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@
8888
<slf4j.version>1.7.6</slf4j.version>
8989
<jacoco.version>0.7.9</jacoco.version>
9090

91-
<core.wcm.components.version>2.24.4</core.wcm.components.version>
92-
<core.wcm.components.library.version>2.24.4</core.wcm.components.library.version>
91+
<core.wcm.components.version>2.24.2</core.wcm.components.version>
92+
<core.wcm.components.library.version>2.24.2</core.wcm.components.library.version>
9393

9494

9595
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/fragment/v1/fragment/fragment.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<div data-sly-call="${shortDescription.shortDescription @componentId=fragment.id, shortDescriptionVisible=fragment.tooltipVisible, shortDescription=fragment.tooltip, bemBlock='cmp-adaptiveform-fragment'}" data-sly-unwrap></div>
3939
<div data-sly-call="${longDescription.longDescription @componentId=fragment.id, longDescription=fragment.description, bemBlock='cmp-adaptiveform-fragment'}" data-sly-unwrap></div>
4040
<sly data-sly-test.showfragment="${wcmmode.preview || wcmmode.disabled}"
41-
data-sly-repeat="${fragment.fragmentChildren}" data-sly-resource="${item.path @ decoration=true}"></sly>
41+
data-sly-resource="${fragment.fragmentContainer @ resourceType='wcm/foundation/components/responsivegrid'}"></sly>
4242
<sly data-sly-test="${ !showfragment }"
4343
data-sly-use.placeholder="placeholder.html"
4444
data-sly-call="${ placeholder.placeholder @ fragment=fragment, templates=templates }"></sly>

ui.tests/test-module/specs/aemEmbedContainer/aemEmbedContainer.runtime.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe("Sites with Aem Embed Container", () => {
109109
it("model initialized properly", () => {
110110
expect(formContainer, "formcontainer is initialized").to.not.be.null;
111111
// fragment component, text field and IntanceManager
112-
expect(Object.keys(formContainer._fields).length).to.equal(3);
112+
expect(Object.keys(formContainer._fields).length).to.equal(4);
113113
})
114114

115115
it("model's changes are reflected in the html ", () => {

ui.tests/test-module/specs/fragment/fragment.runtime.spec.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("Form Runtime with Fragment", () => {
2121
const selectors = {
2222
textinput : `[data-cmp-is="${IS}"]`
2323
}
24-
24+
const fragmentChildCount = 2;
2525
let formContainer = null
2626

2727
beforeEach(() => {
@@ -100,7 +100,7 @@ describe("Form Runtime with Fragment", () => {
100100

101101
expect(fragmentView, "fragment view is created").to.not.be.null;
102102
expect(textInputView, "fragment child view is created").to.not.be.null;
103-
expect(fragmentView.children.length, "fragment has one child").to.equal(1);
103+
expect(fragmentView.children.length, `fragment has ${fragmentChildCount} child`).to.equal(fragmentChildCount);
104104
expect(fragmentView.children[0].id, "fragment has reference to child view").to.equal(textInputId);
105105
expect(textInputView.parentView.id, "text input has reference to parent panel view").to.equal(fragmentId);
106106

@@ -113,17 +113,24 @@ describe("Form Runtime with Fragment", () => {
113113
it(" model's changes are reflected in the html ", () => {
114114
const fragmentId = formContainer._model.items[0].items[0].id;
115115
const model = formContainer._model.getElement(fragmentId);
116-
const fragmentView = formContainer.getAllFields()[fragmentId];
117-
const count = 1;
118-
checkHTML(model.id, model.getState(), fragmentView, count).then(() => {
116+
checkHTML(model.id, model.getState()).then(() => {
119117
model.visible = false;
120-
return checkHTML(model.id, model.getState(), fragmentView, count);
118+
return checkHTML(model.id, model.getState());
121119
}).then(() => {
122120
model.enable = false;
123-
return checkHTML(model.id, model.getState(), fragmentView, count);
121+
return checkHTML(model.id, model.getState());
124122
});
125123
});
126124

125+
it("responsive component in fragment", () => {
126+
const responsiveTextInputId = formContainer._model.items[0].items[0].items[1].id;
127+
cy.get(`#${responsiveTextInputId}`).should('be.visible');
128+
cy.get(`#${responsiveTextInputId}`).parent()
129+
.should('have.class', 'aem-GridColumn')
130+
.should('have.class', 'aem-GridColumn--default--9')
131+
.should('have.class', 'aem-GridColumn--offset--default--1');
132+
})
133+
127134
it(" add instance and remove instance of model is reflected in html ", () => {
128135

129136
const fragmentId = formContainer._model.items[0].items[0].id;

ui.tests/test-module/specs/wizard/wizard.locale.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
******************************************************************************/
1616
const afConstants = require("../../libs/commons/formsConstants");
1717
const sitesSelectors = require("../../libs/commons/sitesSelectors");
18-
describe.skip('Locale - Authoring Test', function () {
18+
describe('Locale - Authoring Test', function () {
1919
if(cy.af.isLatestAddon()) {
2020
context('Test Wizard Component String Language', function () {
2121
beforeEach(() => {

0 commit comments

Comments
 (0)