Skip to content

Commit 08e5f4a

Browse files
authored
Merge pull request #1531 from adobe/devMaster24Feb
Dev master24 feb
2 parents 2b52028 + 2cf1b6a commit 08e5f4a

File tree

10 files changed

+46
-35
lines changed

10 files changed

+46
-35
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,13 @@ jobs:
411411
# echo "Before sed: $(cat VERSIONS.md)"
412412
# update versions.md
413413
sed -i "/$LAST_VERSION/ { p; b; }; 1,/$LAST_VERSION/ { p; d; }" VERSIONS.md
414-
sed -i -E "0,/(\| $LAST_VERSION\s*\|) [0-9]+\.[0-9]+\.[0-9]+\s*\|/s//| $NEW_VERSION \| $WCM_CORE_COMPONENTS_VERSION |/" VERSIONS.md
415-
echo "After sed: $(cat VERSIONS.md)"
414+
sed -i -E "0,/(\| $LAST_VERSION\s*\|) [0-9]+\.[0-9]+\.[0-9]+\+?\s*\|/s//| $NEW_VERSION \| $WCM_CORE_COMPONENTS_VERSION |/" VERSIONS.md
415+
# echo "After sed: $(cat VERSIONS.md)"
416416
417417
# echo "Before sed: $(cat README.md)"
418418
# update readme.md
419-
sed -i -E "s/(\| $LAST_VERSION\s*\|) [0-9]+\.[0-9]+\.[0-9]+ \s*\| /| $NEW_VERSION | $WCM_CORE_COMPONENTS_VERSION | /g" README.md
420-
echo "After sed: $(cat README.md)"
419+
sed -i -E "s/(\| $LAST_VERSION\s*\|) [0-9]+\.[0-9]+\.[0-9]+\+? \s*\| /| $NEW_VERSION | $WCM_CORE_COMPONENTS_VERSION | /g" README.md
420+
# echo "After sed: $(cat README.md)"
421421
422422
# Check if package-lock.json is modified
423423
if [[ $(git status --porcelain | grep "package-lock.json") ]]; then

bundles/core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/aemform/AEMFormImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ public boolean isFormSelected() {
279279

280280
@Override
281281
public String getThankyouPage() {
282+
if (request != null && StringUtils.isNotBlank(thankyouPage)) {
283+
ResourceResolver resourceResolver = request.getResourceResolver();
284+
if (resourceResolver != null) {
285+
thankyouPage = StringUtils.replace(resourceResolver.map(thankyouPage), "_jcr_content", "jcr:content");
286+
}
287+
}
282288
return GuideUtils.getRedirectUrl(thankyouPage, null);
283289
}
284290

bundles/core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/aemform/AEMFormImplTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ class AEMFormImplTest {
4141
private static final String GRID_LANG = ROOT_PAGE_LANG + "/jcr:content/root/responsivegrid";
4242
private static final String FORM_1 = "/aemform-1";
4343
private static final String FORM_2 = "/aemform-2";
44+
private static final String FORM_WITH_SLINGMAPPINGS = "/aemformv2_slingmappings";
4445
private static final String PATH_FORM_1 = GRID + FORM_1;
4546
private static final String PATH_FORM_2 = GRID + FORM_2;
47+
private static final String PATH_FORM_SLINGMAPPINGS = GRID + FORM_WITH_SLINGMAPPINGS;
4648
private static final String PATH_FORM_LANG = GRID_LANG + FORM_1;
4749

4850
private final AemContext context = FormsCoreComponentTestContext.newAemContext();
@@ -294,6 +296,16 @@ void testJSONExport() throws Exception {
294296
Utils.testJSONExport(aemform, Utils.getTestExporterJSONPath(BASE, PATH_FORM_1));
295297
}
296298

299+
@Test
300+
void testGetThankYouPageWithResourceResolver() {
301+
// Get form under test using test resource that has _jcr_content in thankyou page path
302+
AEMForm aemForm = getAEMFormUnderTest(PATH_FORM_SLINGMAPPINGS);
303+
304+
// Test the method - verify _jcr_content replacement
305+
String result = aemForm.getThankyouPage();
306+
assertEquals("/content/jcr:content/thank/page.html", result);
307+
}
308+
297309
private AEMForm getAEMFormUnderTest(String resourcePath) {
298310
context.currentResource(resourcePath);
299311
MockSlingHttpServletRequest request = context.request();

bundles/core/src/test/resources/aemform/test-content.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@
8080
"useiframe" : "true",
8181
"usePageLocale" : "true",
8282
"enableFocusOnFirstField" : true
83+
},
84+
"aemformv2_slingmappings" : {
85+
"jcr:primaryType": "nt:unstructured",
86+
"jcr:title": "",
87+
"sling:resourceType": "core/fd/components/aemform/v1/aemform",
88+
"thankyouPage": "/content/_jcr_content/thank/page"
8389
}
8490
}
8591
}

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,5 @@ Applying `data-cmp-custom-functions-module-url` attribute to the div to point to
9292
This Url should whitelist the AEM author/publish domain in the Cross Origin Resource Sharing (CORS) configuration.
9393

