Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FORMS-16858: Support for custom XFA styles #1500

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"FT_SITES-19631",
"FT_FORMS-14255",
"FT_FORMS-14068",
"FT_FORMS-16351"
s1mahanty marked this conversation as resolved.
Show resolved Hide resolved
"FT_FORMS-16351",
"FT_FORMS-2447"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,25 @@
ignoreData="{Boolean}true"
name="dorExclusion@TypeHint"
value="Boolean"/>
<dorFieldStyling
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
emptyText="Select styling option"
fieldLabel="Component Style"
fieldDescription="These styles are derived from the Document of Record template (XDP) associated with this adaptive form."
forceSelection="{Boolean}true"
name="./dorFieldStyling">
<granite:rendercondition
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/renderconditions/featuretoggle"
toggleName="FT_FORMS-2447"/>
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="fd/af/dor/datasource/fieldstyling"/>
<granite:data
jcr:primaryType="nt:unstructured"
af.listeners.onload="guidelib.touchlib.editLayer.dialogUtils.selectDefaultDoRFieldStyling()"/>
</dorFieldStyling>
<dorColspan
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,25 @@
</table>
</items>
</dorLayoutType>
<dorFieldStyling
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
emptyText="Select styling option"
fieldLabel="Component Style"
fieldDescription="These styles are derived from the Document of Record template (XDP) associated with this adaptive form."
forceSelection="{Boolean}true"
name="./dorFieldStyling">
<granite:rendercondition
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/renderconditions/featuretoggle"
toggleName="FT_FORMS-2447"/>
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="fd/af/dor/datasource/fieldstyling"/>
<granite:data
jcr:primaryType="nt:unstructured"
af.listeners.onload="guidelib.touchlib.editLayer.dialogUtils.selectDefaultDoRFieldStyling()"/>
</dorFieldStyling>
<dorNumCols
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete"
Expand Down
64 changes: 64 additions & 0 deletions ui.tests/test-module/specs/customXfaStyleDor.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
*
* 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 + "']";

let toggle_array = [];

before(() => {
cy.fetchFeatureToggles().then((response) => {
if (response.status === 200) {
toggle_array = response.body.enabled;
}
})
});

beforeEach(() => {
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', () => {
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');
}
});

});
Loading