diff --git a/app/client/cypress/fixtures/formChangeDSL.json b/app/client/cypress/fixtures/formChangeDSL.json new file mode 100644 index 0000000000..6b9de98f2f --- /dev/null +++ b/app/client/cypress/fixtures/formChangeDSL.json @@ -0,0 +1,282 @@ +{ + "dsl":{ + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 4896, + "snapColumns": 64, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 700, + "containerStyle": "none", + "snapRows": 124, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 77, + "minHeight": 1292, + "dynamicTriggerPathList": [], + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "resetFormOnClick": false, + "boxShadow": "none", + "widgetName": "Button1", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "displayName": "Button", + "iconSVG": "/static/media/icon.cca026338f1c8eb6df8ba03d084c2fca.svg", + "searchTags": [ + "click", + "submit" + ], + "topRow": 20, + "bottomRow": 24, + "parentRowSpace": 10, + "type": "BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 17.0625, + "dynamicTriggerPathList": [], + "leftColumn": 19, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + }, + { + "key": "text" + } + ], + "text": "{{Form1.hasChanges}}", + "isDisabled": false, + "key": "0cniuog4j2", + "isDeprecated": false, + "rightColumn": 35, + "isDefaultClickDisabled": true, + "widgetId": "moe5ofr65i", + "isVisible": true, + "recaptchaType": "V3", + "version": 1, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "disabledWhenInvalid": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "PRIMARY", + "placement": "CENTER" + }, + { + "boxShadow": "{{appsmith.theme.boxShadow.appBoxShadow}}", + "borderColor": "#E0DEDE", + "widgetName": "Form1", + "isCanvas": true, + "displayName": "Form", + "iconSVG": "/static/media/icon.ea3e08d130e59c56867ae40114c10eed.svg", + "searchTags": [ + "group" + ], + "topRow": 31, + "bottomRow": 70, + "parentRowSpace": 10, + "type": "FORM_WIDGET", + "hideCard": false, + "shouldScrollContents": true, + "animateLoading": true, + "parentColumnSpace": 17.0625, + "leftColumn": 14, + "dynamicBindingPathList": [ + { + "key": "borderRadius" + }, + { + "key": "boxShadow" + } + ], + "children": [ + { + "widgetName": "Canvas1", + "displayName": "Canvas", + "topRow": 0, + "bottomRow": 390, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": false, + "hideCard": true, + "minHeight": 400, + "parentColumnSpace": 1, + "leftColumn": 0, + "dynamicBindingPathList": [], + "children": [ + { + "widgetName": "Text1", + "displayName": "Text", + "iconSVG": "/static/media/icon.97c59b523e6f70ba6f40a10fc2c7c5b5.svg", + "searchTags": [ + "typography", + "paragraph", + "label" + ], + "topRow": 1, + "bottomRow": 5, + "type": "TEXT_WIDGET", + "hideCard": false, + "animateLoading": true, + "overflow": "NONE", + "fontFamily": "{{appsmith.theme.fontFamily.appFont}}", + "leftColumn": 1.5, + "dynamicBindingPathList": [ + { + "key": "truncateButtonColor" + }, + { + "key": "fontFamily" + }, + { + "key": "borderRadius" + } + ], + "shouldTruncate": false, + "truncateButtonColor": "{{appsmith.theme.colors.primaryColor}}", + "text": "Form", + "key": "8gdi64u1lc", + "isDeprecated": false, + "rightColumn": 25.5, + "textAlign": "LEFT", + "dynamicHeight": "AUTO_HEIGHT", + "widgetId": "l2cdz7vjgn", + "isVisible": true, + "fontStyle": "BOLD", + "textColor": "#231F20", + "version": 1, + "parentId": "a34vbum4oi", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "maxDynamicHeight": 9000, + "fontSize": "1.25rem", + "minDynamicHeight": 4 + }, + { + "resetFormOnClick": true, + "boxShadow": "none", + "widgetName": "Button2", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "displayName": "Button", + "iconSVG": "/static/media/icon.cca026338f1c8eb6df8ba03d084c2fca.svg", + "searchTags": [ + "click", + "submit" + ], + "topRow": 33, + "bottomRow": 37, + "type": "BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "leftColumn": 46, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "text": "Submit", + "isDisabled": false, + "key": "hu6vifvphd", + "isDeprecated": false, + "rightColumn": 62, + "isDefaultClickDisabled": true, + "widgetId": "jajaxkyoyj", + "isVisible": true, + "recaptchaType": "V3", + "version": 1, + "parentId": "a34vbum4oi", + "renderMode": "CANVAS", + "isLoading": false, + "disabledWhenInvalid": true, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "PRIMARY", + "placement": "CENTER" + }, + { + "resetFormOnClick": true, + "boxShadow": "none", + "widgetName": "Button3", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "displayName": "Button", + "iconSVG": "/static/media/icon.cca026338f1c8eb6df8ba03d084c2fca.svg", + "searchTags": [ + "click", + "submit" + ], + "topRow": 33, + "bottomRow": 37, + "type": "BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "leftColumn": 30, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "text": "Reset", + "isDisabled": false, + "key": "hu6vifvphd", + "isDeprecated": false, + "rightColumn": 46, + "isDefaultClickDisabled": true, + "widgetId": "guxaqxcsia", + "isVisible": true, + "recaptchaType": "V3", + "version": 1, + "parentId": "a34vbum4oi", + "renderMode": "CANVAS", + "isLoading": false, + "disabledWhenInvalid": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "SECONDARY", + "placement": "CENTER" + } + ], + "key": "791qhuxp2p", + "isDeprecated": false, + "rightColumn": 409.5, + "detachFromLayout": true, + "widgetId": "a34vbum4oi", + "containerStyle": "none", + "isVisible": true, + "version": 1, + "parentId": "as83i8ollo", + "renderMode": "CANVAS", + "isLoading": false + } + ], + "borderWidth": "1", + "key": "lpa5i6pmv5", + "backgroundColor": "#FFFFFF", + "isDeprecated": false, + "rightColumn": 38, + "dynamicHeight": "AUTO_HEIGHT", + "widgetId": "as83i8ollo", + "isVisible": true, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "originalTopRow": 31, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "maxDynamicHeight": 9000, + "originalBottomRow": 71, + "minDynamicHeight": 10 + } + ] + } +} \ No newline at end of file diff --git a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/BugTests/formHasChanged_Spec.ts b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/BugTests/formHasChanged_Spec.ts new file mode 100644 index 0000000000..57396c1be7 --- /dev/null +++ b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/BugTests/formHasChanged_Spec.ts @@ -0,0 +1,20 @@ +import { ObjectsRegistry } from "../../../../support/Objects/Registry"; + +const ee = ObjectsRegistry.EntityExplorer, + locator = ObjectsRegistry.CommonLocators, + agHelper = ObjectsRegistry.AggregateHelper; + +describe("JS Function Execution", function() { + before(() => { + cy.fixture("formChangeDSL.json").then((val: any) => { + agHelper.AddDsl(val); + }); + ee.NavigateToSwitcher("explorer"); + }); + + it("Doesn't show lint errors for 'form.hasChanges'", () => { + ee.SelectEntityByName("Button1", "Widgets"); + agHelper.Sleep(4000); + agHelper.AssertElementAbsence(locator._lintErrorElement); + }); +}); diff --git a/app/client/src/actions/evaluationActions.ts b/app/client/src/actions/evaluationActions.ts index 9c0939a857..00ea7698ae 100644 --- a/app/client/src/actions/evaluationActions.ts +++ b/app/client/src/actions/evaluationActions.ts @@ -30,6 +30,7 @@ export const LINT_REDUX_ACTIONS = { [ReduxActionTypes.UPDATE_WIDGET_PROPERTY]: true, [ReduxActionTypes.UPDATE_WIDGET_NAME_SUCCESS]: true, [ReduxActionTypes.UPDATE_JS_ACTION_BODY_SUCCESS]: true, + [ReduxActionTypes.META_UPDATE_DEBOUNCED_EVAL]: true, }; export const EVALUATE_REDUX_ACTIONS = [