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

feat: added modal name, lint warning for string, action selector modal #32893

Merged
merged 14 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe("JS to non-JS mode in Action Selector", { tags: ["@tag.JS"] }, () => {
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
propPane.EnterJSContext(
"onClick",
`{{Api1.run().then(() => { showAlert('Hello world!', 'info'); storeValue('a', 18); }).catch(() => { showModal('Modal1'); });}}`,
`{{Api1.run().then(() => { showAlert('Hello world!', 'info'); storeValue('a', 18); }).catch(() => { showModal(Modal1.name); });}}`,
true,
false,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,12 @@ describe("JS to non-JS mode in Action Selector", { tags: ["@tag.JS"] }, () => {
0,
);

propPane.EnterJSContext("onClick", "{{showModal('Modal1')}}", true, false);
propPane.EnterJSContext(
"onClick",
"{{showModal(Modal1.name)}}",
true,
false,
);
propPane.ToggleJSMode("onClick", false);

agHelper.GetNAssertElementText(
Expand Down Expand Up @@ -253,7 +258,12 @@ describe("JS to non-JS mode in Action Selector", { tags: ["@tag.JS"] }, () => {
0,
);

propPane.EnterJSContext("onClick", "{{closeModal('Modal1')}}", true, false);
propPane.EnterJSContext(
"onClick",
"{{closeModal(Modal1.name)}}",
true,
false,
);
propPane.ToggleJSMode("onClick", false);

agHelper.GetNAssertElementText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe(
agHelper.ClickButton("Close");
EditorNavigation.SelectEntityByName("ButtonGroup1", EntityType.Widget);
agHelper.GetNClick(buttongroupwidgetlocators.buttonSettingInPropPane, 0);
propPane.EnterJSContext("onClick", "{{showModal('Modal1')}}");
propPane.EnterJSContext("onClick", "{{showModal(Modal1.name)}}");
deployMode.DeployApp();
agHelper.ClickButton("Favorite");
agHelper.AssertElementExist(locators._modal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("Modal focus", { tags: ["@tag.Widget", "@tag.Modal"] }, function () {

cy.updateCodeInput(
".t--property-control-onclick",
`{{showModal('Modal1')}}`,
`{{showModal(Modal1.name)}}`,
);
//add modal
EditorNavigation.SelectEntityByName("Modal1", EntityType.Widget);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe(
entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON);
entityExplorer.DragDropWidgetNVerify(draggableWidgets.MODAL, 300, 300);
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
propPane.EnterJSContext("onClick", "{{showModal('Modal1');}}");
propPane.EnterJSContext("onClick", "{{showModal(Modal1.name);}}");
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.BUTTON));
agHelper.WaitUntilEleAppear(
locators._widgetInDeployed(draggableWidgets.BUTTON),
Expand Down
8 changes: 4 additions & 4 deletions app/client/cypress/fixtures/CMSdsl.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
{
"resetFormOnClick": true,
"widgetName": "FormButton1",
"onClick": "{{showModal('Modal1')}}",
"onClick": "{{showModal(Modal1.name)}}",
"buttonColor": "#03B365",
"dynamicPropertyPathList": [{ "key": "onClick" }],
"displayName": "FormButton",
Expand Down Expand Up @@ -609,7 +609,7 @@
},
{
"widgetName": "Button4",
"onClick": "{{showModal('Modal2')}}",
"onClick": "{{showModal(Modal2.name)}}",
"buttonColor": "#03B365",
"dynamicPropertyPathList": [{ "key": "onClick" }],
"displayName": "Button",
Expand Down Expand Up @@ -821,7 +821,7 @@
{
"widgetName": "Icon1",
"rightColumn": 64,
"onClick": "{{closeModal('Modal1')}}",
"onClick": "{{closeModal(Modal1.name)}}",
"color": "#040627",
"iconName": "cross",
"displayName": "Icon",
Expand Down Expand Up @@ -867,7 +867,7 @@
},
{
"widgetName": "Button2",
"onClick": "{{closeModal('Modal1')}}",
"onClick": "{{closeModal(Modal1.name)}}",
"buttonColor": "#03B365",
"displayName": "Button",
"iconSVG": "/static/media/icon.cca02633.svg",
Expand Down
44 changes: 22 additions & 22 deletions app/client/cypress/fixtures/CommunityIssuesExport.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/client/cypress/fixtures/ContextSwitching.json
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@
{
"boxShadow": "none",
"widgetName": "IconButton1",
"onClick": "{{closeModal('Modal1')}}",
"onClick": "{{closeModal(Modal1.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Icon button",
"iconSVG": "/static/media/icon.1a0c634ac75f9fa6b6ae7a8df882a3ba.svg",
Expand Down Expand Up @@ -580,7 +580,7 @@
"resetFormOnClick": false,
"boxShadow": "none",
"widgetName": "Button2",
"onClick": "{{closeModal('Modal1')}}",
"onClick": "{{closeModal(Modal1.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Button",
"iconSVG": "/static/media/icon.cca026338f1c8eb6df8ba03d084c2fca.svg",
Expand Down
12 changes: 6 additions & 6 deletions app/client/cypress/fixtures/Datatypes/ArrayDTdsl.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
{
"boxShadow": "none",
"widgetName": "IconButton1Copy",
"onClick": "{{closeModal('UpdateModal')}}",
"onClick": "{{closeModal(UpdateModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Icon button",
"iconSVG": "/static/media/icon.1a0c634a.svg",
Expand Down Expand Up @@ -317,7 +317,7 @@
{
"boxShadow": "none",
"widgetName": "runUpdateQuery",
"onClick": "{{updateRecord.run(() => {closeModal('UpdateModal'), () => {};selectRecords.run() })}}",
"onClick": "{{updateRecord.run(() => {closeModal(UpdateModal.name), () => {};selectRecords.run() })}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down Expand Up @@ -678,7 +678,7 @@
{
"boxShadow": "none",
"widgetName": "InsertButton",
"onClick": "{{showModal('InsertModal')}}",
"onClick": "{{showModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down Expand Up @@ -728,7 +728,7 @@
{
"boxShadow": "none",
"widgetName": "UpdateButton",
"onClick": "{{showModal('UpdateModal')}}",
"onClick": "{{showModal(UpdateModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [],
"displayName": "Button",
Expand Down Expand Up @@ -926,7 +926,7 @@
{
"boxShadow": "none",
"widgetName": "IconButton1",
"onClick": "{{closeModal('InsertModal')}}",
"onClick": "{{closeModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Icon button",
"iconSVG": "/static/media/icon.1a0c634a.svg",
Expand Down Expand Up @@ -1057,7 +1057,7 @@
{
"boxShadow": "none",
"widgetName": "runInsertQuery",
"onClick": "{{insertRecord.run(() => {selectRecords.run();resetWidget('InsertModal', true);closeModal('InsertModal'), () => {};})}}",
"onClick": "{{insertRecord.run(() => {selectRecords.run();resetWidget('InsertModal', true);closeModal(InsertModal.name), () => {};})}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down
12 changes: 6 additions & 6 deletions app/client/cypress/fixtures/Datatypes/BinaryDTdsl.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
{
"boxShadow": "none",
"widgetName": "IconButton1Copy",
"onClick": "{{closeModal('UpdateModal')}}",
"onClick": "{{closeModal(UpdateModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Icon button",
"iconSVG": "/static/media/icon.1a0c634a.svg",
Expand Down Expand Up @@ -262,7 +262,7 @@
{
"boxShadow": "none",
"widgetName": "runUpdateQuery",
"onClick": "{{updateRecord.run(() => {closeModal('UpdateModal'), () => {};selectRecords.run() })}}",
"onClick": "{{updateRecord.run(() => {closeModal(UpdateModal.name), () => {};selectRecords.run() })}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down Expand Up @@ -833,7 +833,7 @@
{
"boxShadow": "none",
"widgetName": "InsertButton",
"onClick": "{{showModal('InsertModal')}}",
"onClick": "{{showModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down Expand Up @@ -883,7 +883,7 @@
{
"boxShadow": "none",
"widgetName": "UpdateButton",
"onClick": "{{showModal('UpdateModal')}}",
"onClick": "{{showModal(UpdateModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [],
"displayName": "Button",
Expand Down Expand Up @@ -975,7 +975,7 @@
{
"boxShadow": "none",
"widgetName": "IconButton1",
"onClick": "{{closeModal('InsertModal')}}",
"onClick": "{{closeModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Icon button",
"iconSVG": "/static/media/icon.1a0c634a.svg",
Expand Down Expand Up @@ -1109,7 +1109,7 @@
{
"boxShadow": "none",
"widgetName": "runInsertQuery",
"onClick": "{{insertRecord.run(() => {selectRecords.run();resetWidget('InsertModal', true);closeModal('InsertModal'), () => {};})}}",
"onClick": "{{insertRecord.run(() => {selectRecords.run();resetWidget('InsertModal', true);closeModal(InsertModal.name), () => {};})}}",
"buttonColor": "{{appsmith.theme.colors.backgroundColor}}",
"dynamicPropertyPathList": [
{
Expand Down
16 changes: 8 additions & 8 deletions app/client/cypress/fixtures/Datatypes/BooleanEnumDTdsl.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{
"boxShadow": "none",
"widgetName": "IconButton1Copy",
"onClick": "{{closeModal('InsertModal')}}",
"onClick": "{{closeModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Icon button",
"iconSVG": "/static/media/icon.1a0c634a.svg",
Expand Down Expand Up @@ -145,7 +145,7 @@
{
"boxShadow": "none",
"widgetName": "Button5Copy",
"onClick": "{{closeModal('UpdateModal')}}",
"onClick": "{{closeModal(UpdateModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Button",
"iconSVG": "/static/media/icon.cca02633.svg",
Expand Down Expand Up @@ -184,7 +184,7 @@
{
"boxShadow": "none",
"widgetName": "runUpdateQuery",
"onClick": "{{updateRecord.run(() => {closeModal('UpdateModal'), () => {};\nselectRecords.run()\t\t\t\t\t\t\t\t\t\t\t\t })}}",
"onClick": "{{updateRecord.run(() => {closeModal(UpdateModal.name), () => {};\nselectRecords.run()\t\t\t\t\t\t\t\t\t\t\t\t })}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down Expand Up @@ -615,7 +615,7 @@
{
"boxShadow": "none",
"widgetName": "InsertButton",
"onClick": "{{showModal('InsertModal')}}",
"onClick": "{{showModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down Expand Up @@ -665,7 +665,7 @@
{
"boxShadow": "none",
"widgetName": "UpdateButton",
"onClick": "{{showModal('UpdateModal')}}",
"onClick": "{{showModal(UpdateModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [],
"displayName": "Button",
Expand Down Expand Up @@ -755,7 +755,7 @@
{
"boxShadow": "none",
"widgetName": "IconButton1",
"onClick": "{{closeModal('InsertModal')}}",
"onClick": "{{closeModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Icon button",
"iconSVG": "/static/media/icon.1a0c634a.svg",
Expand Down Expand Up @@ -830,7 +830,7 @@
{
"boxShadow": "none",
"widgetName": "Button5",
"onClick": "{{closeModal('InsertModal')}}",
"onClick": "{{closeModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Button",
"iconSVG": "/static/media/icon.cca02633.svg",
Expand Down Expand Up @@ -869,7 +869,7 @@
{
"boxShadow": "none",
"widgetName": "runInsertQuery",
"onClick": "{{insertRecord.run(() => {\nselectRecords.run();\t\t\t\tresetWidget('InsertModal', true);\ncloseModal('InsertModal'), () => {};})}}",
"onClick": "{{insertRecord.run(() => {\nselectRecords.run();\t\t\t\tresetWidget('InsertModal', true);\ncloseModal(InsertModal.name), () => {};})}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down
16 changes: 8 additions & 8 deletions app/client/cypress/fixtures/Datatypes/CharacterDTdsl.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
{
"boxShadow": "none",
"widgetName": "IconButton1Copy",
"onClick": "{{closeModal('InsertModal')}}",
"onClick": "{{closeModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Icon button",
"iconSVG": "/static/media/icon.1a0c634a.svg",
Expand Down Expand Up @@ -252,7 +252,7 @@
{
"boxShadow": "none",
"widgetName": "Button5Copy",
"onClick": "{{closeModal('UpdateModal')}}",
"onClick": "{{closeModal(UpdateModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Button",
"iconSVG": "/static/media/icon.cca02633.svg",
Expand Down Expand Up @@ -291,7 +291,7 @@
{
"boxShadow": "none",
"widgetName": "runUpdateQuery",
"onClick": "{{updateRecord.run(() => {closeModal('UpdateModal'), () => {};\nselectRecords.run()\t\t\t\t\t\t\t\t\t\t\t\t })}}",
"onClick": "{{updateRecord.run(() => {closeModal(UpdateModal.name), () => {};\nselectRecords.run()\t\t\t\t\t\t\t\t\t\t\t\t })}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down Expand Up @@ -817,7 +817,7 @@
{
"boxShadow": "none",
"widgetName": "InsertButton",
"onClick": "{{showModal('InsertModal')}}",
"onClick": "{{showModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down Expand Up @@ -867,7 +867,7 @@
{
"boxShadow": "none",
"widgetName": "UpdateButton",
"onClick": "{{showModal('UpdateModal')}}",
"onClick": "{{showModal(UpdateModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [],
"displayName": "Button",
Expand Down Expand Up @@ -1059,7 +1059,7 @@
{
"boxShadow": "none",
"widgetName": "IconButton1",
"onClick": "{{closeModal('InsertModal')}}",
"onClick": "{{closeModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Icon button",
"iconSVG": "/static/media/icon.1a0c634a.svg",
Expand Down Expand Up @@ -1134,7 +1134,7 @@
{
"boxShadow": "none",
"widgetName": "Button5",
"onClick": "{{closeModal('InsertModal')}}",
"onClick": "{{closeModal(InsertModal.name)}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"displayName": "Button",
"iconSVG": "/static/media/icon.cca02633.svg",
Expand Down Expand Up @@ -1173,7 +1173,7 @@
{
"boxShadow": "none",
"widgetName": "runInsertQuery",
"onClick": "{{insertRecord.run(() => {\nselectRecords.run();\t\t\t\tresetWidget('InsertModal', true);\ncloseModal('InsertModal'), () => {};})}}",
"onClick": "{{insertRecord.run(() => {\nselectRecords.run();\t\t\t\tresetWidget('InsertModal', true);\ncloseModal(InsertModal.name), () => {};})}}",
"buttonColor": "{{appsmith.theme.colors.primaryColor}}",
"dynamicPropertyPathList": [
{
Expand Down
Loading
Loading