diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImpl.java index ba467f2eab..390b2b4107 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImpl.java @@ -46,6 +46,7 @@ public class TermsAndConditionsImpl extends PanelImpl implements TermsAndConditions { private static final String CUSTOM_TNC_PROPERTY = "fd:tnc"; + private static final String SHOW_AS_POPUP_PROPERTY = "fd:showAsPopup"; @JsonIgnore @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_SHOW_APPROVAL_OPTION) @@ -88,6 +89,7 @@ public boolean isShowAsPopup() { if (resource.getValueMap().containsKey(CUSTOM_TNC_PROPERTY)) { properties.put(CUSTOM_TNC_PROPERTY, true); } + properties.put(SHOW_AS_POPUP_PROPERTY, isShowAsPopup()); return properties; } diff --git a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImplTest.java b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImplTest.java index 228abc2260..fcc80af614 100644 --- a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImplTest.java +++ b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TermsAndConditionsImplTest.java @@ -105,6 +105,8 @@ public void testCustomFDProperty() { Map props = tnc.getProperties(); Assert.assertTrue(props.containsKey("fd:tnc")); Assert.assertTrue((Boolean) props.get("fd:tnc")); + Assert.assertTrue(props.containsKey("fd:showAsPopup")); + Assert.assertTrue((Boolean) props.get("fd:showAsPopup")); } diff --git a/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditions.json b/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditions.json index 135c166a6d..6f72c3d44e 100644 --- a/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditions.json +++ b/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditions.json @@ -6,6 +6,7 @@ "properties": { "fd:path": "/content/termsandconditions", "fd:tnc": true, + "fd:showAsPopup": true, "customProp": "customPropValue" }, "label": { diff --git a/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditionsNoWrapData.json b/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditionsNoWrapData.json index 17ad1f88c1..41dfbd898a 100644 --- a/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditionsNoWrapData.json +++ b/bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditionsNoWrapData.json @@ -4,7 +4,8 @@ "name": "termsandconditions1694159302516", "properties": { "fd:path": "/content/termsandconditionsNoWrapData", - "fd:tnc": true + "fd:tnc": true, + "fd:showAsPopup": true }, "label": { "value": "Terms And Conditions" diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/fileinput/fileinputv4/basic/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/fileinput/fileinputv4/basic/.content.xml index fd4851bff2..595ea3b5ff 100644 --- a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/fileinput/fileinputv4/basic/.content.xml +++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/fileinput/fileinputv4/basic/.content.xml @@ -53,6 +53,7 @@ jcr:title="File Input - 3" sling:resourceType="core/fd/components/form/fileinput/v4/fileinput" accept="[application/pdf]" + acceptMessage="This file type is not supported!" description="This is long description" fieldType="file-input" id="fileinput_tooltip_scenario_test" diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/_cq_themeConfig/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/_cq_themeConfig/.content.xml index c6c16ccf52..db0cedbb0f 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/_cq_themeConfig/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/_cq_themeConfig/.content.xml @@ -264,6 +264,24 @@ cssSelector=".cmp-adaptiveform-container__hamburger-menu-link:active"/> + + + + + + + propertySheet="/mnt/overlay/fd/af/components/stylePropertySheet/common"> + + + + + propertySheet="/mnt/overlay/fd/af/components/stylePropertySheet/common"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { }); }); + it('should display a custom error message configured by the user for unsupported file type', () => { + const [id, fieldView] = Object.entries(formContainer._fields)[2]; + const model = formContainer._model.getElement(id); + const fileInput = "input[name='fileinput3']"; + cy.attachFile(fileInput, ['sample.svg']); + cy.on('window:alert', (alertText) => { + expect(alertText).to.equal(model.getState().constraintMessages.accept); + }); + }); + it('file when uploaded again should give actual size', () => { let sampleFileNames = ['sample.svg']; const fileInput = "input[name='fileinput2']";