From 7d5badd80a744c52801edf4d2357fd1a736719f5 Mon Sep 17 00:00:00 2001 From: "Shrikha ." Date: Mon, 6 Jan 2025 08:32:30 +0530 Subject: [PATCH 1/7] FORMS-16858: Support for custom XFA styles --- ...mpl.dev.DynamicToggleProviderImpl.cfg.json | 3 ++- .../form/base/v1/base/_cq_dialog/.content.xml | 19 +++++++++++++++++++ .../v1/panelcontainer/_cq_dialog/.content.xml | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json b/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json index 8842ce8f0c..5762139cc5 100644 --- a/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json +++ b/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json @@ -21,6 +21,7 @@ "FT_SITES-19631", "FT_FORMS-14255", "FT_FORMS-14068", - "FT_FORMS-16351" + "FT_FORMS-16351", + "FT_FORMS-2447" ] } diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/base/v1/base/_cq_dialog/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/base/v1/base/_cq_dialog/.content.xml index 86a74c94e2..f8c88c74b4 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/base/v1/base/_cq_dialog/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/base/v1/base/_cq_dialog/.content.xml @@ -783,6 +783,25 @@ ignoreData="{Boolean}true" name="dorExclusion@TypeHint" value="Boolean"/> + + + + + + + + + + Date: Sun, 12 Jan 2025 18:41:18 +0530 Subject: [PATCH 2/7] add cypress test --- .../custom_dor_xfa_template.xdp | 1928 +++++++++++++++++ .../test-module/specs/customXfaStyleDor.cy.js | 47 + 2 files changed, 1975 insertions(+) create mode 100644 it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate/custom_dor_xfa_template.xdp create mode 100644 ui.tests/test-module/specs/customXfaStyleDor.cy.js diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate/custom_dor_xfa_template.xdp b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate/custom_dor_xfa_template.xdp new file mode 100644 index 0000000000..1f54f3e9ee --- /dev/null +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate/custom_dor_xfa_template.xdp @@ -0,0 +1,1928 @@ + + + + + + + + pdf + + + + + + + + pdf + + + + 0 + + 1.7 + 11 + 0 + + + * + + + + + + + + January + February + March + April + May + June + July + August + September + October + November + December + + + Jan + Feb + Mar + Apr + May + Jun + Jul + Aug + Sep + Oct + Nov + Dec + + + Sunday + Monday + Tuesday + Wednesday + Thursday + Friday + Saturday + + + Sun + Mon + Tue + Wed + Thu + Fri + Sat + + + AM + PM + + + BC + AD + + + + EEEE, MMMM D, YYYY + MMMM D, YYYY + MMM D, YYYY + M/D/YY + + + h:MM:SS A Z + h:MM:SS A Z + h:MM:SS A + h:MM A + + GyMdkHmsSEDFwWahKzZ + + z,zz9.zzz + $z,zz9.99|($z,zz9.99) + z,zz9% + + + . + , + % + - + 0 + + + $ + USD + . + + + + + + + + + + + + + + + + + + + + + + 2023-05-05T08:58:46Z + Designer 2022.05 + Designer 2022.05 + uuid:39386494-76c6-44ce-8889-20d226bd2d17 + 1 + + 6.2.0.20160331.1.924316.921890 + /template/subform[1] + + + + diff --git a/ui.tests/test-module/specs/customXfaStyleDor.cy.js b/ui.tests/test-module/specs/customXfaStyleDor.cy.js new file mode 100644 index 0000000000..5956592c15 --- /dev/null +++ b/ui.tests/test-module/specs/customXfaStyleDor.cy.js @@ -0,0 +1,47 @@ +/* + * + * ADOBE CONFIDENTIAL + * ___________________ + * + * Copyright 2025 Adobe Systems Incorporated + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe Systems Incorporated and its suppliers, + * if any. The intellectual and technical concepts contained + * herein are proprietary to Adobe Systems Incorporated and its + * suppliers and are protected by trade secret or copyright law. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe Systems Incorporated. + */ + +const sitesSelectors = require('../libs/commons/sitesSelectors'), + afConstants = require('../libs/commons/formsConstants'); + +describe ('Custom XFA Style in Document of Record', () => { + const formPath = "/content/forms/af/core-components-it/samples/document-of-record/dor-form", + textInputEditPath = formPath + afConstants.FORM_EDITOR_FORM_CONTAINER_SUFFIX + "/textinput", + textInputEditPathSelector = "[data-path='" + textInputEditPath + "']", + formContainerEditPath = formPath + afConstants.FORM_EDITOR_FORM_CONTAINER_SUFFIX, + formContainerPathSelector = "[data-path='" + formContainerEditPath + "']"; + + it('select a custom template', () => { + cy.openAuthoring(formPath); + cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + formContainerPathSelector); + cy.invokeEditableAction("[data-action='dor']"); + cy.get('coral-select[name="template"]').click(); + cy.get('coral-popover:visible').within(() => { + cy.get('coral-selectlist-item').contains('Custom').click(); + }); + cy.get('foundation-autocomplete[name="./metaTemplateRef"] input[is="coral-textfield"]').type('/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate', { force: true }); + }); + + it('dropdown for custom XFA style exist in the field', () => { + cy.openAuthoring(formPath); + cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + textInputEditPathSelector); + cy.invokeEditableAction("[data-action='CONFIGURE']"); + cy.get(".cmp-adaptiveform-textinput__editdialog coral-tab-label:contains('Document of Record')").click(); + cy.get('coral-select[name="./dorFieldStyling"]').should('exist'); + }); +}); \ No newline at end of file From 558af64e05087067b4ff42d82b2a976812c22939 Mon Sep 17 00:00:00 2001 From: s1mahanty <110378842+s1mahanty@users.noreply.github.com> Date: Sun, 12 Jan 2025 18:48:37 +0530 Subject: [PATCH 3/7] delete it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate/custom_dor_xfa_template.xdp removing the xdp file --- .../custom_dor_xfa_template.xdp | 1928 ----------------- 1 file changed, 1928 deletions(-) delete mode 100644 it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate/custom_dor_xfa_template.xdp diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate/custom_dor_xfa_template.xdp b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate/custom_dor_xfa_template.xdp deleted file mode 100644 index 1f54f3e9ee..0000000000 --- a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate/custom_dor_xfa_template.xdp +++ /dev/null @@ -1,1928 +0,0 @@ - - - - - - - - pdf - - - - - - - - pdf - - - - 0 - - 1.7 - 11 - 0 - - - * - - - - - - - - January - February - March - April - May - June - July - August - September - October - November - December - - - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec - - - Sunday - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - - - Sun - Mon - Tue - Wed - Thu - Fri - Sat - - - AM - PM - - - BC - AD - - - - EEEE, MMMM D, YYYY - MMMM D, YYYY - MMM D, YYYY - M/D/YY - - - h:MM:SS A Z - h:MM:SS A Z - h:MM:SS A - h:MM A - - GyMdkHmsSEDFwWahKzZ - - z,zz9.zzz - $z,zz9.99|($z,zz9.99) - z,zz9% - - - . - , - % - - - 0 - - - $ - USD - . - - - - - - - - - - - - - - - - - - - - - - 2023-05-05T08:58:46Z - Designer 2022.05 - Designer 2022.05 - uuid:39386494-76c6-44ce-8889-20d226bd2d17 - 1 - - 6.2.0.20160331.1.924316.921890 - /template/subform[1] - - - - From 96ea319f66c4cdea7a40f2ff5bfefe0a4c12681d Mon Sep 17 00:00:00 2001 From: "Shrikha ." Date: Sun, 12 Jan 2025 19:55:56 +0530 Subject: [PATCH 4/7] adding test behind FeatureToggle --- .../test-module/specs/customXfaStyleDor.cy.js | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/ui.tests/test-module/specs/customXfaStyleDor.cy.js b/ui.tests/test-module/specs/customXfaStyleDor.cy.js index 5956592c15..fa6cd004d4 100644 --- a/ui.tests/test-module/specs/customXfaStyleDor.cy.js +++ b/ui.tests/test-module/specs/customXfaStyleDor.cy.js @@ -26,22 +26,36 @@ describe ('Custom XFA Style in Document of Record', () => { formContainerEditPath = formPath + afConstants.FORM_EDITOR_FORM_CONTAINER_SUFFIX, formContainerPathSelector = "[data-path='" + formContainerEditPath + "']"; - it('select a custom template', () => { - cy.openAuthoring(formPath); - cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + formContainerPathSelector); - cy.invokeEditableAction("[data-action='dor']"); - cy.get('coral-select[name="template"]').click(); - cy.get('coral-popover:visible').within(() => { - cy.get('coral-selectlist-item').contains('Custom').click(); + let toggle_array = []; + + before(() => { + cy.fetchFeatureToggles().then((response) => { + if (response.status === 200) { + toggle_array = response.body.enabled; + } }); - cy.get('foundation-autocomplete[name="./metaTemplateRef"] input[is="coral-textfield"]').type('/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate', { force: true }); + cy.openAuthoring(formPath); + }); + + it('select a custom template', () => { + if (cy.af.isLatestAddon() && toggle_array.includes('FT_FORMS-2447')) { + cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + formContainerPathSelector); + cy.invokeEditableAction("[data-action='dor']"); + cy.get('coral-select[name="template"]').click(); + cy.get('coral-popover:visible').within(() => { + cy.get('coral-selectlist-item').contains('Custom').click(); + }); + cy.get('foundation-autocomplete[name="./metaTemplateRef"] input[is="coral-textfield"]').type('/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/customTemplate', {force: true}); + } }); it('dropdown for custom XFA style exist in the field', () => { - cy.openAuthoring(formPath); - cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + textInputEditPathSelector); - cy.invokeEditableAction("[data-action='CONFIGURE']"); - cy.get(".cmp-adaptiveform-textinput__editdialog coral-tab-label:contains('Document of Record')").click(); - cy.get('coral-select[name="./dorFieldStyling"]').should('exist'); + if (cy.af.isLatestAddon() && toggle_array.includes('FT_FORMS-2447')) { + cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + textInputEditPathSelector); + cy.invokeEditableAction("[data-action='CONFIGURE']"); + cy.get(".cmp-adaptiveform-textinput__editdialog coral-tab-label:contains('Document of Record')").click(); + cy.get('coral-select[name="./dorFieldStyling"]').should('exist'); + } }); + }); \ No newline at end of file From da7a75358f36c1d6fb70a2c2de4899d3c6a376cf Mon Sep 17 00:00:00 2001 From: "Shrikha ." Date: Mon, 13 Jan 2025 07:17:24 +0530 Subject: [PATCH 5/7] minor fix --- ui.tests/test-module/specs/customXfaStyleDor.cy.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui.tests/test-module/specs/customXfaStyleDor.cy.js b/ui.tests/test-module/specs/customXfaStyleDor.cy.js index fa6cd004d4..fdb28056dc 100644 --- a/ui.tests/test-module/specs/customXfaStyleDor.cy.js +++ b/ui.tests/test-module/specs/customXfaStyleDor.cy.js @@ -33,7 +33,10 @@ describe ('Custom XFA Style in Document of Record', () => { if (response.status === 200) { toggle_array = response.body.enabled; } - }); + }) + }); + + beforeEach(() => { cy.openAuthoring(formPath); }); From f43045a7e5df9a18c5c3201c7d6b58a47ceb8cbd Mon Sep 17 00:00:00 2001 From: "Shrikha ." Date: Mon, 13 Jan 2025 15:43:28 +0530 Subject: [PATCH 6/7] review comments incorporated FT name update --- ...granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json | 2 +- .../fd/components/form/base/v1/base/_cq_dialog/.content.xml | 2 +- .../panelcontainer/v1/panelcontainer/_cq_dialog/.content.xml | 2 +- ui.tests/test-module/specs/customXfaStyleDor.cy.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json b/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json index 5762139cc5..9ad9086e5e 100644 --- a/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json +++ b/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json @@ -22,6 +22,6 @@ "FT_FORMS-14255", "FT_FORMS-14068", "FT_FORMS-16351", - "FT_FORMS-2447" + "FT_FORMS-16858" ] } diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/base/v1/base/_cq_dialog/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/base/v1/base/_cq_dialog/.content.xml index f8c88c74b4..d20f88dc2a 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/base/v1/base/_cq_dialog/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/base/v1/base/_cq_dialog/.content.xml @@ -794,7 +794,7 @@ + toggleName="FT_FORMS-16858"/> diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/panelcontainer/v1/panelcontainer/_cq_dialog/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/panelcontainer/v1/panelcontainer/_cq_dialog/.content.xml index 66467209d6..4588f108cd 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/panelcontainer/v1/panelcontainer/_cq_dialog/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/panelcontainer/v1/panelcontainer/_cq_dialog/.content.xml @@ -381,7 +381,7 @@ + toggleName="FT_FORMS-16858"/> diff --git a/ui.tests/test-module/specs/customXfaStyleDor.cy.js b/ui.tests/test-module/specs/customXfaStyleDor.cy.js index fdb28056dc..30195a0008 100644 --- a/ui.tests/test-module/specs/customXfaStyleDor.cy.js +++ b/ui.tests/test-module/specs/customXfaStyleDor.cy.js @@ -41,7 +41,7 @@ describe ('Custom XFA Style in Document of Record', () => { }); it('select a custom template', () => { - if (cy.af.isLatestAddon() && toggle_array.includes('FT_FORMS-2447')) { + if (cy.af.isLatestAddon() && toggle_array.includes('FT_FORMS-16858')) { cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + formContainerPathSelector); cy.invokeEditableAction("[data-action='dor']"); cy.get('coral-select[name="template"]').click(); @@ -53,7 +53,7 @@ describe ('Custom XFA Style in Document of Record', () => { }); it('dropdown for custom XFA style exist in the field', () => { - if (cy.af.isLatestAddon() && toggle_array.includes('FT_FORMS-2447')) { + if (cy.af.isLatestAddon() && toggle_array.includes('FT_FORMS-16858')) { cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + textInputEditPathSelector); cy.invokeEditableAction("[data-action='CONFIGURE']"); cy.get(".cmp-adaptiveform-textinput__editdialog coral-tab-label:contains('Document of Record')").click(); From c4ee11fc970baa7da839057f0debfa5b10c6d597 Mon Sep 17 00:00:00 2001 From: "Shrikha ." Date: Thu, 16 Jan 2025 08:24:11 +0530 Subject: [PATCH 7/7] adding toggle FT_FORMS-2447 --- ....granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json b/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json index 9ad9086e5e..079d4e6db7 100644 --- a/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json +++ b/it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json @@ -22,6 +22,7 @@ "FT_FORMS-14255", "FT_FORMS-14068", "FT_FORMS-16351", - "FT_FORMS-16858" + "FT_FORMS-16858", + "FT_FORMS-2447" ] }