fix: 'Form.hasChanges' showing lint error (#20960)
## Description This PR adds meta actions to the list of actions that can trigger linting. Fixes #21051 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Cypress ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
This commit is contained in:
parent
ba81cb2ea1
commit
3b5b24d16e
282
app/client/cypress/fixtures/formChangeDSL.json
Normal file
282
app/client/cypress/fixtures/formChangeDSL.json
Normal file
|
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
@ -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 = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user