9494
Applying `data-cmp-auto-save` attribute to the `cmp-adaptiveform-container` block to control the auto-save functionality. If the attribute's value is set to true, auto-save will be enabled for the form; otherwise, it will not be triggered. This attribute will be set to true in published mode if enableAutoSave is enabled.
95+
96+
Applying `data-cmp-hamburger-menu-enabled` attribute to the `cmp-adaptiveform-container` block to control the hamburger meu. If the attribute's value is set to true, hamburger menu will be enabled in the mobile view.

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/clientlibs/site/js/hamburgerMenu.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -334,27 +334,6 @@ if (typeof window.HamburgerMenu === 'undefined') {
334334
return ul;
335335
}
336336

337-
#hideIndividualComponentsNavigation() {
338-
// hide all the horizontal tabs list
339-
const tabsLists = document.getElementsByClassName('cmp-tabs__tablist');
340-
Array.from(tabsLists).forEach(tabsList => {
341-
tabsList.style.display = 'none';
342-
});
343-
344-
// hide all the vertical tabs list
345-
const verticalTabsLists = document.getElementsByClassName('cmp-verticaltabs__tablist');
346-
Array.from(verticalTabsLists).forEach(tabsList => {
347-
tabsList.style.display = 'none';
348-
});
349-
// hide all the wizard tabs list
350-
const wizardTabsLists = document.getElementsByClassName('cmp-adaptiveform-wizard__tabList');
351-
const wizardTabsNavButton = document.querySelector('.cmp-adaptiveform-wizard__containerNav');
352-
if(wizardTabsNavButton) wizardTabsNavButton.style.display = 'none';
353-
Array.from(wizardTabsLists).forEach(tabsList => {
354-
tabsList.style.display = 'none';
355-
});
356-
}
357-
358337
// Function to find the currently active li
359338
#findActiveLi() {
360339
return document.querySelector(HamburgerMenu.selectors.active).parentElement;
@@ -492,8 +471,6 @@ if (typeof window.HamburgerMenu === 'undefined') {
492471

493472
this.#attachHamburgerEventListeners(hamburgerIcon, menu);
494473
this.#attachOutsideClickHandler(hamburgerIcon, menu);
495-
496-
this.#hideIndividualComponentsNavigation();
497474
this.#attachMenuEventListeners(menu);
498475
this.#styleSubmenuItems(menu);
499476
parentContainer.innerHTML='';
@@ -566,6 +543,7 @@ if (typeof window.HamburgerMenu === 'undefined') {
566543

567544
init() {
568545
if(this.formContainer?.getModel()?.properties?.['fd:isHamburgerMenuEnabled']) {
546+
document.querySelector('.cmp-adaptiveform-container')?.setAttribute('data-cmp-hamburger-menu-enabled', 'true');
569547
const panels = this.#getAllPanels();
570548
this.#renderHamburgerItems(panels);
571549
}

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/container.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
data-cmp-context-path="${request.contextPath}"
4242
data-cmp-page-lang="${container.containingPageLang}"
4343
data-cmp-path="${resource.path}"
44+
data-cmp-hamburger-menu-enabled="${container.isHamburgerMenuEnabled ? 'true' : 'false'}"
4445
class="cmp-adaptiveform-container cmp-container ${wcmmode.edit ? 'cmp-adaptiveform-container--edit' : ''}"
4546
data-cmp-custom-functions-module-url="${configurationProvider.customFunctionModuleUrl}"
4647
dir="${container.languageDirection}"

ui.frontend/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui.frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
"dependencies": {
2626
"@aemforms/af-core": "^0.22.114",
2727
"@aemforms/af-formatters": "^0.22.114",
28-
"@aemforms/af-custom-functions": "1.0.13"
28+
"@aemforms/af-custom-functions": "1.0.14"
2929
}
3030
}

ui.tests/test-module/specs/formContainer/formContainer.runtime.cy.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ describe("Form Runtime with Hamburger Menu", () => {
4343
cy.get(selectors.hamburgerMenuWidget.hamburgerMenu).should("be.visible");
4444
})
4545

46+
it(`Test data-cmp-hamburger-menu-enabled attribute when hamburger menu is enabled`, () => {
47+
cy.viewport('iphone-x');
48+
cy.get('form')
49+
.should('have.attr', 'data-cmp-hamburger-menu-enabled', 'true');
50+
})
51+
4652
it(`Test hamburger menu should render exact number of items`, () => {
4753
cy.viewport('iphone-x');
4854
cy.get(selectors.hamburgerMenuTopContainer.hamburgerMenuIcon).click();

0 commit comments

Comments
 (0)