Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: 'Form.hasChanges' showing lint error #20960

Merged
merged 4 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add meta actions to lint redux actions
  • Loading branch information
ohansFavour committed Feb 25, 2023
commit 38688ff4804e6a114ea15b37abf4cce4344269c5
282 changes: 282 additions & 0 deletions app/client/cypress/fixtures/formChangeDSL.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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.AssertElementAbsence(locator._lintErrorElement);
});
});
3 changes: 3 additions & 0 deletions app/client/src/actions/evaluationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export const LINT_REDUX_ACTIONS = {
[ReduxActionTypes.UPDATE_WIDGET_PROPERTY]: true,
[ReduxActionTypes.UPDATE_WIDGET_NAME_SUCCESS]: true,
[ReduxActionTypes.UPDATE_JS_ACTION_BODY_SUCCESS]: true,
[ReduxActionTypes.SET_META_PROP_AND_EVAL]: true,
[ReduxActionTypes.META_UPDATE_DEBOUNCED_EVAL]: true,
[ReduxActionTypes.RESET_WIDGET_META]: true,
};

export const EVALUATE_REDUX_ACTIONS = [
Expand Down