Skip to content

Commit 4cde36d

Browse files
Merge branch 'FORMS-18927-AllowNewMIMETypesAndExtensions' of https://github.com/adobe/aem-core-forms-components into FORMS-18927-AllowNewMIMETypesAndExtensions
2 parents 2c022fc + 85644fa commit 4cde36d

File tree

5 files changed

+43
-36
lines changed

5 files changed

+43
-36
lines changed

it/apps/src/main/content/jcr_root/apps/forms-core-components-it/clientlibs/clientlib-it-custom-function/js/functions.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,12 @@ function clearValueCustomFunction(field, globals) {
250250
* @param {scope} globals
251251
*/
252252
function customMessageUsingInvalidApi(field, globals) {
253-
const minLength = 15;
253+
const minLength = field.$minLength;
254254
const comments = field.$value.trim();
255+
// api to get the error message for a particular constraint
256+
const ootbErrrorMessage = field.getErrorMessage("minLength");
255257
if (comments.length < minLength) {
256-
globals.functions.setProperty(field, {valid: false, errorMessage : "Comments must be at least 15 characters long."});
258+
globals.functions.setProperty(field, {valid: false, errorMessage : `Comments must be at least ${minLength} characters long.`});
257259
} else {
258260
globals.functions.setProperty(field, {valid : true});
259261
}

it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/actions/submit/validate/.content.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
jcr:lastModified="{Date}2024-08-12T10:50:30.221Z"
3131
jcr:lastModifiedBy="admin"
3232
jcr:primaryType="nt:unstructured"
33+
minLength = "15"
3334
jcr:title="Text Input"
3435
required="true"
3536
sling:resourceType="forms-components-examples/components/form/textinput"

ui.frontend/package-lock.json

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

ui.frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"webpack-merge": "^5.8.0"
2626
},
2727
"dependencies": {
28-
"@aemforms/af-core": "^0.22.117",
28+
"@aemforms/af-core": "^0.22.118",
2929
"@aemforms/af-core-xfa": "^0.1.6",
30-
"@aemforms/af-formatters": "^0.22.114",
30+
"@aemforms/af-formatters": "^0.22.118",
3131
"@aemforms/af-custom-functions": "1.0.14"
3232
}
3333
}

ui.tests/test-module/specs/title/title.authoring.cy.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,30 +38,34 @@ describe('Page - Authoring', function () {
3838
const testTitleEditDialog = function (titleEditPathSelector, titleDrop, isSites) {
3939
if (isSites) {
4040
dropTitleInSites();
41+
cy.wait(500);
4142
cy.get(sitesSelectors.overlays.overlay.component + titleEditPathSelector)
4243
.should('be.visible')
4344
.first()
44-
.then($el => {
45-
cy.wrap($el).click();
46-
cy.invokeEditableAction("[data-action='CONFIGURE']");
47-
cy.get('.cq-dialog-cancel').should('be.visible').click();
48-
cy.deleteComponentByPath(titleDrop);
49-
});
45+
.as('titleElement');
46+
47+
cy.get('@titleElement').should('exist').should('be.visible');
48+
cy.get('@titleElement').click({force: true});
49+
cy.invokeEditableAction("[data-action='CONFIGURE']");
50+
cy.get('.cq-dialog-cancel').should('be.visible').click();
51+
cy.deleteComponentByPath(titleDrop);
5052
} else {
5153
dropTitleInContainer();
54+
cy.wait(500);
5255
cy.get(sitesSelectors.overlays.overlay.component + titleEditPathSelector)
5356
.should('be.visible')
5457
.first()
55-
.then($el => {
56-
cy.wrap($el).click();
57-
cy.invokeEditableAction("[data-action='CONFIGURE']");
58-
cy.get('.cq-dialog-cancel').should('be.visible').click();
59-
cy.get('[data-path^="/content/forms/af/core-components-it/blank/jcr:content/guideContainer/title_"]')
60-
.should('exist')
61-
.invoke('attr', 'data-path')
62-
.then(dataPath => {
63-
cy.deleteComponentByPath(dataPath);
64-
});
58+
.as('titleElement');
59+
60+
cy.get('@titleElement').should('exist').should('be.visible');
61+
cy.get('@titleElement').click({force: true});
62+
cy.invokeEditableAction("[data-action='CONFIGURE']");
63+
cy.get('.cq-dialog-cancel').should('be.visible').click();
64+
cy.get('[data-path^="/content/forms/af/core-components-it/blank/jcr:content/guideContainer/title_"]')
65+
.should('exist')
66+
.invoke('attr', 'data-path')
67+
.then(dataPath => {
68+
cy.deleteComponentByPath(dataPath);
6569
});
6670
}
6771
}

0 commit comments

Comments
 (0)