diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts index 8ce32c6a01..e13c374025 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts @@ -238,7 +238,7 @@ describe("storeValue Action test", { tags: ["@tag.JS"] }, () => { }); agHelper.ClickButton("Test store logs"); - debuggerHelper.ClickDebuggerIcon(); + debuggerHelper.OpenDebugger(); debuggerHelper.ClickLogsTab(); debuggerHelper.changeLogsGroup("System logs"); debuggerHelper.DoesConsoleLogExist("storeValue('xyz', '123', true)"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/InputTruncateCheck_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/InputTruncateCheck_Spec.ts index df67f114d6..d3c7ca26b1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/InputTruncateCheck_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/InputTruncateCheck_Spec.ts @@ -11,6 +11,7 @@ import { draggableWidgets, fakerHelper, dataManager, + debuggerHelper, } from "../../../../support/Objects/ObjectsCore"; const widgetsToTest = { @@ -180,8 +181,18 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => { agHelper.GetNClick(locators._widgetInputSelector(widgetSelector)); agHelper.PressDelete(); + //Since widget is removed & Button is still holding its reference + debuggerHelper.AssertDebugError( + `'${testConfig.widgetPrefixName}1' is not defined.`, + "", + true, + false, + ); + debuggerHelper.CloseBottomBar(); agHelper.GetNClick(getWidgetSelector(draggableWidgets.BUTTON)); - agHelper.AssertContains("is not defined"); //Since widget is removed & Button is still holding its reference + agHelper.ValidateToastMessage( + `${testConfig.widgetPrefixName}1 is not defined`, + ); agHelper.PressDelete(); agHelper.GetNClick(getWidgetSelector(draggableWidgets.TEXT)).click(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts index 9cb9c89457..a17f26f095 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts @@ -122,7 +122,7 @@ describe( deployMode.NavigateBacktoEditor(); //verify runAstros triggered on PageLaoad of Edit page! - debuggerHelper.ClickDebuggerIcon(); + debuggerHelper.OpenDebugger(); debuggerHelper.ClickLogsTab(); debuggerHelper.DebuggerLogsFilter("JSObject1.runAstros"); debuggerHelper.DoesConsoleLogExist("JS Function executed successfully"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts index d8d6905833..5bacf30fa3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts @@ -27,7 +27,7 @@ describe( apiPage.EnterHeader("test", "test"); debuggerHelper.AssertErrorCount(1); EditorNavigation.ShowCanvas(); - debuggerHelper.ClickDebuggerIcon(); + debuggerHelper.OpenDebugger(); debuggerHelper.ClicklogEntityLink(); agHelper.AssertElementVisibility(apiPage._nextCursorValue); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts index 0446d7cb69..6d00f9aecd 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts @@ -30,7 +30,7 @@ describe("JSObjects", () => { shouldCreateNewJSObj: true, }); - debuggerHelper.ClickDebuggerIcon(); + debuggerHelper.OpenDebugger(); debuggerHelper.ClicklogEntityLink(); agHelper.AssertCursorInput(".js-editor", { ch: 20, line: 6 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Query_pane_navigation.ts b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Query_pane_navigation.ts index 4dc7732fb3..5ba9fa87bc 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Query_pane_navigation.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Query_pane_navigation.ts @@ -66,8 +66,7 @@ describe( ); debuggerHelper.AssertErrorCount(2); - debuggerHelper.ClickDebuggerIcon(); - debuggerHelper.ClicklogEntityLink(); + debuggerHelper.OpenDebugger(); agHelper.AssertElementVisibility( ".t--actionConfiguration\\.formData\\.limitDocuments\\.data", ); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts index 1f9699579c..30a2720944 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts @@ -14,7 +14,7 @@ describe( _.debuggerHelper.AssertErrorCount(1); _.propPane.ToggleSection("general"); _.agHelper.AssertElementAbsence("animateloading"); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.ClicklogEntityLink(); _.propPane.AssertIfPropertyIsVisible("animateloading"); @@ -28,7 +28,7 @@ describe( _.propPane.EnterJSContext("visible", "{{test}}", true, false); _.debuggerHelper.AssertErrorCount(1); _.propPane.NavigateBackToPropertyPane(); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.ClicklogEntityLink(); _.agHelper.GetNAssertContains(_.propPane._paneTitle, "Tab 2"); _.propPane.AssertIfPropertyIsVisible("visible"); @@ -48,7 +48,7 @@ describe( _.debuggerHelper.AssertErrorCount(1); _.propPane.NavigateBackToPropertyPane(false); _.propPane.NavigateBackToPropertyPane(); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.ClicklogEntityLink(); _.agHelper.GetNAssertContains(_.propPane._paneTitle, "Menu Item"); _.propPane.AssertIfPropertyIsVisible("icon"); @@ -65,7 +65,7 @@ describe( _.propPane.MoveToTab("Style"); _.debuggerHelper.AssertErrorCount(1); _.propPane.NavigateBackToPropertyPane(); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.ClicklogEntityLink(); _.agHelper.GetNAssertContains(_.propPane._paneTitle, "Second Menu Item"); _.propPane.AssertIfPropertyIsVisible("disabled"); @@ -110,7 +110,7 @@ describe( _.propPane.NavigateBackToPropertyPane(false); _.propPane.NavigateBackToPropertyPane(); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.ClicklogEntityLink(); _.agHelper.GetNAssertContains(_.propPane._paneTitle, "Custom Field 2"); _.propPane.AssertIfPropertyIsVisible("borderradius"); @@ -133,7 +133,7 @@ describe( _.propPane.EnterJSContext("disabled", "{{test}}", true, false); _.debuggerHelper.AssertErrorCount(2); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.ClicklogEntityLink(true); _.agHelper.GetNAssertContains(_.propPane._paneTitle, "First Menu Item"); _.debuggerHelper.CloseBottomBar(); @@ -173,7 +173,7 @@ describe( _.propPane.ToggleSection("validation"); _.propPane.NavigateBackToPropertyPane(); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.ClicklogEntityLink(); _.agHelper.GetNAssertContains(_.propPane._paneTitle, "imdb_id"); _.debuggerHelper.CloseBottomBar(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Pages_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Pages_spec.js index ed8b405620..cf1d77b9dd 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Pages_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Pages_spec.js @@ -3,9 +3,6 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; import PageList from "../../../../support/Pages/PageList"; -const locators = { - errorPageTitle: ".t--error-page-title", -}; describe("Pages", { tags: ["@tag.IDE"] }, function () { let veryLongPageName = `abcdefghijklmnopqrstuvwxyz1234`; @@ -36,7 +33,7 @@ describe("Pages", { tags: ["@tag.IDE"] }, function () { EditorNavigation.SelectEntityByName("Page1 Copy", EntityType.Page); //Checks if 404 is showing correct route cy.visit("/route-that-does-not-exist"); - cy.get(locators.errorPageTitle).should(($x) => { + cy.get(_.locators.errorPageTitle).should(($x) => { expect($x).contain(Cypress.env("MESSAGES").PAGE_NOT_FOUND()); }); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/EntityBottomBar_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/EntityBottomBar_spec.ts index fae97f66f8..23d9464dff 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/EntityBottomBar_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/EntityBottomBar_spec.ts @@ -7,7 +7,7 @@ describe("Entity bottom bar", { tags: ["@tag.IDE"] }, () => { //Verify if bottom bar is closed. _.debuggerHelper.AssertClosed(); //verify if bottom bar is open on clicking debugger icon in canvas. - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.AssertOpen(PageType.Canvas); //Verify if selected tab is errors in tab title. _.debuggerHelper.AssertSelectedTab( @@ -48,7 +48,7 @@ describe("Entity bottom bar", { tags: ["@tag.IDE"] }, () => { //Verify that the errors tab is still closed. _.debuggerHelper.AssertClosed(); //Verify if bottom bar opens on clicking debugger icon in api page. - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.AssertOpen(PageType.API); //Verify if selected tab is errors in tab title. _.debuggerHelper.AssertSelectedTab( @@ -70,7 +70,7 @@ describe("Entity bottom bar", { tags: ["@tag.IDE"] }, () => { //Expecting errors tab to be closed as this is now a datasource _.debuggerHelper.AssertClosed(); //Verify if bottom bar opens on clicking debugger icon in datasource page. - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.AssertOpen(PageType.DataSources); }); @@ -91,7 +91,7 @@ describe("Entity bottom bar", { tags: ["@tag.IDE"] }, () => { _.debuggerHelper.AssertClosed(); //Verify if bottom bar opens on clicking debugger icon in query page. _.dataSources.CreateQueryAfterDSSaved(); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.AssertOpen(PageType.Query); //Verify if bottom bar is closed on clicking close icon in query page. _.debuggerHelper.CloseBottomBar(); @@ -130,7 +130,7 @@ describe("Entity bottom bar", { tags: ["@tag.IDE"] }, () => { _.debuggerHelper.AssertClosed(); //Verify if bottom bar opens on clicking debugger icon in query page. _.dataSources.CreateQueryAfterDSSaved(); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.AssertOpen(PageType.Query); //Verify if bottom bar is closed on clicking close icon in query page. _.debuggerHelper.CloseBottomBar(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ErrorMessages_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ErrorMessages_spec.ts index c0e974e15a..6bc10f52d4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ErrorMessages_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ErrorMessages_spec.ts @@ -33,13 +33,21 @@ describe("Sanitise toast error messages", () => { EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); _.propPane.EnterJSContext("onClick", "{{a.kjbfjdfbkds()}}"); _.agHelper.ClickButton("Submit"); - _.agHelper.WaitUntilToastDisappear("a is not defined"); + _.debuggerHelper.AssertDebugError("'a' is not defined.", "", true, false); }); it("2. Does not show type error label when js obj function does not exist", () => { EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); _.propPane.EnterJSContext("onClick", "{{JSObject1.myFun1efef()}}"); + // Assert the lint error that shows up + _.debuggerHelper.AssertDebugError( + `"myFun1efef" doesn't exist in JSObject1`, + "", + false, + false, + ); _.agHelper.ClickButton("Submit"); + // Assert the execution error that shows up _.agHelper.WaitUntilToastDisappear("Object1.myFun1efef is not a function"); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js index ca9ba9a553..b4f51bc728 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js @@ -7,7 +7,7 @@ describe("Inspect Entity", function () { it("1. Check whether depedencies and references are shown correctly", function () { cy.openPropertyPane("inputwidgetv2"); cy.testJsontext("defaultvalue", "{{Button1.text}}"); - _.agHelper.GetNClick(".t--debugger-count"); + _.debuggerHelper.OpenDebugger(); cy.contains(".ads-v2-tabs__list-tab", "Inspect entity").click(); cy.contains(".t--dependencies-item", "Button1").click(); cy.contains(".t--dependencies-item", "Input1"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js index a3e7ffa11e..42b84b4347 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js @@ -1,5 +1,3 @@ -import commonlocators from "../../../../locators/commonlocators.json"; -import { homePage } from "../../../../support/Objects/ObjectsCore"; import { ObjectsRegistry } from "../../../../support/Objects/Registry"; import EditorNavigation, { EntityType, @@ -26,18 +24,18 @@ describe("Debugger logs", function () { logString = generateTestLogString(); }); - it("3. Console log on button click with normal moustache binding", function () { + it("1. Console log on button click with normal moustache binding", function () { ee.DragDropWidgetNVerify("buttonwidget", 200, 200); // Testing with normal log in moustache binding propPane.EnterJSContext("onClick", `{{console.log("${logString}")}}`); agHelper.Sleep(2000); agHelper.ClickButton("Submit"); - debuggerHelper.ClickDebuggerIcon(); + debuggerHelper.OpenDebugger(); agHelper.GetNClick(jsEditor._logsTab); debuggerHelper.DoesConsoleLogExist(logString); }); - it("4. Console log on button click with arrow function IIFE", function () { + it("2. Console log on button click with arrow function IIFE", function () { debuggerHelper.ClearLogs(); EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); // Testing with normal log in iifee @@ -51,7 +49,7 @@ describe("Debugger logs", function () { debuggerHelper.DoesConsoleLogExist(logString); }); - it("5. Console log on button click with function keyword IIFE", function () { + it("3. Console log on button click with function keyword IIFE", function () { debuggerHelper.ClearLogs(); EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); // Testing with normal log in iifee @@ -65,7 +63,7 @@ describe("Debugger logs", function () { debuggerHelper.DoesConsoleLogExist(logString); }); - it("6. Console log on button click with async function IIFE", function () { + it("4. Console log on button click with async function IIFE", function () { debuggerHelper.ClearLogs(); // Testing with normal log in iifee EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); @@ -79,7 +77,7 @@ describe("Debugger logs", function () { debuggerHelper.DoesConsoleLogExist(logString); }); - it("7. Console log on button click with mixed function IIFE", function () { + it("5. Console log on button click with mixed function IIFE", function () { debuggerHelper.ClearLogs(); // Testing with normal log in iifee EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); @@ -96,7 +94,7 @@ describe("Debugger logs", function () { debuggerHelper.DoesConsoleLogExist(logStringChild); }); - it("8. Console log grouping on button click", function () { + it("6. Console log grouping on button click", function () { debuggerHelper.ClearLogs(); // Testing with normal log in iifee EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); @@ -116,7 +114,7 @@ describe("Debugger logs", function () { debuggerHelper.AssertConsecutiveConsoleLogCount(5); }); - it("9. Console log grouping on button click with different log in between", function () { + it("7. Console log grouping on button click with different log in between", function () { debuggerHelper.ClearLogs(); // Testing with normal log in iifee EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); @@ -135,7 +133,7 @@ describe("Debugger logs", function () { debuggerHelper.AssertConsecutiveConsoleLogCount(2); }); - it("10. Console log grouping on button click from different source", function () { + it("8. Console log grouping on button click from different source", function () { debuggerHelper.ClearLogs(); // Testing with normal log in iifee EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs2_spec.js index 84207474a4..fa3358209b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs2_spec.js @@ -34,7 +34,7 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { _.agHelper.RefreshPage(); // Wait for the debugger icon to be visible _.agHelper.AssertElementVisibility(".t--debugger-count"); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.agHelper.GetNClick(_.jsEditor._logsTab); _.debuggerHelper.DoesConsoleLogExist(logString); }); @@ -286,7 +286,7 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { EditorNavigation.SelectEntityByName("Page1", EntityType.Page); _.agHelper.AssertElementVisibility(".t--debugger-count"); - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); _.debuggerHelper.ClicklogEntityLink(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js index ae53291a32..5b35f24d79 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js @@ -23,7 +23,7 @@ describe("Widget error state", function () { //Check if the current value is shown in the debugger - _.debuggerHelper.ClickDebuggerIcon(); + _.debuggerHelper.OpenDebugger(); cy.get("[data-testid=t--tab-ERROR]").click(); //This feature is disabled in updated error log - epic 17720 // _.debuggerHelper.LogStateContains("Test"); @@ -44,8 +44,8 @@ describe("Widget error state", function () { ); // All errors should be expanded by default - //Updated count to 1 as the decision not to show triggerexecution/uncaughtpromise error in - epic 17720 - _.debuggerHelper.AssertVisibleErrorMessagesCount(1); + //Updated count to 2 as the decision to show the widget trigger lint errors to show in the debugger + _.debuggerHelper.AssertVisibleErrorMessagesCount(2); // Recent errors are shown at the top of the list cy.testJsontext("label", "{{[]}}"); @@ -63,7 +63,7 @@ describe("Widget error state", function () { cy.deleteWidget(); _.debuggerHelper.AssertVisibleErrorMessagesCount(0); cy.get("body").type(`{${modifierKey}}z`); - _.debuggerHelper.AssertVisibleErrorMessagesCount(2); + _.debuggerHelper.AssertVisibleErrorMessagesCount(3); //Bug-2760: Error log on a widget property not clearing out when the widget property is deleted _.entityExplorer.DragDropWidgetNVerify(WIDGET.TABLE, 150, 300); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonLintErrorValidation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonLintErrorValidation_spec.js index c65da17682..93bcb3dbd8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonLintErrorValidation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonLintErrorValidation_spec.js @@ -43,13 +43,7 @@ describe( .should("be.visible") .contains("'lintError' is not defined."); - cy.get(commonlocators.debugger) - .should("be.visible") - .click({ force: true }); - - cy.get(commonlocators.errorTab) - .should("be.visible") - .click({ force: true }); + _.debuggerHelper.OpenDebugger(); cy.get(commonlocators.debugErrorMsg).should("have.length", 3); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/ListWidgetLintErrorValidation.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/ListWidgetLintErrorValidation.js index 60b164133a..87c5d382fd 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/ListWidgetLintErrorValidation.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/ListWidgetLintErrorValidation.js @@ -43,13 +43,7 @@ describe( .should("be.visible") .contains("'DATA' is not defined."); - cy.get(commonlocators.debugger) - .should("be.visible") - .click({ force: true }); - - cy.get(commonlocators.errorTab) - .should("be.visible") - .click({ force: true }); + _.debuggerHelper.OpenDebugger(); cy.get(commonlocators.debugErrorMsg).should("have.length", 6); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifier_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifier_spec.ts index d0f15f8e52..1d64e70592 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifier_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifier_spec.ts @@ -91,10 +91,11 @@ describe( 1, ); //Open debugger by clicking debugger icon in canvas. - debuggerHelper.ClickDebuggerIcon(); - agHelper.GetNAssertContains( - debuggerHelper.locators._debuggerList, + debuggerHelper.AssertDebugError( "This data identifier is evaluating to a duplicate value. Please use an identifier that evaluates to a unique value.", + "", + true, + false, ); }); }, diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_NestedList_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_NestedList_spec.ts index 2ce68154fb..594f05b447 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_NestedList_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_NestedList_spec.ts @@ -9,6 +9,7 @@ import { import EditorNavigation, { EntityType, } from "../../../../../support/Pages/EditorNavigation"; +import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Nested List widget V2 ", @@ -40,8 +41,11 @@ describe( "List3", ]); agHelper.GetElement("body").type(`{${agHelper._modifierKey}}{v}`); - agHelper.ValidateToastMessage( + _.debuggerHelper.OpenDebugger(); + _.debuggerHelper.ClickLogsTab(); + _.debuggerHelper.DoesConsoleLogExist( "Cannot have more than 3 levels of nesting in the list widget", + true, ); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js index 6c42b5af52..4d6a2525ba 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js @@ -6,9 +6,11 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); import { agHelper, assertHelper, + debuggerHelper, entityExplorer, propPane, } from "../../../../../support/Objects/ObjectsCore"; +import * as _ from "../../../../../support/Objects/ObjectsCore"; const widgetsPage = require("../../../../../locators/Widgets.json"); const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; @@ -72,7 +74,12 @@ describe( .type(`{${modifierKey}}{v}`); cy.wait(500); - cy.validateToastMessage("Cannot have more than 3 levels of nesting"); + _.debuggerHelper.OpenDebugger(); + _.debuggerHelper.ClickLogsTab(); + _.debuggerHelper.DoesConsoleLogExist( + "Cannot have more than 3 levels of nesting", + true, + ); cy.get(`${widgetSelector("List2Copy1")}`).should("not.exist"); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_LintErrorValidation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_LintErrorValidation_spec.js index 2a941b2004..b473a01b24 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_LintErrorValidation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_LintErrorValidation_spec.js @@ -44,15 +44,7 @@ describe( .should("be.visible") .contains("'lintErrror' is not defined."); - cy.get(commonlocators.debugger) - .should("be.visible") - .click({ force: true }); - - cy.get(commonlocators.errorTab) - .should("be.visible") - .click({ force: true }); - - cy.get(commonlocators.debugErrorMsg).should("have.length", 3); + _.debuggerHelper.AssertErrorCount(3); }); }, ); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts index 9dbc5a43a0..ee6b246647 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts @@ -124,7 +124,17 @@ describe( Cypress.env("TESTPASSWORD2"), ); agHelper.VisitNAssert(currentUrl); - agHelper.ValidateToastMessage("Resource Not Found"); //for 404 screen + cy.get(locators.errorPageTitle).should(($x) => { + //for 404 screen + expect($x).contain(Cypress.env("MESSAGES").PAGE_NOT_FOUND()); + }); + cy.get(locators.errorPageDescription).should(($x) => { + //for 404 screen + expect($x).contain( + "Either this page doesn't exist, or you don't have access to this page", + ); + }); + agHelper.ValidateToastMessage("Resource Not Found"); homePage.LogOutviaAPI(); // visit the app as anonymous user and validate redirection to login page agHelper.VisitNAssert(currentUrl); diff --git a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts index a77af1001a..201b69d0e6 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts @@ -126,7 +126,7 @@ describe("JS Function Execution", { tags: ["@tag.JS"] }, function () { //It should open only in case of execution error. debuggerHelper.AssertClosed(); //Verify there is no error shown in the response tab. - debuggerHelper.ClickDebuggerIcon(); + debuggerHelper.OpenDebugger(); debuggerHelper.ClickResponseTab(); jsEditor.AssertParseError(false); agHelper.ActionContextMenuWithInPane({ @@ -400,7 +400,6 @@ describe("JS Function Execution", { tags: ["@tag.JS"] }, function () { jsEditor.EnableDisableAsyncFuncSettings( functionSetting.name, functionSetting.onPageLoad, - functionSetting.confirmBeforeExecute, ); }, ); @@ -496,12 +495,12 @@ return "yes";`; // Switch to settings tab agHelper.GetNClick(jsEditor._settingsTab); // Enable all settings - jsEditor.EnableDisableAsyncFuncSettings("asyncToSync", true, false); + jsEditor.EnableDisableAsyncFuncSettings("asyncToSync", true); // Modify js object jsEditor.EditJSObj(syncJSCode, false); agHelper.RefreshPage(); - jsEditor.VerifyAsyncFuncSettings("asyncToSync", true, false); + jsEditor.VerifyAsyncFuncSettings("asyncToSync", true); agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.JSObject, diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts index dd100ab787..b89bc975b8 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts @@ -2,6 +2,7 @@ import { agHelper, apiPage, assertHelper, + debuggerHelper, entityExplorer, entityItems, propPane, @@ -58,7 +59,12 @@ describe( `{{PageLoadApi2.data.data}}`, ); agHelper.RefreshPage(); - agHelper.ValidateToastMessage(`The action "PageLoadApi2" has failed.`); + debuggerHelper.AssertDebugError( + 'The action "PageLoadApi2" has failed.', + "", + true, + false, + ); }); after(() => { diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts index 6d246804da..300d27e057 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts @@ -91,7 +91,7 @@ describe( EditorNavigation.SelectEntityByName("Page1", EntityType.Page); agHelper.RefreshPage(); - debuggerHelper.ClickDebuggerIcon(); + debuggerHelper.OpenDebugger(); debuggerHelper.ClickLogsTab(); debuggerHelper.DebuggerLogsFilter("JSObject1.astros"); debuggerHelper.DoesConsoleLogExist("JS Function executed successfully"); diff --git a/app/client/cypress/e2e/Sanity/Datasources/MySQLNoiseTest_spec.js b/app/client/cypress/e2e/Sanity/Datasources/MySQLNoiseTest_spec.js index f1a4d43fb6..ecbc34e024 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MySQLNoiseTest_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/MySQLNoiseTest_spec.js @@ -4,7 +4,11 @@ import { } from "../../../support/Pages/EditorNavigation"; const datasourceEditor = require("../../../locators/DatasourcesEditor.json"); -import { agHelper, dataSources } from "../../../support/Objects/ObjectsCore"; +import { + agHelper, + dataSources, + debuggerHelper, +} from "../../../support/Objects/ObjectsCore"; const commonlocators = require("../../../locators/commonlocators.json"); describe( @@ -60,9 +64,15 @@ describe( force: true, }); cy.wait(2000); - cy.get(commonlocators.toastmsg).contains( - "NoiseTestQuery failed to execute", + + debuggerHelper.OpenDebugger(); + debuggerHelper.ClickLogsTab(); + debuggerHelper.DoesConsoleLogExist( + "Execution failed with status PE-STC-5000", + true, + "NoiseTestQuery", ); + cy.wait("@postExecute").then(({ response }) => { expect(response.body.data.statusCode).to.eq("200 OK"); }); diff --git a/app/client/cypress/support/Objects/CommonLocators.ts b/app/client/cypress/support/Objects/CommonLocators.ts index 2e2c2fc193..3152737bfa 100644 --- a/app/client/cypress/support/Objects/CommonLocators.ts +++ b/app/client/cypress/support/Objects/CommonLocators.ts @@ -334,6 +334,8 @@ export class CommonLocators { _menuItem = ".bp3-menu-item"; _slashCommandHintText = ".slash-command-hint-text"; _selectionItem = ".rc-select-selection-item"; + errorPageTitle = ".t--error-page-title"; + errorPageDescription = ".t--error-page-description"; _selectClearButton_testId = "selectbutton.btn.cancel"; _selectClearButton_dataTestId = `[data-testid="${this._selectClearButton_testId}"]`; } diff --git a/app/client/cypress/support/Pages/DebuggerHelper.ts b/app/client/cypress/support/Pages/DebuggerHelper.ts index 2dabfb7071..979b8f2d84 100644 --- a/app/client/cypress/support/Pages/DebuggerHelper.ts +++ b/app/client/cypress/support/Pages/DebuggerHelper.ts @@ -34,6 +34,7 @@ export class DebuggerHelper { [PageType.JsEditor]: ".t--js-editor-bottom-pane-container", [PageType.DataSources]: ".t--datasource-bottom-pane-container", }, + _ideBottomViewContainer: ".t--ide-bottom-view", _debuggerList: ".debugger-list", _debuggerFilter: "input[data-testid=t--debugger-search]", _debuggerSelectedTab: ".ads-v2-tabs__list-tab", @@ -49,17 +50,16 @@ export class DebuggerHelper { _downStreamLogMessage: ".t--debugger-log-downstream-message", }; - ClickDebuggerIcon( - index?: number, - force?: boolean, - waitTimeInterval?: number, - ) { - this.agHelper.GetNClick( - this.locators._debuggerIcon, - index, - force, - waitTimeInterval, - ); + OpenDebugger() { + // Open opens if it is not open yet + cy.get("body").then(($body) => { + if ($body.find(this.locators._ideBottomViewContainer).length === 0) { + this.agHelper.GetNClick(this.locators._debuggerIcon, 0, false); + } else { + this.agHelper.GetNClick(this.commonLocators._errorTab, 0, true, 0); + } + }); + this.AssertOpen(); } ClickDebuggerToggle(expand = true, index = 0) { @@ -93,7 +93,7 @@ export class DebuggerHelper { this.agHelper.GetNClick(this.locators._closeButton); } - AssertOpen(pageType: PageType) { + AssertOpen(pageType?: PageType) { switch (pageType) { case PageType.Canvas: this.agHelper.AssertElementExist(this.locators._tabsContainer); @@ -106,6 +106,10 @@ export class DebuggerHelper { this.locators._bottomPaneContainer[pageType], ); break; + default: + this.agHelper.AssertElementVisibility( + this.locators._ideBottomViewContainer, + ); } } @@ -118,12 +122,19 @@ export class DebuggerHelper { this.agHelper.AssertSelectedTab(this.locators._debuggerSelectedTab, "true"); } - DoesConsoleLogExist(text: string, exists = true) { + DoesConsoleLogExist(text: string, exists = true, entityName?: string) { this.agHelper.GetNAssertContains( this.locators._logMessage, text, exists ? "exist" : "not.exist", ); + if (entityName) { + this.agHelper + .GetElement(this.locators._logMessage) + .contains(text) + .closest(".error") + .contains(this.locators._logEntityLink, entityName); + } } DebuggerLogsFilter(text: string) { @@ -187,9 +198,10 @@ export class DebuggerHelper { message: string, shouldOpenDebugger = true, shouldToggleDebugger = true, + errorLabelIndex = 0, ) { if (shouldOpenDebugger) { - this.ClickDebuggerIcon(); + this.OpenDebugger(); } this.agHelper.GetNClick(this.commonLocators._errorTab, 0, true, 0); @@ -198,7 +210,7 @@ export class DebuggerHelper { } this.agHelper - .GetText(this.locators._debuggerLabel, "text", 0) + .GetText(this.locators._debuggerLabel, "text", errorLabelIndex) .then(($text) => { expect($text).to.eq(label); }); @@ -222,7 +234,7 @@ export class DebuggerHelper { AssertDownStreamLogError(message: string, shouldOpenDebugger = true) { if (shouldOpenDebugger) { - this.ClickDebuggerIcon(); + this.OpenDebugger(); } this.agHelper.GetNClick(this.commonLocators._responseTab, 0, true, 0); diff --git a/app/client/src/IDE/Components/BottomView.tsx b/app/client/src/IDE/Components/BottomView.tsx index 022a4fe89a..89470b8613 100644 --- a/app/client/src/IDE/Components/BottomView.tsx +++ b/app/client/src/IDE/Components/BottomView.tsx @@ -6,6 +6,7 @@ import Resizer, { import { CodeEditorWithGutterStyles } from "pages/Editor/JSEditor/styledComponents"; import { ViewDisplayMode, ViewHideBehaviour } from "IDE/Interfaces/View"; import { Button } from "@appsmith/ads"; +import classNames from "classnames"; const VIEW_MIN_HEIGHT = 38; @@ -112,6 +113,7 @@ const ViewHide = (props: ViewHideProps) => { const BottomView = (props: Props) => { const panelRef = useRef(null); + const { className = "" } = props; // Handle the height of the view when toggling the hidden state useEffect(() => { @@ -126,7 +128,10 @@ const BottomView = (props: Props) => { return ( diff --git a/app/client/src/actions/jsActionActions.ts b/app/client/src/actions/jsActionActions.ts index 00a11cd618..19caef697d 100644 --- a/app/client/src/actions/jsActionActions.ts +++ b/app/client/src/actions/jsActionActions.ts @@ -8,6 +8,7 @@ import type { JSCollection } from "entities/JSCollection"; import type { CreateJSCollectionRequest } from "ee/api/JSActionAPI"; import type { EventLocation } from "ee/utils/analyticsUtilTypes"; import type { ApiResponse } from "api/ApiResponses"; +import type { ErrorActionPayload } from "../sagas/ErrorSagas"; export interface FetchJSCollectionsPayload { applicationId: string; @@ -62,10 +63,12 @@ export const copyJSCollectionSuccess = (payload: JSCollection) => { }; }; -export const copyJSCollectionError = (payload: { - id: string; - destinationPageId: string; -}) => { +export const copyJSCollectionError = ( + payload: { + id: string; + destinationPageId: string; + } & ErrorActionPayload, +) => { return { type: ReduxActionErrorTypes.COPY_JS_ACTION_ERROR, payload, @@ -90,10 +93,12 @@ export const moveJSCollectionSuccess = (payload: JSCollection) => { }; }; -export const moveJSCollectionError = (payload: { - id: string; - originalPageId: string; -}) => { +export const moveJSCollectionError = ( + payload: { + id: string; + originalPageId: string; + } & ErrorActionPayload, +) => { return { type: ReduxActionErrorTypes.MOVE_JS_ACTION_ERROR, payload, diff --git a/app/client/src/actions/pluginActionActions.ts b/app/client/src/actions/pluginActionActions.ts index 611beaaa4d..81a0edf9d0 100644 --- a/app/client/src/actions/pluginActionActions.ts +++ b/app/client/src/actions/pluginActionActions.ts @@ -15,6 +15,7 @@ import type { ModalInfo } from "reducers/uiReducers/modalActionReducer"; import type { OtlpSpan } from "UITelemetry/generateTraces"; import type { ApiResponse } from "api/ApiResponses"; import type { JSCollection } from "entities/JSCollection"; +import type { ErrorActionPayload } from "sagas/ErrorSagas"; export const createActionRequest = (payload: Partial) => { return { @@ -205,10 +206,12 @@ export const moveActionSuccess = (payload: Action) => { }; }; -export const moveActionError = (payload: { - id: string; - originalPageId: string; -}) => { +export const moveActionError = ( + payload: { + id: string; + originalPageId: string; + } & ErrorActionPayload, +) => { return { type: ReduxActionErrorTypes.MOVE_ACTION_ERROR, payload, @@ -233,10 +236,12 @@ export const copyActionSuccess = (payload: Action) => { }; }; -export const copyActionError = (payload: { - id: string; - destinationPageId: string; -}) => { +export const copyActionError = ( + payload: { + id: string; + destinationPageId: string; + } & ErrorActionPayload, +) => { return { type: ReduxActionErrorTypes.COPY_ACTION_ERROR, payload, diff --git a/app/client/src/ce/constants/ReduxActionConstants.tsx b/app/client/src/ce/constants/ReduxActionConstants.tsx index e3c5510381..7ab4dbd15b 100644 --- a/app/client/src/ce/constants/ReduxActionConstants.tsx +++ b/app/client/src/ce/constants/ReduxActionConstants.tsx @@ -368,7 +368,6 @@ const UserAuthActionTypes = { SAAS_GET_OAUTH_ACCESS_TOKEN: "SAAS_GET_OAUTH_ACCESS_TOKEN", GET_OAUTH_ACCESS_TOKEN: "GET_OAUTH_ACCESS_TOKEN", GET_OAUTH_ACCESS_TOKEN_SUCCESS: "GET_OAUTH_ACCESS_TOKEN_SUCCESS", - GET_OAUTH_ACCESS_TOKEN_ERROR: "GET_OAUTH_ACCESS_TOKEN_ERROR", }; const UserAuthActionErrorTypes = { CREATE_USER_ERROR: "CREATE_USER_ERROR", @@ -379,6 +378,7 @@ const UserAuthActionErrorTypes = { LOGOUT_USER_ERROR: "LOGOUT_USER_ERROR", VERIFY_INVITE_ERROR: "VERIFY_INVITE_ERROR", INVITED_USER_SIGNUP_ERROR: "INVITED_USER_SIGNUP_ERROR", + GET_OAUTH_ACCESS_TOKEN_ERROR: "GET_OAUTH_ACCESS_TOKEN_ERROR", }; const UserProfileActionTypes = { @@ -1334,6 +1334,20 @@ export const ReduxActionErrorTypes = { ...WorkspaceActionErrorTypes, }; +export const toastMessageErrorTypes = { + ...AdminSettingsActionErrorTypes, + ...ApplicationActionErrorTypes, + ...AppViewActionErrorTypes, + ...DatasourceEditorActionErrorTypes, + ...GitActionErrorTypes, + ...ImportExportActionErrorTypes, + ...PlatformActionErrorTypes, + ...TenantActionErrorTypes, + ...UserAuthActionErrorTypes, + ...UserProfileActionErrorTypes, + ...WorkspaceActionErrorTypes, +}; + export type ReduxActionErrorType = (typeof ReduxActionErrorTypes)[keyof typeof ReduxActionErrorTypes]; diff --git a/app/client/src/ce/plugins/Linting/utils/getEntityUniqueIdForLogs.ts b/app/client/src/ce/plugins/Linting/utils/getEntityUniqueIdForLogs.ts index 414cb362e7..619de80cc8 100644 --- a/app/client/src/ce/plugins/Linting/utils/getEntityUniqueIdForLogs.ts +++ b/app/client/src/ce/plugins/Linting/utils/getEntityUniqueIdForLogs.ts @@ -1,4 +1,4 @@ -import type { JSActionEntity } from "ee/entities/DataTree/types"; +import type { JSActionEntity, WidgetEntity } from "ee/entities/DataTree/types"; import { ENTITY_TYPE } from "entities/DataTree/dataTreeFactory"; import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes"; @@ -9,6 +9,9 @@ const entityUniqueIdGetterMap: Record< [ENTITY_TYPE.JSACTION]: (entity) => { return (entity as JSActionEntity).actionId; }, + [ENTITY_TYPE.WIDGET]: (entity) => { + return (entity as WidgetEntity).widgetId; + }, }; export default function getEntityUniqueIdForLogs(entity: DataTreeEntity) { diff --git a/app/client/src/ce/plugins/Linting/utils/isLintErrorLoggingEnabledForEntity.ts b/app/client/src/ce/plugins/Linting/utils/isLintErrorLoggingEnabledForEntity.ts index c5bad4b96f..15b205c769 100644 --- a/app/client/src/ce/plugins/Linting/utils/isLintErrorLoggingEnabledForEntity.ts +++ b/app/client/src/ce/plugins/Linting/utils/isLintErrorLoggingEnabledForEntity.ts @@ -1,8 +1,16 @@ -import { isJSAction } from "ee/workers/Evaluation/evaluationUtils"; +import { isJSAction, isWidget } from "ee/workers/Evaluation/evaluationUtils"; import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes"; +import type { DataTreeEntityConfig } from "ee/entities/DataTree/types"; export default function isLintErrorLoggingEnabledForEntity( entity: DataTreeEntity, + propertyPath: string, + config: DataTreeEntityConfig, ) { - return isJSAction(entity); + if (isJSAction(entity)) { + return true; + } + if (isWidget(entity)) { + return !(propertyPath in config.reactivePaths); + } } diff --git a/app/client/src/ce/sagas/JSActionSagas.ts b/app/client/src/ce/sagas/JSActionSagas.ts index a152a8acd2..7c72f18b67 100644 --- a/app/client/src/ce/sagas/JSActionSagas.ts +++ b/app/client/src/ce/sagas/JSActionSagas.ts @@ -192,10 +192,15 @@ export function* copyJSCollectionSaga( } } catch (e) { const actionName = actionObject ? actionObject.name : ""; - toast.show(createMessage(ERROR_JS_ACTION_COPY_FAIL, actionName), { - kind: "error", - }); - yield put(copyJSCollectionError(action.payload)); + yield put( + copyJSCollectionError({ + ...action.payload, + show: true, + error: { + message: createMessage(ERROR_JS_ACTION_COPY_FAIL, actionName), + }, + }), + ); } } @@ -265,13 +270,14 @@ export function* moveJSCollectionSaga( // @ts-expect-error: response.data is of type unknown yield put(moveJSCollectionSuccess(response.data)); } catch (e) { - toast.show(createMessage(ERROR_JS_ACTION_MOVE_FAIL, actionObject.name), { - kind: "error", - }); yield put( moveJSCollectionError({ id: action.payload.id, originalPageId: actionObject.pageId, + show: true, + error: { + message: createMessage(ERROR_JS_ACTION_MOVE_FAIL, actionObject.name), + }, }), ); } @@ -375,15 +381,15 @@ export function* saveJSObjectName( payload: { actionId: action.payload.id, oldName: collection.config.name, + show: true, + error: { + message: createMessage( + ERROR_JS_COLLECTION_RENAME_FAIL, + action.payload.name, + ), + }, }, }); - toast.show( - createMessage(ERROR_JS_COLLECTION_RENAME_FAIL, action.payload.name), - { - kind: "error", - }, - ); - log.error(e); } } diff --git a/app/client/src/components/editorComponents/Debugger/LogItem.tsx b/app/client/src/components/editorComponents/Debugger/LogItem.tsx index 90d76e7a95..b8c06c0805 100644 --- a/app/client/src/components/editorComponents/Debugger/LogItem.tsx +++ b/app/client/src/components/editorComponents/Debugger/LogItem.tsx @@ -267,9 +267,7 @@ function LogItem(props: LogItemProps) { size="md" /> - {props.severity === Severity.ERROR - ? moment(parseInt(props.timestamp)).format("HH:mm:ss") - : props.timestamp} + {moment(parseInt(props.timestamp)).format("HH:mm:ss")}