From 119559d4f375fc960432483177afd76ebc17610c Mon Sep 17 00:00:00 2001 From: Shrikha Date: Wed, 28 Feb 2024 15:58:55 +0530 Subject: [PATCH 1/7] Baseline template for Modal Component --- .../components/form/button/_cq_template.xml | 2 +- .../components/form/modal/.content.xml | 7 ++ .../components/form/modal/_cq_template.xml | 33 +++++ .../fd/components/form/modal/.content.xml | 3 + .../fd/components/form/modal/v1/.content.xml | 4 + .../form/modal/v1/modal/.content.xml | 24 ++++ .../form/modal/v1/modal/_cq_template.xml | 33 +++++ .../modal/v1/modal/clientlibs/.content.xml | 3 + .../v1/modal/clientlibs/runtime/.content.xml | 6 + .../modal/v1/modal/clientlibs/runtime/css.txt | 18 +++ .../clientlibs/runtime/css/modalview.css | 64 ++++++++++ .../modal/v1/modal/clientlibs/runtime/js.txt | 18 +++ .../modal/clientlibs/runtime/js/modalview.js | 119 ++++++++++++++++++ .../components/form/modal/v1/modal/modal.html | 49 ++++++++ .../components/form/modal/v1/modal/modal.js | 30 +++++ 15 files changed, 412 insertions(+), 1 deletion(-) create mode 100644 examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/modal/.content.xml create mode 100644 examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/modal/_cq_template.xml create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/.content.xml create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/.content.xml create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_template.xml create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/.content.xml create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/.content.xml create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css.txt create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css/modalview.css create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js.txt create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js/modalview.js create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.js diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/button/_cq_template.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/button/_cq_template.xml index e1f9818177..04d058ebfb 100644 --- a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/button/_cq_template.xml +++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/button/_cq_template.xml @@ -3,4 +3,4 @@ jcr:primaryType="nt:unstructured" jcr:title="Button" fieldType="button" - dorExclusion="true"/> + dorExclusion="true"/> \ No newline at end of file diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/modal/.content.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/modal/.content.xml new file mode 100644 index 0000000000..08d3cb44f0 --- /dev/null +++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/modal/.content.xml @@ -0,0 +1,7 @@ + + diff --git a/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/modal/_cq_template.xml b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/modal/_cq_template.xml new file mode 100644 index 0000000000..5658ccbe59 --- /dev/null +++ b/examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/modal/_cq_template.xml @@ -0,0 +1,33 @@ + + + + + + + + \ No newline at end of file diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/.content.xml new file mode 100644 index 0000000000..491392d539 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/.content.xml @@ -0,0 +1,3 @@ + + diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/.content.xml new file mode 100644 index 0000000000..dcdd5f7014 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/.content.xml @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml new file mode 100644 index 0000000000..8a12fa36a3 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml @@ -0,0 +1,24 @@ + + + \ No newline at end of file diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_template.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_template.xml new file mode 100644 index 0000000000..5658ccbe59 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_template.xml @@ -0,0 +1,33 @@ + + + + + + + + \ No newline at end of file diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/.content.xml new file mode 100644 index 0000000000..491392d539 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/.content.xml @@ -0,0 +1,3 @@ + + diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/.content.xml new file mode 100644 index 0000000000..cb54834104 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/.content.xml @@ -0,0 +1,6 @@ + + diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css.txt b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css.txt new file mode 100644 index 0000000000..46ae9ad06a --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css.txt @@ -0,0 +1,18 @@ +############################################################################### +# Copyright 2022 Adobe +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################### + +#base=css +modalview.css diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css/modalview.css b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css/modalview.css new file mode 100644 index 0000000000..18a5f6141d --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css/modalview.css @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright 2024 Adobe + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +.cmp-adaptiveform-modal__panel-container { + /* ... */ + z-index: 100; /* Make sure the panel container is above the overlay */ + transition: opacity 0.3s, transform 0.3s; + opacity: 0; + transform: translateY(-10%); +} + +.cmp-adaptiveform-modal__panel-container--hidden { + display: none; +} + +.cmp-adaptiveform-modal__panel-container--visible { + display: block; + opacity: 1; + transform: translateY(0); +} + +.cmp-adaptiveform-modal__overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */ + z-index: 99; /* Make sure the overlay is below the panel container */ +} + +.cmp-adaptiveform-modal__overlay--hidden { + display: none; +} + +.cmp-adaptiveform-modal__overlay--visible { + display: block; +} + +.cmp-adaptiveform-modal__close { + position: absolute; + top: 10px; + right: 10px; + background: #f1f1f1; + color: #333; + border: none; + font-size: 24px; + padding: 10px; + cursor: pointer; + border-radius: 50%; +} diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js.txt b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js.txt new file mode 100644 index 0000000000..6ceca79974 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js.txt @@ -0,0 +1,18 @@ +############################################################################### +# Copyright 2022 Adobe +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################### + +#base=js +modalview.js diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js/modalview.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js/modalview.js new file mode 100644 index 0000000000..57bfd6a464 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js/modalview.js @@ -0,0 +1,119 @@ +/******************************************************************************* + * Copyright 2024 Adobe + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +(function () { + + class Modal extends FormView.FormPanel { + static NS = FormView.Constants.NS; + static IS = "adaptiveFormModal"; + static bemBlock = 'cmp-adaptiveform-modal'; + static selectors = { + self: "[data-" + this.NS + '-is="' + this.IS + '"]', + label: `.${Modal.bemBlock}__label`, + description: `.${Modal.bemBlock}__longdescription`, + qm: `.${Modal.bemBlock}__questionmark`, + tooltipDiv: `.${Modal.bemBlock}__shortdescription`, + closeButton: `.${Modal.bemBlock}__close`, + openButton: `.${Modal.bemBlock}__button`, + panelContainer: `.${Modal.bemBlock}__panel-container`, + overlay: `.${Modal.bemBlock}__overlay` + }; + + constructor(params) { + super(params); + this.setupEventListeners(); + this.#handleScroll() + } + + showModal() { + var overlay = this.element.querySelector(this.constructor.selectors.overlay); + overlay.classList.remove(`${this.constructor.bemBlock}__overlay--hidden`); + overlay.classList.add(`${this.constructor.bemBlock}__overlay--visible`); + + // Prevent background scrolling + document.body.style.overflow = 'hidden'; + } + + hideModal() { + var overlay = this.element.querySelector(this.constructor.selectors.overlay); + overlay.classList.remove(`${this.constructor.bemBlock}__overlay--visible`); + overlay.classList.add(`${this.constructor.bemBlock}__overlay--hidden`); + + // Allow background scrolling + document.body.style.overflow = 'auto'; + } + + + setupEventListeners() { + var openButton = this.element.querySelector(Modal.selectors.openButton); + var closeButton = this.element.querySelector(Modal.selectors.closeButton); + + // Open the modal when the open button is clicked + openButton.addEventListener('click', () => { + this.showModal(); + }); + + // Close the modal when the close button is clicked + closeButton.addEventListener('click', () => { + this.hideModal(); + }); + + // Close the modal when the 'Esc' key is pressed + document.addEventListener('keydown', (event) => { + if (event.key === 'Escape') { + this.hideModal(); + } + }); + } + + #handleScroll() { + var panelContainer = this.element.querySelector(this.constructor.selectors.panelContainer); + + // Add scroll to the panel container + panelContainer.style.overflowY = 'auto'; + panelContainer.style.maxHeight = '100vh'; + } + + getWidget() { + return null; + } + + getDescription() { + return this.element.querySelector(TermsAndConditions.selectors.description); + } + + getLabel() { + return null; + } + + getErrorDiv() { + return null; + } + + getTooltipDiv() { + return this.element.querySelector(Modal.selectors.tooltipDiv); + } + + getQuestionMarkDiv() { + return this.element.querySelector(Modal.selectors.qm); + } + + + } + + FormView.Utils.setupField(({element, formContainer}) => { + return new Modal({element, formContainer}) + }, Modal.selectors.self); +})(); diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html new file mode 100644 index 0000000000..16969f00c6 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html @@ -0,0 +1,49 @@ + + + + + + \ No newline at end of file diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.js new file mode 100644 index 0000000000..40aee1cde9 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.js @@ -0,0 +1,30 @@ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Copyright 2024 Adobe + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + +use(function () { + + var labelPath = 'core/fd/components/af-commons/v1/fieldTemplates/label.html'; + var shortDescriptionPath = "core/fd/components/af-commons/v1/fieldTemplates/shortDescription.html"; + var longDescriptionPath = "core/fd/components/af-commons/v1/fieldTemplates/longDescription.html"; + var questionMarkPath = "core/fd/components/af-commons/v1/fieldTemplates/questionMark.html"; + return { + labelPath: labelPath, + shortDescriptionPath: shortDescriptionPath, + longDescriptionPath: longDescriptionPath, + questionMarkPath: questionMarkPath + } +}); + From b45d269b049338a153f6d18436fd5635acedabe6 Mon Sep 17 00:00:00 2001 From: Shrikha Date: Wed, 20 Mar 2024 10:17:32 +0530 Subject: [PATCH 2/7] FORMS-13470: Modal component css, js --- .../samples/modal/.content.xml | 5 + .../samples/modal/basic/.content.xml | 25 ++++ .../renditions/cq5dam.thumbnail.140.100.png | Bin 0 -> 1000 bytes .../.content.xml | 7 + .../renditions/cq5dam.thumbnail.319.319.png | Bin 0 -> 3181 bytes .../.content.xml | 7 + .../renditions/cq5dam.thumbnail.48.48.png | Bin 0 -> 387 bytes .../.content.xml | 7 + .../samples/modal/.content.xml | 3 + .../samples/modal/basic/.content.xml | 72 ++++++++++ .../.content.xml | 2 +- .../components/form/modal/v1/modal/README.md | 71 ++++++++++ .../v1/modal/_cq_design_dialog/.content.xml | 39 ++++++ .../modal/v1/modal/_cq_dialog/.content.xml | 125 ++++++++++++++++++ .../form/modal/v1/modal/_cq_editConfig.xml | 37 ++++++ .../form/modal/v1/modal/_cq_template.xml | 1 - .../clientlibs/runtime/css/modalview.css | 64 --------- .../modal/clientlibs/runtime/js/modalview.js | 119 ----------------- .../clientlibs/{runtime => site}/.content.xml | 2 +- .../clientlibs/{runtime => site}/css.txt | 4 +- .../v1/modal/clientlibs/site/css/modal.css | 47 +++++++ .../modal/clientlibs/{runtime => site}/js.txt | 2 +- .../v1/modal/clientlibs/site/js/modalview.js | 95 +++++++++++++ .../components/form/modal/v1/modal/modal.html | 13 +- 24 files changed, 551 insertions(+), 196 deletions(-) create mode 100644 it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/.content.xml create mode 100644 it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/.content.xml create mode 100644 it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.140.100.png create mode 100644 it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.140.100.png.dir/.content.xml create mode 100644 it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.319.319.png create mode 100644 it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.319.319.png.dir/.content.xml create mode 100644 it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.48.48.png create mode 100644 it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.48.48.png.dir/.content.xml create mode 100644 it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/modal/.content.xml create mode 100644 it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/modal/basic/.content.xml create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/README.md create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_design_dialog/.content.xml create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_dialog/.content.xml create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_editConfig.xml delete mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css/modalview.css delete mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js/modalview.js rename ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/{runtime => site}/.content.xml (79%) rename ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/{runtime => site}/css.txt (95%) create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css/modal.css rename ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/{runtime => site}/js.txt (96%) create mode 100644 ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/js/modalview.js diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/.content.xml new file mode 100644 index 0000000000..5f8ea308be --- /dev/null +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/.content.xml @@ -0,0 +1,5 @@ + + diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/.content.xml new file mode 100644 index 0000000000..bb56568646 --- /dev/null +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/.content.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.140.100.png b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.140.100.png new file mode 100644 index 0000000000000000000000000000000000000000..7e350c86b0063bb03eccfb24fab8636bb2b1c534 GIT binary patch literal 1000 zcmeAS@N?(olHy`uVBq!ia0vp^6+oQI!3HGTbkwIaFfgz8ba4!+hH6!^l~=PCK0e{Yx^LgUY2Dr2FTYkT+!**lcE{B$&y^uu z|4NTfO42IOn?8BxPRo-iMsZ5NdG6$GPtDHuzIOfk(u)}_$0jFfZE(AKV)Eq4MI|LB zpHA#!vbV80@#)hhA75Y3r9qs%>L)`UG)|r@JagvEiOtQ;6aNKWd0E2r?qgz1T->Qw zuU4&Dvxa5i-H%IV@~n9u^EYzamMtPRZ(bgs|GQpi$IhJ-TU%Ly#wgb+_Dwo@fO-4& z?UT+wfBN&MrAgYs%a-A+%PuJO&+*!4e^H1e= zz20XT|MmJ7Uwn0P`P{1i=6^rTaOIH^WUfAR;G;o-3(p%)=HrJC2pVos=aJ!Oc0Y1p zoBo;B5C65bdh`9F1l#NNw(Q@lCr_wI*lUrVo*twj5;u3=ytceE(R_E_ zmN}ny++P;I#M8rOLs9(SvuVa9g*xolimw)z&2Rp_*V91oM|}iejwH-hn3Fk~e{@ohO9vXC2)0LcTRj>D%vq+l{f4=Rcn#{?_&3D&>{`T<@J!bC$P0Kb1G7 z^X7qFN$-FBu!uPLyf1Qrw%pfk3$CUvW>#Z^Js`XNK*)ovty-5aU*5E1 zheV7`c};}fw-*=6*S%9;^t + + + diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.319.319.png b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.319.319.png new file mode 100644 index 0000000000000000000000000000000000000000..c3d97cde70adf169f1018ad4fc83bc39e52e5540 GIT binary patch literal 3181 zcmd^CX;70%8V*v6GpL}jDiR^cAIXhwq|NlZ|VELS3+94bV^kqH<+LV#Rf!bWG^TL15lshS^MZ*})u-CghT zJWuBz4h>jgZflM}AXWq(^gn_?nD`mT*I$_#S0p(ONCaZ}jzIrCM>C@3!<~gk2k1=- zc%5~GkWiG!>H-}VB?!|$wOgG)d}o>6o_Kb*?KC8>Uou6F1$))^-vpINhO2P(D~_cV)Zt)Mw{8Z+r8^hz_6Z z7y*q813;RT`BxE23UaH!v*r3UY+HQb#=;A6@reHwIF+iG8Ryh?y(07kzFV49xQ;S8>} zv1f$xb$#*L(t%_moT#GDF`42(KXG$khq6qXPDrNsY!?B%ERo6hD!w^46Yqv;m?C6? zD*4YYLG&w(1XT}2`Dl4)+MWnwlAC(>W8;Z&QEyd+m z#3?Pz3<>s0P6~!5h6-u(cB4Z&{lkYsl8B*sanpbld}FMWWZgAEf#TPa4OZDnhuW1D zQZJFJK8!qg-B_B$g|_CozMHLOYsXN&9O;on+898VvjnAFfG6te%7Sb<9KqEY7bl8T zjr4{-B`3Kigkm2=Y4q-isFWs$&R(BIPiVT7T6p>m9T0NlBk8+=7Uq)X(LNcGVk`e} z=n0@n#(O)<96ce2&hXcICm-PN$Q6CCm!BLHodxstx-xvsw*+6M$B)&z`@Io z#7R9kc_r?+Dhrfv<;IO0wQbu^2 z?%bKZ-oWgScDOycxw*a7Ar)+CYR~QcvKP1Zkw@bhMlPgUqN?u%6cPyLtb*9)+!b`X zKQtIQR&z(gi!}^o)#6pt!$Gdh&xq zrr?z`lom$!e$|NW&#E=^nuPd^psI30*D%$8Kj@=|h&e}9Ki=eind_7>YjtkXpr_k? z4-LK^>(oR%6`W6l)e0f@bgW2GzB8fs=JvQxWSS6YAvQ`0P8gm=6q6e|I-B?|hhQTu zZN@$zL4m2f^#)ieGCs*ok+6qXT1rH)3eJpo+@Ra-g`Sk}&llGkQ?oJ2s2{R~rCX!Q zeYL;b@jwx>55l%3#3f@b6!-IR>^Sr3 z7{9$w=iR-^FLD(ItPA@>SA8kCT3ZX&_R0EceEhOLsj>bsN;O}#GyZR%x$;Zq{N2p- a?iK~w9WQRr)EU1Kh`{}!{txz^{^8$8%x~`i literal 0 HcmV?d00001 diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.319.319.png.dir/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.319.319.png.dir/.content.xml new file mode 100644 index 0000000000..34d9f64840 --- /dev/null +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.319.319.png.dir/.content.xml @@ -0,0 +1,7 @@ + + + + diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.48.48.png b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.48.48.png new file mode 100644 index 0000000000000000000000000000000000000000..8aae24bb92b1711271888ec23749bf45aead9024 GIT binary patch literal 387 zcmV-}0et?6P)Nkl2Wd5Qg*r|4@67RzX_)13lD3dXaiiV|8tJy-a-rLfM7vhk-TC9G=TeX7Dkv`+At? znQobbUbr<_AT}%z8y1KS3&e&6E-_6L2_cO7H3 z3aabc=(!Li0Gg(uBuS|2I-|EDr97k8S0JC~IhAE;^jrxR0C>BnzNe2y((Cct3(WjT zb^ZtRy*_Lb0G&|u_$KJHmtH(9Gnm!)`EnJ3=l98|+jv@LSYW#TbRQOKp;dg)O)T32_X6+0^5R^ElxuokvvUP8iv8>yAUMc%5Fbs_5=&Wh6Q57 h0)nYrp^i002ovPDHLkV1iRkr)mHI literal 0 HcmV?d00001 diff --git a/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.48.48.png.dir/.content.xml b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.48.48.png.dir/.content.xml new file mode 100644 index 0000000000..34d9f64840 --- /dev/null +++ b/it/content/src/main/content/jcr_root/content/dam/formsanddocuments/core-components-it/samples/modal/basic/_jcr_content/renditions/cq5dam.thumbnail.48.48.png.dir/.content.xml @@ -0,0 +1,7 @@ + + + + diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/modal/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/modal/.content.xml new file mode 100644 index 0000000000..a0ac99e384 --- /dev/null +++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/modal/.content.xml @@ -0,0 +1,3 @@ + + diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/modal/basic/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/modal/basic/.content.xml new file mode 100644 index 0000000000..1ba7dd3dca --- /dev/null +++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/modal/basic/.content.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/af-clientlibs/core-forms-components-runtime-all/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/af-clientlibs/core-forms-components-runtime-all/.content.xml index 8786fcc5dd..5357a799ae 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/af-clientlibs/core-forms-components-runtime-all/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/af-clientlibs/core-forms-components-runtime-all/.content.xml @@ -5,4 +5,4 @@ cssProcessor="[default:none,min:none]" jsProcessor="[default:none,min:none]" categories="[core.forms.components.runtime.all]" - embed="[core.forms.components.runtime.base,core.forms.components.container.v2.runtime,core.forms.components.datePicker.v1.runtime,core.forms.components.textinput.v1.runtime,core.forms.components.numberinput.v1.runtime,core.forms.components.panelcontainer.v1.runtime,core.forms.components.radiobutton.v1.runtime,core.forms.components.text.v1.runtime,core.forms.components.checkboxgroup.v1.runtime,core.forms.components.button.v1.runtime,core.forms.components.image.v1.runtime,core.forms.components.dropdown.v1.runtime,core.forms.components.fileinput.v2.runtime,core.forms.components.accordion.v1.runtime,core.forms.components.tabs.v1.runtime,core.forms.components.wizard.v1.runtime,core.forms.components.verticaltabs.v1.runtime,core.forms.components.recaptcha.v1.runtime,core.forms.components.checkbox.v1.runtime,core.forms.components.fragment.v1.runtime,core.forms.components.switch.v1.runtime,core.forms.components.termsandconditions.v1.runtime]"/> + embed="[core.forms.components.runtime.base,core.forms.components.container.v2.runtime,core.forms.components.datePicker.v1.runtime,core.forms.components.textinput.v1.runtime,core.forms.components.numberinput.v1.runtime,core.forms.components.panelcontainer.v1.runtime,core.forms.components.radiobutton.v1.runtime,core.forms.components.text.v1.runtime,core.forms.components.checkboxgroup.v1.runtime,core.forms.components.button.v1.runtime,core.forms.components.image.v1.runtime,core.forms.components.dropdown.v1.runtime,core.forms.components.fileinput.v2.runtime,core.forms.components.accordion.v1.runtime,core.forms.components.tabs.v1.runtime,core.forms.components.wizard.v1.runtime,core.forms.components.verticaltabs.v1.runtime,core.forms.components.recaptcha.v1.runtime,core.forms.components.checkbox.v1.runtime,core.forms.components.fragment.v1.runtime,core.forms.components.switch.v1.runtime,core.forms.components.termsandconditions.v1.runtime,core.forms.components.modal.v1.runtime]"/> diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/README.md b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/README.md new file mode 100644 index 0000000000..b329d4423d --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/README.md @@ -0,0 +1,71 @@ + +Adaptive Form Modal (v1) +==== + +## Introduction + +The Modal component is a part of the Adobe Forms Core Components library. It provides a dialog box or popup window that is displayed on top of the current page. + +## Features + +- Display content in a layer above the current page +- Close the modal when the Escape key is pressed +- Make the background inactive when the modal is open + +### Edit Dialog Properties +The following properties are written to JCR for this Form Panel component and are expected to be available as `Resource` properties: + +1. `./jcr:title` - defines the label to use for this field +2. `./hideTitle` - if set to `true`, the label of this field will be hidden +3. `./name` - defines the name of the field, which will be submitted with the form data +4. `./description` - defines a help message that can be rendered in the field as a hint for the user +5. `./readOnly` - if set to `true`, the filed will be read only + + +## Client Libraries +The component provides a `core.forms.components.termsandconditions.v1.runtime` client library category that contains the Javascript runtime for the component. +It should be added to a relevant site client library using the `embed` property. + + +## BEM Description +``` +BLOCK cmp-adaptiveform-modal + ELEMENT cmp-adaptiveform-modal__dialog + ELEMENT cmp-adaptiveform-modal__panel-container + MODIFIER cmp-adaptiveform-modal__panel-container--hidden + ELEMENT cmp-adaptiveform-modal__overlay + ELEMENT cmp-adaptiveform-modal__label-container + ELEMENT cmp-adaptiveform-modal__label + ELEMENT cmp-adaptiveform-modal__questionmark + ELEMENT cmp-adaptiveform-modal__shortdescription + ELEMENT cmp-adaptiveform-modal__longdescription +``` + +## JavaScript Data Attribute Bindings + +The following attributes must be added for the initialization of the text-input component in the form view: +1. `data-cmp-is="adaptiveFormModal"` +2. `data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}"` + + +The following are optional attributes that can be added to the component in the form view: +1. `data-cmp-valid` having a boolean value to indicate whether the field is currently valid or not +2. `data-cmp-required` having a boolean value to indicate whether the field is currently required or not +3. `data-cmp-readonly` having a boolean value to indicate whether the field is currently readonly or not +4. `data-cmp-active` having a boolean value to indicate whether the field is currently active or not +5. `data-cmp-visible` having a boolean value to indicate whether the field is currently visible or not +6. `data-cmp-enabled` having a boolean value to indicate whether the field is currently enabled or not diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_design_dialog/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_design_dialog/.content.xml new file mode 100644 index 0000000000..3838032ab5 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_design_dialog/.content.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_dialog/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_dialog/.content.xml new file mode 100644 index 0000000000..8afe73376f --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_dialog/.content.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + <richTextTitle + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/basic/items/columns/items/column/items/richTextTitle"/> + <isTitleRichText + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/basic/items/columns/items/column/items/isTitleRichText"/> + <hideTitle + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/basic/items/columns/items/column/items/hideTitle"/> + <visible + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/basic/items/columns/items/column/items/visible"/> + <visible-typehint + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/basic/items/columns/items/column/items/visible-typehint"/> + <enabled + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/basic/items/columns/items/column/items/enabled"/> + <enabled-typehint + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/basic/items/columns/items/column/items/enabled-typehint"/> + <readonly + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/basic/items/columns/items/column/items/readonly"/> + <readonly-typehint + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/basic/items/columns/items/column/items/readonly-typehint"/> + </items> + </column> + </items> + </columns> + </items> + </basic> + <help + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/help"/> + <accessibility + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/panelcontainer/v1/panelcontainer/cq:dialog/content/items/tabs/items/accessibility"/> + <dor + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="core/fd/components/form/base/v1/base/cq:dialog/content/items/tabs/items/dor"/> + <advanced + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/include" + path="/mnt/overlay/fd/af/authoring/dialog/customProperties/cq:dialog/advanced"/> + </items> + </tabs> + </items> + </content> +</jcr:root> diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_editConfig.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_editConfig.xml new file mode 100644 index 0000000000..2781716db4 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_editConfig.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" + jcr:primaryType="cq:EditConfig" + cq:actions="[editannotate,-,copymove,delete,-,insert,-]" + cq:dialogMode="floating" + cq:layout="editbar" + cq:disableTargeting="{Boolean}true"> + <cq:actionConfigs jcr:primaryType="nt:unstructured"> + <editexpression + jcr:primaryType="nt:unstructured" + handler="CQ.FormsCoreComponents.editorhooks.openRuleEditor" + order="after CONFIGURE" + icon="bidRule" + text="Edit Rules"/> + <replace + jcr:primaryType="nt:unstructured" + condition="CQ.FormsCoreComponents.editorhooks.isReplaceable" + handler="CQ.FormsCoreComponents.editorhooks.replace" + icon="shuffle" + text="Replace"/> + <qualifiedName + jcr:primaryType="nt:unstructured" + handler="CQ.FormsCoreComponents.editorhooks.viewQualifiedName" + icon="viewSOMExpression" + text="View Qualified Name"/> + </cq:actionConfigs> + <cq:inplaceEditing + jcr:primaryType="cq:InplaceEditingConfig" + active="{Boolean}true" + configPath="inplaceEditingConfig" + editorType="plaintext"> + <inplaceEditingConfig + jcr:primaryType="nt:unstructured" + editElementQuery="label:first" + textPropertyName="jcr:title"/> + </cq:inplaceEditing> +</jcr:root> \ No newline at end of file diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_template.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_template.xml index 5658ccbe59..c0fb7e4e63 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_template.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_template.xml @@ -28,6 +28,5 @@ <fd:events jcr:primaryType="nt:unstructured" click="dispatchEvent(panelcontainer, 'custom:setProperty', {visible : true()})"/> - </button> </jcr:root> \ No newline at end of file diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css/modalview.css b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css/modalview.css deleted file mode 100644 index 18a5f6141d..0000000000 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css/modalview.css +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright 2024 Adobe - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ - -.cmp-adaptiveform-modal__panel-container { - /* ... */ - z-index: 100; /* Make sure the panel container is above the overlay */ - transition: opacity 0.3s, transform 0.3s; - opacity: 0; - transform: translateY(-10%); -} - -.cmp-adaptiveform-modal__panel-container--hidden { - display: none; -} - -.cmp-adaptiveform-modal__panel-container--visible { - display: block; - opacity: 1; - transform: translateY(0); -} - -.cmp-adaptiveform-modal__overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */ - z-index: 99; /* Make sure the overlay is below the panel container */ -} - -.cmp-adaptiveform-modal__overlay--hidden { - display: none; -} - -.cmp-adaptiveform-modal__overlay--visible { - display: block; -} - -.cmp-adaptiveform-modal__close { - position: absolute; - top: 10px; - right: 10px; - background: #f1f1f1; - color: #333; - border: none; - font-size: 24px; - padding: 10px; - cursor: pointer; - border-radius: 50%; -} diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js/modalview.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js/modalview.js deleted file mode 100644 index 57bfd6a464..0000000000 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js/modalview.js +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright 2024 Adobe - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ -(function () { - - class Modal extends FormView.FormPanel { - static NS = FormView.Constants.NS; - static IS = "adaptiveFormModal"; - static bemBlock = 'cmp-adaptiveform-modal'; - static selectors = { - self: "[data-" + this.NS + '-is="' + this.IS + '"]', - label: `.${Modal.bemBlock}__label`, - description: `.${Modal.bemBlock}__longdescription`, - qm: `.${Modal.bemBlock}__questionmark`, - tooltipDiv: `.${Modal.bemBlock}__shortdescription`, - closeButton: `.${Modal.bemBlock}__close`, - openButton: `.${Modal.bemBlock}__button`, - panelContainer: `.${Modal.bemBlock}__panel-container`, - overlay: `.${Modal.bemBlock}__overlay` - }; - - constructor(params) { - super(params); - this.setupEventListeners(); - this.#handleScroll() - } - - showModal() { - var overlay = this.element.querySelector(this.constructor.selectors.overlay); - overlay.classList.remove(`${this.constructor.bemBlock}__overlay--hidden`); - overlay.classList.add(`${this.constructor.bemBlock}__overlay--visible`); - - // Prevent background scrolling - document.body.style.overflow = 'hidden'; - } - - hideModal() { - var overlay = this.element.querySelector(this.constructor.selectors.overlay); - overlay.classList.remove(`${this.constructor.bemBlock}__overlay--visible`); - overlay.classList.add(`${this.constructor.bemBlock}__overlay--hidden`); - - // Allow background scrolling - document.body.style.overflow = 'auto'; - } - - - setupEventListeners() { - var openButton = this.element.querySelector(Modal.selectors.openButton); - var closeButton = this.element.querySelector(Modal.selectors.closeButton); - - // Open the modal when the open button is clicked - openButton.addEventListener('click', () => { - this.showModal(); - }); - - // Close the modal when the close button is clicked - closeButton.addEventListener('click', () => { - this.hideModal(); - }); - - // Close the modal when the 'Esc' key is pressed - document.addEventListener('keydown', (event) => { - if (event.key === 'Escape') { - this.hideModal(); - } - }); - } - - #handleScroll() { - var panelContainer = this.element.querySelector(this.constructor.selectors.panelContainer); - - // Add scroll to the panel container - panelContainer.style.overflowY = 'auto'; - panelContainer.style.maxHeight = '100vh'; - } - - getWidget() { - return null; - } - - getDescription() { - return this.element.querySelector(TermsAndConditions.selectors.description); - } - - getLabel() { - return null; - } - - getErrorDiv() { - return null; - } - - getTooltipDiv() { - return this.element.querySelector(Modal.selectors.tooltipDiv); - } - - getQuestionMarkDiv() { - return this.element.querySelector(Modal.selectors.qm); - } - - - } - - FormView.Utils.setupField(({element, formContainer}) => { - return new Modal({element, formContainer}) - }, Modal.selectors.self); -})(); diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/.content.xml similarity index 79% rename from ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/.content.xml rename to ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/.content.xml index cb54834104..dc4bbcb4d3 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/.content.xml @@ -3,4 +3,4 @@ jcr:primaryType="cq:ClientLibraryFolder" allowProxy="{Boolean}true" categories="[core.forms.components.modal.v1.runtime]" - dependencies="[core.forms.components.runtime.base,core.forms.components.container.v2.runtime, core.forms.components.panelcontainer.v1.runtime]"/> + dependencies="[core.forms.components.runtime.base,core.forms.components.container.v2.runtime]"/> diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css.txt b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css.txt similarity index 95% rename from ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css.txt rename to ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css.txt index 46ae9ad06a..b68ef0c202 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/css.txt +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css.txt @@ -1,5 +1,5 @@ ############################################################################### -# Copyright 2022 Adobe +# Copyright 2023 Adobe # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,4 +15,4 @@ ############################################################################### #base=css -modalview.css +modal.css diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css/modal.css b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css/modal.css new file mode 100644 index 0000000000..0904e17619 --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css/modal.css @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright 2024 Adobe + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +.cmp-adaptiveform-modal__dialog{ + +} + +.cmp-adaptiveform-modal__panel-container { + +} + +.cmp-adaptiveform-modal__panel-container--hidden { + +} + +.cmp-adaptiveform-modal__overlay { + +} + +.cmp-adaptiveform-modal__errormessage{ + +} + +.cmp-adaptiveform-modal__label-container{ + +} + +.cmp-adaptiveform-modal__longdescription { + +} + +.cmp-adaptiveform-modal__shortdescription { + +} diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js.txt b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/js.txt similarity index 96% rename from ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js.txt rename to ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/js.txt index 6ceca79974..f108ec7a86 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/runtime/js.txt +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/js.txt @@ -1,5 +1,5 @@ ############################################################################### -# Copyright 2022 Adobe +# Copyright 2023 Adobe # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/js/modalview.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/js/modalview.js new file mode 100644 index 0000000000..4fbeee7a9f --- /dev/null +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/js/modalview.js @@ -0,0 +1,95 @@ +/******************************************************************************* + * Copyright 2024 Adobe + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +(function () { + + class Modal extends FormView.FormPanel { + static NS = FormView.Constants.NS; + static IS = "adaptiveFormModal"; + static bemBlock = 'cmp-adaptiveform-modal'; + static selectors = { + self: "[data-" + this.NS + '-is="' + this.IS + '"]', + label: `.${Modal.bemBlock}__label`, + description: `.${Modal.bemBlock}__longdescription`, + qm: `.${Modal.bemBlock}__questionmark`, + tooltipDiv: `.${Modal.bemBlock}__shortdescription`, + closePopupButton: `.${Modal.bemBlock}__close-button`, + dialog: `.${Modal.bemBlock}__dialog`, + panelContainer: `.${Modal.bemBlock}__panel-container`, + panelContainerHidden: `.${Modal.bemBlock}__panel-container--hidden`, + button: `.${Modal.bemBlock}__button`, + overlay: `.${Modal.bemBlock}__overlay` + }; + + constructor(params) { + super(params); + this.dialog = this.element.querySelector(Modal.selectors.dialog); + this.panelContainer = this.element.querySelector(Modal.selectors.panelContainer); + this.button = this.element.querySelector(Modal.selectors.button); + this.button.addEventListener('click', this.openModal.bind(this)); + document.addEventListener('keydown', this.handleKeyDown.bind(this)); + this.overlay = this.element.querySelector(Modal.selectors.overlay); + } + + openModal() { + this.dialog.style.display = 'block'; + this.panelContainer.classList.remove(Modal.selectors.panelContainerHidden); + document.body.classList.add(Modal.selectors.overlay.replace('.', '')); + } + + closeModal() { + this.dialog.style.display = 'none'; + this.panelContainer.classList.add(Modal.selectors.panelContainerHidden); + document.body.classList.remove(Modal.selectors.overlay.replace('.', '') + + ); + } + + handleKeyDown(event) { + if (event.key === 'Escape') { + this.closeModal(); + } + } + + getWidget() { + return null; + } + + getDescription() { + return this.element.querySelector(Modal.selectors.description); + } + + getLabel() { + return null; + } + + getErrorDiv() { + return null; + } + + getTooltipDiv() { + return this.element.querySelector(Modal.selectors.tooltipDiv); + } + + getQuestionMarkDiv() { + return this.element.querySelector(Modal.selectors.qm); + } + } + + FormView.Utils.setupField(({element, formContainer}) => { + return new Modal({element, formContainer}) + }, Modal.selectors.self); +})(); diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html index 16969f00c6..15782461c4 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html @@ -29,21 +29,20 @@ data-sly-use.component="com.adobe.cq.wcm.core.components.models.Component" id="${panel.id}" title="${panel.tooltipVisible ? '' : panel.tooltipText}" - data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}" - role="dialog"> + data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}"> <div class="cmp-adaptiveform-modal__label-container"> <div data-sly-call="${label.label @componentId=widgetId, labelValue=panel.label.value, labelVisible=panel.label.visible, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> <div data-sly-call="${questionMark.questionMark @componentId=panel.id, longDescription=panel.description, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> </div> - <div class="cmp-adaptiveform-modal__overlay cmp-adaptiveform-modal__overlay--hidden" role="dialog" > - <div class="cmp-adaptiveform-modal__panel-container cmp-adaptiveform-modal__panel-container--hidden" data-sly-resource="${'panelcontainer'}"> - <button class="cmp-adaptiveform-modal__close">Close</button> + <div role="dialog"> + <div class="${wcmmode.preview || wcmmode.disabled ? 'cmp-adaptiveform-modal__dialog' : ''}"> + <div class="cmp-adaptiveform-modal__panel-container" data-sly-resource="${'panelcontainer'}"></div> </div> - <div class="cmp-adaptiveform-modal__button" data-sly-resource="${'button'}"></div> </div> + <div class="cmp-adaptiveform-modal__button" data-sly-resource="${'button'}"></div> <div data-sly-call="${shortDescription.shortDescription @componentId=panel.id, shortDescriptionVisible=panel.tooltipVisible, shortDescription=panel.tooltip, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> <div data-sly-call="${longDescription.longDescription @componentId=panel.id, longDescription=panel.description, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> -</div> \ No newline at end of file +</div> From f13326d535df2b83362ca53e95149c6a4db410c5 Mon Sep 17 00:00:00 2001 From: Shrikha <smahanty@adobe.com> Date: Wed, 20 Mar 2024 14:34:39 +0530 Subject: [PATCH 3/7] FORMS-13470: runtime test case for modal --- .../form/modal/v1/modal/.content.xml | 2 +- .../specs/modal/modal.runtime.spec.js | 56 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 ui.tests/test-module/specs/modal/modal.runtime.spec.js diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml index 8a12fa36a3..82a675aecf 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml @@ -20,5 +20,5 @@ jcr:description="Modal" jcr:primaryType="cq:Component" jcr:title="Adaptive Form Modal (v1)" - sling:resourceSuperType="wcm/foundation/components/responsivegrid" + sling:resourceSuperType="core/fd/components/form/panelcontainer/v1/panelcontainer" componentGroup=".core-adaptiveform"/> \ No newline at end of file diff --git a/ui.tests/test-module/specs/modal/modal.runtime.spec.js b/ui.tests/test-module/specs/modal/modal.runtime.spec.js new file mode 100644 index 0000000000..45839d8dc4 --- /dev/null +++ b/ui.tests/test-module/specs/modal/modal.runtime.spec.js @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright 2024 Adobe + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +describe('Form Runtime with Modal Component', () => { + const pagePath = "content/forms/af/core-components-it/samples/modal/basic.html" + const bemBlock = 'cmp-adaptiveform-modal' + const IS = "adaptiveFormModal" + const selectors = { + modal : `[data-cmp-is="${IS}"]` + } + + let formContainer = null + + beforeEach(() => { + cy.previewForm(pagePath).then(p => { + formContainer = p; + }) + }); + + it('opens the modal when the button is clicked, and makes the background inactive', () => { + // Click the button to open the modal + cy.get(`.${bemBlock}__button`).click(); + + // Check that the modal and overlay are visible + cy.get(`.${bemBlock}__dialog`).should('be.visible'); + + cy.get(`.${bemBlock}__overlay`).should('be.visible'); + }); + + it('closes the modal when the Escape key is pressed, and makes the background active again', () => { + // Open the modal + cy.get(`.${bemBlock}__button`).click(); + + // Check that the modal is visible + cy.get(`.${bemBlock}__overlay`).should('be.visible'); + + // Simulate pressing the Escape key + cy.get('body').type('{esc}'); + + // Check that the modal is no longer visible + cy.get(`.${bemBlock}__overlay`).should('not.exist'); + }); + +}); \ No newline at end of file From ba4dc63618f1476856f441105a10e53453f074b3 Mon Sep 17 00:00:00 2001 From: Shrikha <smahanty@adobe.com> Date: Thu, 21 Mar 2024 09:31:09 +0530 Subject: [PATCH 4/7] FORMS-13470: add temp css for the test --- .../v1/modal/clientlibs/site/css/modal.css | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css/modal.css b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css/modal.css index 0904e17619..2aae4746db 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css/modal.css +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css/modal.css @@ -15,33 +15,35 @@ ******************************************************************************/ .cmp-adaptiveform-modal__dialog{ - + display: none; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-color: white; + border: 1px solid #ccc; + box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); + padding: 20px; + z-index: 1002; /* Ensure it's above other content */ + max-width: 80%; /* Adjust as needed */ + max-height: 80%; /* Adjust as needed */ + overflow: auto; /* Enable scrolling if content exceeds dimensions */ + pointer-events: auto; } .cmp-adaptiveform-modal__panel-container { - -} - -.cmp-adaptiveform-modal__panel-container--hidden { - + background-color: #f0f0f0; /* Example: Change the background color */ + padding: 20px; /* Example: Add padding */ + border-radius: 10px; /* Example: Add border radius */ } .cmp-adaptiveform-modal__overlay { - -} - -.cmp-adaptiveform-modal__errormessage{ - -} - -.cmp-adaptiveform-modal__label-container{ - -} - -.cmp-adaptiveform-modal__longdescription { - -} - -.cmp-adaptiveform-modal__shortdescription { - + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + z-index: 1001; + pointer-events: none; } From 8f735de54dbce56fd9d9c09d14ad019a677a5766 Mon Sep 17 00:00:00 2001 From: Shrikha <smahanty@adobe.com> Date: Wed, 27 Mar 2024 14:59:12 +0530 Subject: [PATCH 5/7] Changes made in ButtonImpl to align with the schema --- .../internal/models/v1/form/ButtonImpl.java | 6 + .../internal/models/v1/form/ModalImpl.java | 2 + .../core/components/models/form/Modal.java | 2 + .../models/v1/form/ModalImplTest.java | 126 ++++++++++++++++++ .../resources/form/modal/exporter-modal.json | 0 .../resources/form/modal/test-content.json | 0 6 files changed, 136 insertions(+) create mode 100644 bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImpl.java create mode 100644 bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Modal.java create mode 100644 bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImplTest.java create mode 100644 bundles/af-core/src/test/resources/form/modal/exporter-modal.json create mode 100644 bundles/af-core/src/test/resources/form/modal/test-content.json diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ButtonImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ButtonImpl.java index 3380c5685f..2fc2a00752 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ButtonImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ButtonImpl.java @@ -81,6 +81,7 @@ public String getDefault() { return defaultValue; } + @JsonIgnore @Override public String getButtonType() { return buttonType; @@ -114,6 +115,11 @@ public Map<String, Object> getProperties() { return properties; } + @Override + public Type getType() { + return null; + } + @Override @NotNull protected FormComponentData getComponentData() { diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImpl.java new file mode 100644 index 0000000000..96bd1f0809 --- /dev/null +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImpl.java @@ -0,0 +1,2 @@ +package com.adobe.cq.forms.core.components.internal.models.v1.form;public class ModalImpl { +} diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Modal.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Modal.java new file mode 100644 index 0000000000..830804189d --- /dev/null +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Modal.java @@ -0,0 +1,2 @@ +package com.adobe.cq.forms.core.components.models.form;public class Modal { +} diff --git a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImplTest.java b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImplTest.java new file mode 100644 index 0000000000..57c936958b --- /dev/null +++ b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImplTest.java @@ -0,0 +1,126 @@ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Copyright 2023 Adobe + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +package com.adobe.cq.forms.core.components.internal.models.v1.form; + +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import org.apache.sling.api.resource.Resource; +import org.junit.Assert; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mockito; + +import com.adobe.cq.export.json.SlingModelFilter; +import com.adobe.cq.forms.core.Utils; +import com.adobe.cq.forms.core.components.internal.form.FormConstants; +import com.adobe.cq.forms.core.components.models.form.TermsAndConditions; +import com.adobe.cq.forms.core.context.FormsCoreComponentTestContext; +import com.day.cq.wcm.api.NameConstants; +import com.day.cq.wcm.msm.api.MSMNameConstants; +import io.wcm.testing.mock.aem.junit5.AemContext; +import io.wcm.testing.mock.aem.junit5.AemContextExtension; + +import static org.junit.Assert.assertEquals; + +@ExtendWith(AemContextExtension.class) +public class TermsAndConditionsImplTest { + + private static final String BASE = "/form/termsandconditions"; + private static final String CONTENT_ROOT = "/content"; + + private static final String PATH_TNC = CONTENT_ROOT + "/termsandconditions"; + + private static final String PATH_NOWRAP_TNC = CONTENT_ROOT + "/termsandconditionsNoWrapData"; + + private final AemContext context = FormsCoreComponentTestContext.newAemContext(); + + @BeforeEach + public void setUp() { + context.load().json(BASE + FormsCoreComponentTestContext.TEST_CONTENT_JSON, CONTENT_ROOT); + context.registerService(SlingModelFilter.class, new SlingModelFilter() { + + private final Set<String> IGNORED_NODE_NAMES = new HashSet<String>() { + { + add(NameConstants.NN_RESPONSIVE_CONFIG); + add(MSMNameConstants.NT_LIVE_SYNC_CONFIG); + add("cq:annotations"); + } + }; + + @Override + public Map<String, Object> filterProperties(Map<String, Object> map) { + return map; + } + + @Override + public Iterable<Resource> filterChildResources(Iterable<Resource> childResources) { + return StreamSupport + .stream(childResources.spliterator(), false) + .filter(r -> !IGNORED_NODE_NAMES.contains(r.getName())) + .collect(Collectors.toList()); + } + }); + } + + @Test + void testExportedType() throws Exception { + TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); + assertEquals(FormConstants.RT_FD_FORM_TERMS_AND_CONDITIONS_V1, tnc.getExportedType()); + TermsAndConditions tncMock = Mockito.mock(TermsAndConditions.class); + Mockito.when(tncMock.getExportedType()).thenCallRealMethod(); + assertEquals("", tncMock.getExportedType()); + } + + @Test + public void testGetProperties() { + TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); + Assert.assertTrue(tnc.isShowApprovalOption()); + Assert.assertTrue(tnc.isShowAsPopup()); + Assert.assertFalse(tnc.isShowLink()); + } + + @Test + public void testCustomFDProperty() { + TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); + Map<String, Object> props = tnc.getProperties(); + Assert.assertTrue(props.containsKey("fd:tnc")); + Assert.assertTrue((Boolean) props.get("fd:tnc")); + + } + + @Test + void testJSONExport() throws Exception { + TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); + Utils.testJSONExport(tnc, Utils.getTestExporterJSONPath(BASE, PATH_TNC)); + } + + @Test + void testJSONExport_showLink() throws Exception { + TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_NOWRAP_TNC, TermsAndConditions.class, context); + Utils.testJSONExport(tnc, Utils.getTestExporterJSONPath(BASE, PATH_NOWRAP_TNC)); + } + + @Test + void testNoWrap() { + TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_NOWRAP_TNC, TermsAndConditions.class, context); + Assert.assertNull(tnc.getType()); + } +} diff --git a/bundles/af-core/src/test/resources/form/modal/exporter-modal.json b/bundles/af-core/src/test/resources/form/modal/exporter-modal.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bundles/af-core/src/test/resources/form/modal/test-content.json b/bundles/af-core/src/test/resources/form/modal/test-content.json new file mode 100644 index 0000000000..e69de29bb2 From db8c2f02dcda34dfde811797245b6062633c7f1e Mon Sep 17 00:00:00 2001 From: Shrikha <smahanty@adobe.com> Date: Wed, 27 Mar 2024 15:03:14 +0530 Subject: [PATCH 6/7] FORMS-13470: Added the marker interface for Modal. --- .../internal/form/FormConstants.java | 3 + .../internal/models/v1/form/ModalImpl.java | 38 ++++++- .../core/components/models/form/Modal.java | 30 +++++- .../models/v1/form/ModalImplTest.java | 59 +++-------- .../resources/form/modal/exporter-modal.json | 98 +++++++++++++++++++ .../resources/form/modal/test-content.json | 30 ++++++ .../form/modal/v1/modal/.content.xml | 2 +- .../components/form/modal/v1/modal/modal.html | 14 +-- 8 files changed, 219 insertions(+), 55 deletions(-) diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java index a2020efd07..affe5280e6 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java @@ -117,6 +117,9 @@ private FormConstants() { /** The resource type for terms and conditions v1 */ public static final String RT_FD_FORM_TERMS_AND_CONDITIONS_V1 = RT_FD_FORM_PREFIX + "termsandconditions/v1/termsandconditions"; + /** The resource type for modal v1 */ + public static final String RT_FD_FORM_MODAL_V1 = RT_FD_FORM_PREFIX + "modal/v1/modal"; + public static final String FORM_FIELD_TYPE = "form"; public static final String REQ_ATTR_FORMCONTAINER_PATH = "formContainerPath"; diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImpl.java index 96bd1f0809..b414af4fcc 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImpl.java @@ -1,2 +1,38 @@ -package com.adobe.cq.forms.core.components.internal.models.v1.form;public class ModalImpl { +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Copyright 2024 Adobe + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + +package com.adobe.cq.forms.core.components.internal.models.v1.form; + +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.Model; + +import com.adobe.cq.export.json.ComponentExporter; +import com.adobe.cq.export.json.ExporterConstants; +import com.adobe.cq.forms.core.components.internal.form.FormConstants; +import com.adobe.cq.forms.core.components.models.form.Modal; + +@Model( + adaptables = { SlingHttpServletRequest.class, Resource.class }, + adapters = { Modal.class, + ComponentExporter.class }, + resourceType = { FormConstants.RT_FD_FORM_MODAL_V1 }) + +@Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION) +public class ModalImpl extends PanelImpl implements Modal { + } diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Modal.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Modal.java index 830804189d..8d3ff05cad 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Modal.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Modal.java @@ -1,2 +1,30 @@ -package com.adobe.cq.forms.core.components.models.form;public class Modal { +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Copyright 2024 Adobe + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + +package com.adobe.cq.forms.core.components.models.form; + +import org.osgi.annotation.versioning.ConsumerType; + +/** + * Defines the form {@code Modal} Sling Model used for the + * {@code /apps/core/fd/components/form/modal/v1/modal} component. + * + * @since com.adobe.cq.forms.core.components.models.form 4.7.0 + */ +@ConsumerType +public interface Modal extends Container, ContainerConstraint, Base { + } diff --git a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImplTest.java b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImplTest.java index 57c936958b..ae934f1ebd 100644 --- a/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImplTest.java +++ b/bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ModalImplTest.java @@ -1,5 +1,5 @@ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ Copyright 2023 Adobe + ~ Copyright 2024 Adobe ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import java.util.stream.StreamSupport; import org.apache.sling.api.resource.Resource; -import org.junit.Assert; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -31,7 +30,7 @@ import com.adobe.cq.export.json.SlingModelFilter; import com.adobe.cq.forms.core.Utils; import com.adobe.cq.forms.core.components.internal.form.FormConstants; -import com.adobe.cq.forms.core.components.models.form.TermsAndConditions; +import com.adobe.cq.forms.core.components.models.form.Modal; import com.adobe.cq.forms.core.context.FormsCoreComponentTestContext; import com.day.cq.wcm.api.NameConstants; import com.day.cq.wcm.msm.api.MSMNameConstants; @@ -41,20 +40,19 @@ import static org.junit.Assert.assertEquals; @ExtendWith(AemContextExtension.class) -public class TermsAndConditionsImplTest { +public class ModalImplTest { - private static final String BASE = "/form/termsandconditions"; + private static final String BASE = "/form/modal"; private static final String CONTENT_ROOT = "/content"; - private static final String PATH_TNC = CONTENT_ROOT + "/termsandconditions"; - - private static final String PATH_NOWRAP_TNC = CONTENT_ROOT + "/termsandconditionsNoWrapData"; + private static final String PATH_MODAL = CONTENT_ROOT + "/modal"; private final AemContext context = FormsCoreComponentTestContext.newAemContext(); @BeforeEach public void setUp() { context.load().json(BASE + FormsCoreComponentTestContext.TEST_CONTENT_JSON, CONTENT_ROOT); + context.registerService(SlingModelFilter.class, new SlingModelFilter() { private final Set<String> IGNORED_NODE_NAMES = new HashSet<String>() { @@ -81,46 +79,17 @@ public Iterable<Resource> filterChildResources(Iterable<Resource> childResources } @Test - void testExportedType() throws Exception { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); - assertEquals(FormConstants.RT_FD_FORM_TERMS_AND_CONDITIONS_V1, tnc.getExportedType()); - TermsAndConditions tncMock = Mockito.mock(TermsAndConditions.class); - Mockito.when(tncMock.getExportedType()).thenCallRealMethod(); - assertEquals("", tncMock.getExportedType()); - } - - @Test - public void testGetProperties() { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); - Assert.assertTrue(tnc.isShowApprovalOption()); - Assert.assertTrue(tnc.isShowAsPopup()); - Assert.assertFalse(tnc.isShowLink()); - } - - @Test - public void testCustomFDProperty() { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); - Map<String, Object> props = tnc.getProperties(); - Assert.assertTrue(props.containsKey("fd:tnc")); - Assert.assertTrue((Boolean) props.get("fd:tnc")); - + void testExportedType() { + Modal modal = Utils.getComponentUnderTest(PATH_MODAL, Modal.class, context); + assertEquals(FormConstants.RT_FD_FORM_MODAL_V1, modal.getExportedType()); + Modal modalMock = Mockito.mock(Modal.class); + Mockito.when(modalMock.getExportedType()).thenCallRealMethod(); + assertEquals("", modalMock.getExportedType()); } @Test void testJSONExport() throws Exception { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context); - Utils.testJSONExport(tnc, Utils.getTestExporterJSONPath(BASE, PATH_TNC)); - } - - @Test - void testJSONExport_showLink() throws Exception { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_NOWRAP_TNC, TermsAndConditions.class, context); - Utils.testJSONExport(tnc, Utils.getTestExporterJSONPath(BASE, PATH_NOWRAP_TNC)); - } - - @Test - void testNoWrap() { - TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_NOWRAP_TNC, TermsAndConditions.class, context); - Assert.assertNull(tnc.getType()); + Modal modal = Utils.getComponentUnderTest(PATH_MODAL, Modal.class, context); + Utils.testJSONExport(modal, Utils.getTestExporterJSONPath(BASE, PATH_MODAL)); } } diff --git a/bundles/af-core/src/test/resources/form/modal/exporter-modal.json b/bundles/af-core/src/test/resources/form/modal/exporter-modal.json index e69de29bb2..e34dfd4920 100644 --- a/bundles/af-core/src/test/resources/form/modal/exporter-modal.json +++ b/bundles/af-core/src/test/resources/form/modal/exporter-modal.json @@ -0,0 +1,98 @@ +{ + "id": "modal-3f8ac07b1d", + "fieldType": "panel", + "name": "modal1711016014566", + "label": { + "value": "Modal" + }, + "events": { + "custom:setProperty": [ + "$event.payload" + ] + }, + "properties": { + "fd:dor": { + "dorExclusion": false, + "dorExcludeTitle": false, + "dorExcludeDescription": false + }, + "fd:path": "/content/modal" + }, + ":itemsOrder": [ + "panelcontainer", + "button" + ], + ":items": { + "panelcontainer": { + "id": "panelcontainer-bc5563a2b9", + "fieldType": "panel", + "name": "panelcontainer", + "label": { + "value": "Panel" + }, + "events": { + "custom:setProperty": [ + "$event.payload" + ] + }, + "properties": { + "fd:dor": { + "dorExclusion": false, + "dorExcludeTitle": false, + "dorExcludeDescription": false + }, + "fd:path": "/content/modal/panelcontainer" + }, + ":itemsOrder": [ + "datepicker" + ], + ":items": { + "datepicker": { + "id": "datepicker-43f0efd69b", + "fieldType": "date-input", + "name": "datepicker1711461935572", + "type": "string", + "label": { + "value": "Date Input" + }, + "events": { + "custom:setProperty": [ + "$event.payload" + ] + }, + "properties": { + "fd:dor": { + "dorExclusion": false + }, + "fd:path": "/content/modal/panelcontainer/datepicker" + }, + "format": "date", + ":type": "core/fd/components/form/datepicker/v1/datepicker" + } + }, + ":type": "core/fd/components/form/panelcontainer/v1/panelcontainer" + }, + "button": { + "id": "button-1605226465", + "fieldType": "button", + "name": "button1711016014673", + "properties": { + "fd:dor": { + "dorExclusion": false + }, + "fd:path": "/content/modal/button", + "fd:buttonType": "button" + }, + "label": { + "value": "Open Modal" + }, + "events": { + "custom:setProperty": [ + "$event.payload" + ] + }, + ":type": "core/fd/components/form/button/v1/button" + } + }, + ":type": "core/fd/components/form/modal/v1/modal" +} \ No newline at end of file diff --git a/bundles/af-core/src/test/resources/form/modal/test-content.json b/bundles/af-core/src/test/resources/form/modal/test-content.json index e69de29bb2..53f96982c3 100644 --- a/bundles/af-core/src/test/resources/form/modal/test-content.json +++ b/bundles/af-core/src/test/resources/form/modal/test-content.json @@ -0,0 +1,30 @@ +{ + "modal": { + "jcr:primaryType": "nt:unstructured", + "fieldType": "panel", + "jcr:title": "Modal", + "name": "modal1711016014566", + "sling:resourceType": "core/fd/components/form/modal/v1/modal", + "panelcontainer": { + "jcr:primaryType": "nt:unstructured", + "fieldType": "panel", + "jcr:title": "Panel", + "name": "panelcontainer", + "sling:resourceType": "core/fd/components/form/panelcontainer/v1/panelcontainer", + "datepicker" : { + "jcr:primaryType": "nt:unstructured", + "fieldType": "date-input", + "jcr:title": "Date Input", + "name": "datepicker1711461935572", + "sling:resourceType": "core/fd/components/form/datepicker/v1/datepicker" + } + }, + "button" : { + "jcr:primaryType": "nt:unstructured", + "fieldType": "button", + "jcr:title": "Open Modal", + "name": "button1711016014673", + "sling:resourceType": "core/fd/components/form/button/v1/button" + } + } +} \ No newline at end of file diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml index 82a675aecf..8a12fa36a3 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/.content.xml @@ -20,5 +20,5 @@ jcr:description="Modal" jcr:primaryType="cq:Component" jcr:title="Adaptive Form Modal (v1)" - sling:resourceSuperType="core/fd/components/form/panelcontainer/v1/panelcontainer" + sling:resourceSuperType="wcm/foundation/components/responsivegrid" componentGroup=".core-adaptiveform"/> \ No newline at end of file diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html index 15782461c4..7b92d6fd40 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/modal.html @@ -14,7 +14,7 @@ ~ limitations under the License. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/--> -<sly data-sly-use.panel="com.adobe.cq.forms.core.components.models.form.Panel" +<sly data-sly-use.modal="com.adobe.cq.forms.core.components.models.form.Modal" data-sly-use.renderer="${'modal.js'}" data-sly-use.label="${renderer.labelPath}" data-sly-use.shortDescription="${renderer.shortDescriptionPath}" @@ -27,13 +27,13 @@ data-cmp-is="adaptiveFormModal" data-sly-use.formstructparser="com.adobe.cq.forms.core.components.models.form.FormStructureParser" data-sly-use.component="com.adobe.cq.wcm.core.components.models.Component" - id="${panel.id}" - title="${panel.tooltipVisible ? '' : panel.tooltipText}" + id="${modal.id}" + title="${modal.tooltipVisible ? '' : modal.tooltipText}" data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}"> <div class="cmp-adaptiveform-modal__label-container"> - <div data-sly-call="${label.label @componentId=widgetId, labelValue=panel.label.value, labelVisible=panel.label.visible, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> - <div data-sly-call="${questionMark.questionMark @componentId=panel.id, longDescription=panel.description, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> + <div data-sly-call="${label.label @componentId=widgetId, labelValue=modal.label.value, labelVisible=modal.label.visible, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> + <div data-sly-call="${questionMark.questionMark @componentId=modal.id, longDescription=modal.description, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> </div> <div role="dialog"> @@ -43,6 +43,6 @@ </div> <div class="cmp-adaptiveform-modal__button" data-sly-resource="${'button'}"></div> - <div data-sly-call="${shortDescription.shortDescription @componentId=panel.id, shortDescriptionVisible=panel.tooltipVisible, shortDescription=panel.tooltip, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> - <div data-sly-call="${longDescription.longDescription @componentId=panel.id, longDescription=panel.description, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> + <div data-sly-call="${shortDescription.shortDescription @componentId=modal.id, shortDescriptionVisible=modal.tooltipVisible, shortDescription=modal.tooltip, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> + <div data-sly-call="${longDescription.longDescription @componentId=modal.id, longDescription=modal.description, bemBlock='cmp-adaptiveform-modal'}" data-sly-unwrap></div> </div> From 17cb589c225ad9ab336e6e80f975ad20b51df3ec Mon Sep 17 00:00:00 2001 From: Shrikha <smahanty@adobe.com> Date: Wed, 27 Mar 2024 17:03:03 +0530 Subject: [PATCH 7/7] Incorporated review comments --- .../apps/core/fd/components/form/modal/v1/modal/README.md | 2 +- .../form/modal/v1/modal/_cq_design_dialog/.content.xml | 2 +- .../fd/components/form/modal/v1/modal/_cq_dialog/.content.xml | 2 +- .../fd/components/form/modal/v1/modal/clientlibs/site/css.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/README.md b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/README.md index b329d4423d..77af349b8e 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/README.md +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/README.md @@ -37,7 +37,7 @@ The following properties are written to JCR for this Form Panel component and ar ## Client Libraries -The component provides a `core.forms.components.termsandconditions.v1.runtime` client library category that contains the Javascript runtime for the component. +The component provides a `core.forms.components.modal.v1.runtime` client library category that contains the Javascript runtime for the component. It should be added to a relevant site client library using the `embed` property. diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_design_dialog/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_design_dialog/.content.xml index 3838032ab5..4c86db34b1 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_design_dialog/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_design_dialog/.content.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="nt:unstructured" - jcr:title="Adaptive Form Container" + jcr:title="Adaptive Form Modal" sling:resourceType="cq/gui/components/authoring/dialog" trackingFeature="core-components:design-dialog:adaptiveform-modal:v1"> <content diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_dialog/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_dialog/.content.xml index 8afe73376f..487680c4d4 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_dialog/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/_cq_dialog/.content.xml @@ -23,7 +23,7 @@ jcr:primaryType="nt:unstructured" jcr:title="Adaptive Form Modal" sling:resourceType="cq/gui/components/authoring/dialog" - helpPath="https://www.adobe.com/go/aem_af_cmp_termsandconditions_v1" + helpPath="https://www.adobe.com/go/aem_af_cmp_modal_v1" trackingFeature="core-components:adaptiveform-modal:v1" extraClientlibs="[core.forms.components.modal.v1.editor]"> <content diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css.txt b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css.txt index b68ef0c202..06d740c921 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css.txt +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/modal/v1/modal/clientlibs/site/css.txt @@ -1,5 +1,5 @@ ############################################################################### -# Copyright 2023 Adobe +# Copyright 2024 Adobe # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.