Skip to content

Commit 04b3bc9

Browse files
Merge pull request #40355 from appsmithorg/feat/reactive-actions-run-behaviour
feat: Replacing execute on load toggle with run behaviour in all actions / jsactions
2 parents 74b7afe + 7cd7438 commit 04b3bc9

File tree

171 files changed

+2134
-1302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+2134
-1302
lines changed

app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FrameworkFunctions_ShowCloseModalFunctions_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe(
4646
cy.wrap(jsObjectName).as("jsObjectName");
4747
});
4848

49-
apiPage.clickSettingIcon(true);
49+
apiPage.clickSettingIcon("On page load");
5050

5151
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
5252
propPane.ToggleJSMode("onClick", true);

app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe(
3232
pluginActionForm.toolbar.toggleSettings();
3333

3434
cy.get(".label-icon-wrapper")
35-
.contains("Run the query on page load")
35+
.contains("Run behavior")
3636
.parent()
3737
.then(($el) => {
3838
cy.window().then((win) => {

app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe(
3030
prettify: false,
3131
});
3232

33-
jsEditor.EnableDisableAsyncFuncSettings("myFun1", true);
33+
jsEditor.EnableDisableAsyncFuncSettings("myFun1", "On page load");
3434

3535
ee.DragDropWidgetNVerify(WIDGET.TEXT, 200, 600);
3636
EditorNavigation.SelectEntityByName("Text1", EntityType.Widget);

app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObject_Tests_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("Validate JSObj", {}, () => {
3333
shouldCreateNewJSObj: true,
3434
},
3535
);
36-
jsEditor.EnableDisableAsyncFuncSettings("myFun1");
36+
jsEditor.EnableDisableAsyncFuncSettings("myFun1", "On page load");
3737

3838
// Add new JSObject
3939
PageList.AddNewPage("New blank page");

app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ describe.skip(
2222
_.dataManager.dsValues[_.dataManager.defaultEnviorment].mockApiUrl,
2323
"Correct_users",
2424
);
25-
_.apiPage.ToggleOnPageLoadRun(true);
25+
_.apiPage.ToggleOnPageLoadRun("On page load");
2626
_.apiPage.CreateAndFillApi(
2727
_.dataManager.dsValues[
2828
_.dataManager.defaultEnviorment
2929
].mockApiUrl.replace("mock-api", "mock-api2err"),
3030
"Incorrect_users",
3131
);
32-
_.apiPage.ToggleOnPageLoadRun(true);
32+
_.apiPage.ToggleOnPageLoadRun("On page load");
3333
_.jsEditor.CreateJSObject(
3434
`export default {
3535
async myFun1 () {

app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ describe(
209209

210210
it("3. Update 'setOptions' property - during onPage load", () => {
211211
EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject);
212-
jsEditor.EnableDisableAsyncFuncSettings("myFun1", true); //for on page load execution
212+
jsEditor.EnableDisableAsyncFuncSettings("myFun1", "On page load"); //for on page load execution
213213
deployMode.DeployApp();
214214
agHelper
215215
.GetText(
@@ -268,7 +268,7 @@ describe(
268268
])}, () => {showAlert('unable to run API')});
269269
}
270270
}`);
271-
jsEditor.EnableDisableAsyncFuncSettings("myFunc1", true); //for on page load execution, since sync function is updated to async
271+
jsEditor.EnableDisableAsyncFuncSettings("myFunc1", "On page load"); //for on page load execution, since sync function is updated to async
272272
deployMode.DeployApp();
273273
agHelper.WaitForCondition(
274274
agHelper
@@ -313,7 +313,7 @@ describe(
313313
Select3.setOptions(Select1.options.concat(Select2.options));
314314
}
315315
}`);
316-
jsEditor.EnableDisableAsyncFuncSettings("myFunc1", true); //for on page load execution, since sync function is updated to async
316+
jsEditor.EnableDisableAsyncFuncSettings("myFunc1", "On page load"); //for on page load execution, since sync function is updated to async
317317
EditorNavigation.SelectEntityByName("Input1", EntityType.Widget);
318318
propPane.UpdatePropertyFieldValue("Default value", "{{Select3.options}}");
319319
deployMode.DeployApp();
@@ -355,7 +355,7 @@ describe(
355355
setTimeout(() => {Select1.setOptions(localValue)}, 1000);
356356
}
357357
}`);
358-
jsEditor.EnableDisableAsyncFuncSettings("myFun1", false); //for on page load execution
358+
jsEditor.EnableDisableAsyncFuncSettings("myFun1", "Manual"); //for on page load execution
359359
deployMode.DeployApp();
360360
agHelper
361361
.GetText(

app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ describe(
177177
}`,
178178
false,
179179
);
180-
jsEditor.EnableDisableAsyncFuncSettings("myFun1", true);
180+
jsEditor.EnableDisableAsyncFuncSettings("myFun1", "On page load");
181181
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.BUTTON)); //Asserting before setTimeout JS function execution, button is visible
182182
agHelper.Sleep(2000); //waiting for settimeout to execute
183183
agHelper.AssertElementAbsence(
@@ -236,7 +236,7 @@ describe(
236236
}`,
237237
false,
238238
);
239-
jsEditor.EnableDisableAsyncFuncSettings("myFun1", false);
239+
jsEditor.EnableDisableAsyncFuncSettings("myFun1", "Manual");
240240
deployMode.DeployApp();
241241
agHelper.AssertElementVisibility(
242242
locators._widgetInDeployed(draggableWidgets.INPUT_V2), //Asserting before setTimeout JS function execution, Input is visible

app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ describe(
142142

143143
EditorNavigation.SelectEntityByName("MultipartAPI", EntityType.Api);
144144

145-
apiPage.ToggleOnPageLoadRun(false); //Bug 12476
145+
apiPage.ToggleOnPageLoadRun("Manual"); //Bug 12476
146146
EditorNavigation.SelectEntityByName("Page2", EntityType.Page);
147147
deployMode.DeployApp(locators._buttonByText("Select Files"));
148148
agHelper.ClickButton("Select Files");

app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ describe(
467467
});
468468

469469
it("7. Tc #2365 - Query settings tab validations", () => {
470-
apiPage.ToggleOnPageLoadRun(false); // All above cases validated for onpage load run with confirmation dialog set to false
470+
apiPage.ToggleOnPageLoadRun("Manual"); // All above cases validated for onpage load run with confirmation dialog set to false
471471
pluginActionForm.toolbar.toggleSettings();
472472
apiPage.ToggleConfirmBeforeRunning(true);
473473
deployMode.DeployApp();

app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ describe.skip(
165165
"Select",
166166
);
167167
agHelper.RenameQuery("TemplateSelectQuery");
168-
apiPage.ToggleOnPageLoadRun(true);
168+
apiPage.ToggleOnPageLoadRun("On page load");
169169
pluginActionForm.toolbar.toggleSettings();
170170
apiPage.ToggleConfirmBeforeRunning(true);
171171
agHelper.RefreshPage();

app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import PageList from "../../../../support/Pages/PageList";
1717

1818
interface IFunctionSettingData {
1919
name: string;
20-
onPageLoad: boolean;
20+
runBehaviour: "On page load" | "Manual";
2121
confirmBeforeExecute: boolean;
2222
// uses the "async" keyword
2323
isMarkedAsync: boolean;
@@ -35,31 +35,31 @@ describe(
3535
const FUNCTIONS_SETTINGS_DEFAULT_DATA: IFunctionSettingData[] = [
3636
{
3737
name: "getId",
38-
onPageLoad: true,
38+
runBehaviour: "On page load",
3939
confirmBeforeExecute: false,
4040
isMarkedAsync: true,
4141
},
4242
{
4343
name: "zip",
44-
onPageLoad: true,
44+
runBehaviour: "On page load",
4545
confirmBeforeExecute: true,
4646
isMarkedAsync: false,
4747
},
4848
{
4949
name: "base",
50-
onPageLoad: false,
50+
runBehaviour: "Manual",
5151
confirmBeforeExecute: false,
5252
isMarkedAsync: true,
5353
},
5454
{
5555
name: "assert",
56-
onPageLoad: false,
56+
runBehaviour: "Manual",
5757
confirmBeforeExecute: false,
5858
isMarkedAsync: false,
5959
},
6060
{
6161
name: "test",
62-
onPageLoad: true,
62+
runBehaviour: "On page load",
6363
confirmBeforeExecute: true,
6464
isMarkedAsync: true,
6565
},
@@ -359,7 +359,7 @@ describe(
359359
// Number of functions set to run on page load and should also confirm before execute
360360
onPageLoadAndConfirmExecuteFunctionsLength =
361361
FUNCTIONS_SETTINGS_DEFAULT_DATA.filter(
362-
(func) => func.onPageLoad && func.confirmBeforeExecute,
362+
(func) => func.runBehaviour && func.confirmBeforeExecute,
363363
).length;
364364

365365
getJSObject = (data: IFunctionSettingData[]) => {
@@ -404,7 +404,7 @@ describe(
404404
(functionSetting) => {
405405
jsEditor.EnableDisableAsyncFuncSettings(
406406
functionSetting.name,
407-
functionSetting.onPageLoad,
407+
functionSetting.runBehaviour,
408408
);
409409
},
410410
);
@@ -425,31 +425,31 @@ describe(
425425
const FUNCTIONS_SETTINGS_RENAMED_DATA: IFunctionSettingData[] = [
426426
{
427427
name: "newGetId",
428-
onPageLoad: true,
428+
runBehaviour: "On page load",
429429
confirmBeforeExecute: false,
430430
isMarkedAsync: false,
431431
},
432432
{
433433
name: "zip1",
434-
onPageLoad: true,
434+
runBehaviour: "On page load",
435435
confirmBeforeExecute: true,
436436
isMarkedAsync: true,
437437
},
438438
{
439439
name: "base",
440-
onPageLoad: false,
440+
runBehaviour: "Manual",
441441
confirmBeforeExecute: false,
442442
isMarkedAsync: true,
443443
},
444444
{
445445
name: "newAssert",
446-
onPageLoad: true,
446+
runBehaviour: "On page load",
447447
confirmBeforeExecute: false,
448448
isMarkedAsync: false,
449449
},
450450
{
451451
name: "test",
452-
onPageLoad: true,
452+
runBehaviour: "On page load",
453453
confirmBeforeExecute: true,
454454
isMarkedAsync: true,
455455
},
@@ -500,12 +500,12 @@ return "yes";`;
500500
});
501501

502502
// Enable all settings
503-
jsEditor.EnableDisableAsyncFuncSettings("asyncToSync", true);
503+
jsEditor.EnableDisableAsyncFuncSettings("asyncToSync", "On page load");
504504

505505
// Modify js object
506506
jsEditor.EditJSObj(syncJSCode, false);
507507
agHelper.RefreshPage();
508-
jsEditor.VerifyAsyncFuncSettings("asyncToSync", true);
508+
jsEditor.VerifyAsyncFuncSettings("asyncToSync", "On page load");
509509
agHelper.ActionContextMenuWithInPane({
510510
action: "Delete",
511511
entityType: entityItems.JSObject,

app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ describe(
227227
prettify: true,
228228
},
229229
);
230-
jsEditor.EnableDisableAsyncFuncSettings("myFun1", true);
230+
jsEditor.EnableDisableAsyncFuncSettings("myFun1", "On page load");
231231
deployMode.DeployApp();
232232
agHelper.Sleep(1000); //DeployApp already waiting 2000ms hence reducing it here to equate to 3000 timeout
233233
agHelper.AssertContains("Success!");

app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe(
5050
"PageLoadApi2",
5151
);
5252
});
53-
apiPage.ToggleOnPageLoadRun(true);
53+
apiPage.ToggleOnPageLoadRun("On page load");
5454
EditorNavigation.SelectEntityByName("Table1", EntityType.Widget, {}, [
5555
"Container3",
5656
]);

app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe(
9494
},
9595
);
9696

97-
jsEditor.EnableDisableAsyncFuncSettings("astros", true);
97+
jsEditor.EnableDisableAsyncFuncSettings("astros", "On page load");
9898

9999
EditorNavigation.SelectEntityByName("Page1", EntityType.Page);
100100
agHelper.RefreshPage();

app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ describe(
3434
},
3535
);
3636

37-
jsEditor.VerifyAsyncFuncSettings("myFun1", false);
38-
jsEditor.VerifyAsyncFuncSettings("myFun2", false);
39-
jsEditor.VerifyAsyncFuncSettings("myFun3", false);
40-
jsEditor.VerifyAsyncFuncSettings("myFun4", false);
41-
jsEditor.VerifyAsyncFuncSettings("myFun5", false);
42-
jsEditor.VerifyAsyncFuncSettings("myFun6", false);
37+
jsEditor.VerifyAsyncFuncSettings("myFun1", "Manual");
38+
jsEditor.VerifyAsyncFuncSettings("myFun2", "Manual");
39+
jsEditor.VerifyAsyncFuncSettings("myFun3", "Manual");
40+
jsEditor.VerifyAsyncFuncSettings("myFun4", "Manual");
41+
jsEditor.VerifyAsyncFuncSettings("myFun5", "Manual");
42+
jsEditor.VerifyAsyncFuncSettings("myFun6", "Manual");
4343

4444
VerifyFunctionDropdown([
4545
"myFun1",

app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe(
7676
propPane.EnterJSContext("Table data", "{{ParamsTest.data}}");
7777

7878
EditorNavigation.SelectEntityByName("ParamsTest", EntityType.Query);
79-
apiPage.ToggleOnPageLoadRun(false); //Bug 12476
79+
apiPage.ToggleOnPageLoadRun("Manual"); //Bug 12476
8080

8181
deployMode.DeployApp(locators._buttonByText("Submit"));
8282
agHelper.SelectDropDown("7");

app/client/cypress/fixtures/Api_withPageload_Input_TestData.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)