diff --git a/.env.example b/.env.example index ef48c3bc9d..a98011bb3d 100644 --- a/.env.example +++ b/.env.example @@ -57,4 +57,4 @@ APPSMITH_MAIL_SMTP_TLS_ENABLED= #APPSMITH_SENTRY_ENVIRONMENT= # Configure cloud services -# APPSMITH_CLOUD_SERVICES_BASE_URL \ No newline at end of file +# APPSMITH_CLOUD_SERVICES_BASE_URL="https://release-cs.appsmith.com" \ No newline at end of file diff --git a/.github/workflows/client-test.yml b/.github/workflows/client-test.yml index 231976f008..a124259ceb 100644 --- a/.github/workflows/client-test.yml +++ b/.github/workflows/client-test.yml @@ -297,7 +297,7 @@ jobs: - name: Return status for ui-matrix run: | - if [[${{ needs.ui-test.result }} == "success" ]]; then + if [[ "${{ needs.ui-test.result }}" == "success" ]]; then exit 0 else exit 1 diff --git a/app/client/.eslintrc.json b/app/client/.eslintrc.json index fe0ab77466..7cf9b9c110 100644 --- a/app/client/.eslintrc.json +++ b/app/client/.eslintrc.json @@ -1,7 +1,7 @@ // This JSON file configures the eslint plugin. It supports comments as well as per the JSON5 spec { "parser": "@typescript-eslint/parser", - "plugins": ["react", "@typescript-eslint", "prettier", "react-hooks"], + "plugins": ["react", "@typescript-eslint", "prettier", "react-hooks","sort-destructure-keys"], "extends": [ "plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react "plugin:@typescript-eslint/recommended", @@ -34,7 +34,8 @@ "react/self-closing-comp": "error", "react/jsx-sort-props": "error", "react/jsx-fragments": "error", - "react/jsx-no-useless-fragment": "error" + "react/jsx-no-useless-fragment": "error", + "sort-destructure-keys/sort-destructure-keys": ["error", {"caseSensitive": false}] }, "settings": { "react": { diff --git a/app/client/cypress/fixtures/CanvasResizeDsl.json b/app/client/cypress/fixtures/CanvasResizeDsl.json index 0ade4a1ac2..f26b52f98f 100644 --- a/app/client/cypress/fixtures/CanvasResizeDsl.json +++ b/app/client/cypress/fixtures/CanvasResizeDsl.json @@ -7,7 +7,7 @@ "detachFromLayout": true, "widgetId": "0", "topRow": 0, - "bottomRow": 2960, + "bottomRow": 740, "containerStyle": "none", "snapRows": 33, "parentRowSpace": 1, diff --git a/app/client/cypress/fixtures/Mapdsl.json b/app/client/cypress/fixtures/Mapdsl.json index 490ab5f87b..2f75e8c860 100644 --- a/app/client/cypress/fixtures/Mapdsl.json +++ b/app/client/cypress/fixtures/Mapdsl.json @@ -144,7 +144,7 @@ "parentRowSpace": 38, "leftColumn": 3, "rightColumn": 11, - "topRow": 0, + "topRow": 1, "bottomRow": 12, "parentId": "yt4ouwn0sk", "widgetId": "673etzjyv9", diff --git a/app/client/cypress/fixtures/chartUpdatedDsl.json b/app/client/cypress/fixtures/chartUpdatedDsl.json new file mode 100644 index 0000000000..20a57d6a5c --- /dev/null +++ b/app/client/cypress/fixtures/chartUpdatedDsl.json @@ -0,0 +1,184 @@ +{ + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 966, + "snapColumns": 64, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 5168, + "containerStyle": "none", + "snapRows": 129, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 20, + "minHeight": 450, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "backgroundColor": "#FFFFFF", + "widgetName": "Container1", + "rightColumn": 32, + "orientation": "VERTICAL", + "snapColumns": 16, + "widgetId": "mxbaasg65u", + "containerStyle": "card", + "topRow": 0, + "bottomRow": 36, + "parentRowSpace": 38, + "isVisible": true, + "type": "CONTAINER_WIDGET", + "version": 1, + "isLoading": false, + "parentColumnSpace": 75.25, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "backgroundColor": "transparent", + "widgetName": "59gdivzv7s", + "rightColumn": 2408, + "orientation": "VERTICAL", + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "bxekwxgc1i", + "containerStyle": "none", + "topRow": 0, + "bottomRow": 20, + "parentRowSpace": 1, + "isVisible": true, + "type": "CANVAS_WIDGET", + "canExtend": false, + "version": 1, + "isLoading": false, + "parentColumnSpace": 1, + "leftColumn": 0, + "dynamicBindingPathList": [], + "children": [] + } + ] + }, + { + "backgroundColor": "#FFFFFF", + "widgetName": "Container3", + "rightColumn": 64, + "orientation": "VERTICAL", + "snapColumns": 16, + "widgetId": "i331vll2mg", + "containerStyle": "card", + "topRow": 36, + "bottomRow": 92, + "parentRowSpace": 38, + "isVisible": true, + "type": "CONTAINER_WIDGET", + "version": 1, + "isLoading": false, + "parentColumnSpace": 75.25, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "backgroundColor": "transparent", + "widgetName": "rhfg2vf1n5", + "rightColumn": 4816, + "orientation": "VERTICAL", + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "rglduihhzk", + "containerStyle": "none", + "topRow": 0, + "bottomRow": 20, + "parentRowSpace": 1, + "isVisible": true, + "type": "CANVAS_WIDGET", + "canExtend": false, + "version": 1, + "isLoading": false, + "parentColumnSpace": 1, + "leftColumn": 0, + "dynamicBindingPathList": [], + "children": [ + { + "isVisible": true, + "widgetName": "Chart1", + "chartType": "LINE_CHART", + "chartName": "Last week's revenue", + "allowHorizontalScroll": false, + "version": 1, + "chartData": { + "q4pm3w97mo": { + "seriesName": "Sales", + "data": "" + } + }, + "xAxisName": "Last Week", + "yAxisName": "Total Order Revenue $", + "type": "CHART_WIDGET", + "isLoading": false, + "parentColumnSpace": 14.59375, + "parentRowSpace": 10, + "leftColumn": 20, + "rightColumn": 44, + "topRow": 16, + "bottomRow": 48, + "parentId": "rglduihhzk", + "widgetId": "snzfh3qjo8", + "dynamicBindingPathList": [], + "dynamicTriggerPathList": [] + } + ] + } + ] + }, + { + "backgroundColor": "#FFFFFF", + "widgetName": "Container4", + "rightColumn": 64, + "orientation": "VERTICAL", + "snapColumns": 16, + "widgetId": "qznzsquf70", + "containerStyle": "card", + "topRow": 0, + "bottomRow": 36, + "parentRowSpace": 38, + "isVisible": true, + "type": "CONTAINER_WIDGET", + "version": 1, + "isLoading": false, + "parentColumnSpace": 75.25, + "dynamicBindingPathList": [], + "leftColumn": 32, + "children": [ + { + "backgroundColor": "transparent", + "widgetName": "3bn6uv0vy4", + "rightColumn": 2408, + "orientation": "VERTICAL", + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "7vm5mdu8ey", + "containerStyle": "none", + "topRow": 0, + "bottomRow": 1368, + "parentRowSpace": 1, + "isVisible": true, + "type": "CANVAS_WIDGET", + "canExtend": false, + "version": 1, + "isLoading": false, + "parentColumnSpace": 1, + "leftColumn": 0, + "dynamicBindingPathList": [], + "children": [ + null + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/app/client/cypress/fixtures/debuggerTableDsl.json b/app/client/cypress/fixtures/debuggerTableDsl.json new file mode 100644 index 0000000000..afaed3b2cf --- /dev/null +++ b/app/client/cypress/fixtures/debuggerTableDsl.json @@ -0,0 +1,42 @@ +{ + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 1224, + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1280, + "containerStyle": "none", + "snapRows": 33, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 9, + "minHeight": 1292, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "isVisible": true, + "label": "Data", + "widgetName": "Table1", + "searchKey": "", + "tableData": "{{TestApi.data.users}}", + "type": "TABLE_WIDGET", + "isLoading": false, + "parentColumnSpace": 74, + "parentRowSpace": 40, + "leftColumn": 1, + "rightColumn": 9, + "topRow": 7, + "bottomRow": 14, + "parentId": "0", + "widgetId": "7miqot30xy", + "dynamicBindingPathList": [] + } + ] + } + } \ No newline at end of file diff --git a/app/client/cypress/fixtures/displayWidgetDsl.json b/app/client/cypress/fixtures/displayWidgetDsl.json index 01da343433..e2fbfa257b 100644 --- a/app/client/cypress/fixtures/displayWidgetDsl.json +++ b/app/client/cypress/fixtures/displayWidgetDsl.json @@ -14,7 +14,6 @@ "type": "CANVAS_WIDGET", "canExtend": true, "dynamicBindingPathList": [], - "version": 4, "minHeight": 1292, "parentColumnSpace": 1, "leftColumn": 0, diff --git a/app/client/cypress/fixtures/formdsl.json b/app/client/cypress/fixtures/formdsl.json index 866f2a0255..f8859c48a5 100644 --- a/app/client/cypress/fixtures/formdsl.json +++ b/app/client/cypress/fixtures/formdsl.json @@ -199,7 +199,7 @@ "backgroundColor": "Gray", "rightColumn": 11, "widgetId": "z62mnh15y5", - "topRow": 0, + "topRow": 1, "bottomRow": 13, "parentRowSpace": 38, "isVisible": true, diff --git a/app/client/cypress/fixtures/tableWidgetDsl.json b/app/client/cypress/fixtures/tableWidgetDsl.json index 349f604903..9929225f5e 100644 --- a/app/client/cypress/fixtures/tableWidgetDsl.json +++ b/app/client/cypress/fixtures/tableWidgetDsl.json @@ -67,7 +67,11 @@ "bottomRow": 10, "parentId": "tyiwk4xuq0", "widgetId": "5up3r2iuvs", - "dynamicBindingPathList": [] + "dynamicTriggerPathList": [{ + "key": "onSearchTextChanged" + }], + "onSearchTextChanged": "{{Api1.run()}}", + "selectedRow": "{{Table1.tableData[Table1.selectedRowIndex]}}" } ], "widgetId": "tyiwk4xuq0", diff --git a/app/client/cypress/fixtures/testdata.json b/app/client/cypress/fixtures/testdata.json index 61d619d292..cc934021ca 100644 --- a/app/client/cypress/fixtures/testdata.json +++ b/app/client/cypress/fixtures/testdata.json @@ -122,5 +122,6 @@ "accessTokenUrl": "https://oauth.mocklab.io/oauth/token", "oauthResponse": "169444434892406", "authorizationURL": "https://oauth.mocklab.io/oauth/authorize", - "basicURl": "https://envyenksqii9nf3.m.pipedream.net" + "basicURl": "https://envyenksqii9nf3.m.pipedream.net", + "methodWithQueryParam": "users?q=mimeType='application/vnd.google-apps.spreadsheet'" } diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_Edit_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_Edit_spec.js index d46a3b1ec0..918c4592da 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_Edit_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_Edit_spec.js @@ -39,4 +39,16 @@ describe("API Panel Test Functionality", function() { cy.xpath(apiwidget.headerKey).should("be.visible"); cy.xpath(apiwidget.headerKey).should("have.value", ""); }); + + it("Should correctly parse query params", function() { + cy.NavigateToAPI_Panel(); + cy.CreateAPI("APIWithQueryParams"); + cy.get("textarea").should( + "have.attr", + "placeholder", + "https://mock-api.appsmith.com/users", + ); + cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methodWithQueryParam); + cy.ValidateQueryParams({ key: "q", value:"mimeType='application/vnd.google-apps.spreadsheet'" }); + }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Applications/DuplicateApplication_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Applications/DuplicateApplication_spec.js index e824916c33..31427f6462 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Applications/DuplicateApplication_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Applications/DuplicateApplication_spec.js @@ -6,6 +6,7 @@ let duplicateApplicationDsl; describe("Duplicate application", function() { before(() => { + dsl.dsl.version = 20; // latest migrated version cy.addDsl(dsl); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Applications/ForkApplication_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Applications/ForkApplication_spec.js index f0d29008c1..4defd83f1b 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Applications/ForkApplication_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Applications/ForkApplication_spec.js @@ -5,6 +5,7 @@ let forkedApplicationDsl; describe("Fork application across orgs", function() { before(() => { + dsl.dsl.version = 20; // latest migrated version cy.addDsl(dsl); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Bind_tableApi_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Bind_tableApi_spec.js index d65d22e80d..fb8eeb6b6e 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Bind_tableApi_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Bind_tableApi_spec.js @@ -3,6 +3,7 @@ const dsl = require("../../../../fixtures/tableWidgetDsl.json"); const pages = require("../../../../locators/Pages.json"); const apiPage = require("../../../../locators/ApiEditor.json"); const publishPage = require("../../../../locators/publishWidgetspage.json"); +const widgetsPage = require("../../../../locators/Widgets.json"); describe("Test Create Api and Bind to Table widget", function() { let apiData; @@ -43,6 +44,18 @@ describe("Test Create Api and Bind to Table widget", function() { cy.readTabledataPublish("0", "1").then((tabData) => { expect(apiData).to.eq(`\"${tabData}\"`); }); + cy.get(commonlocators.backToEditor).click(); + }); + + it("Validate onSearchTextChanged function is called when configured for search text", function() { + cy.SearchEntityandOpen("Table1"); + cy.get(".t--widget-tablewidget .t--search-input") + .first() + .type("Currey"); + cy.wait(5000); + cy.readTabledataPublish("0", "1").then((tabData) => { + expect(apiData).to.eq(`\"${tabData}\"`); + }); }); afterEach(() => { diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Logs_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Logs_spec.js index e884caf535..50309718f1 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Logs_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Logs_spec.js @@ -1,4 +1,6 @@ const dsl = require("../../../../fixtures/buttondsl.json"); +const commonlocators = require("../../../../locators/commonlocators.json"); +const debuggerLocators = require("../../../../locators/Debugger.json"); describe("Debugger logs", function() { before(() => { @@ -11,4 +13,19 @@ describe("Debugger logs", function() { cy.get(".t--debugger").click(); cy.get(".t--debugger-log-state").contains("Test"); }); + + it("Reset debugger state", function() { + cy.openPropertyPane("buttonwidget"); + cy.get(".t--property-control-visible") + .find(".t--js-toggle") + .click(); + cy.testJsontext("visible", "Test"); + + cy.get(commonlocators.homeIcon).click({ force: true }); + cy.generateUUID().then((id) => { + cy.CreateAppInFirstListedOrg(id); + + cy.contains(debuggerLocators.debuggerIcon, 0); + }); + }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/PageOnLoad_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/PageOnLoad_spec.js new file mode 100644 index 0000000000..2fd3a73d96 --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/PageOnLoad_spec.js @@ -0,0 +1,23 @@ +const dsl = require("../../../../fixtures/debuggerTableDsl.json"); +const explorer = require("../../../../locators/explorerlocators.json"); +const debuggerLocators = require("../../../../locators/Debugger.json"); +const testdata = require("../../../../fixtures/testdata.json"); + +describe("Check debugger logs state when there are onPageLoad actions", function() { + before(() => { + cy.addDsl(dsl); + }); + it("Check debugger logs state when there are onPageLoad actions", function() { + cy.openPropertyPane("tablewidget"); + cy.testJsontext("tabledata", "{{TestApi.data.users}}"); + cy.NavigateToAPI_Panel(); + cy.CreateAPI("TestApi"); + cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods); + cy.SaveAndRunAPI(); + + cy.get(explorer.addWidget).click(); + + cy.reload(); + cy.contains(debuggerLocators.debuggerIcon, 0); + }); +}); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Widget_Error_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Widget_Error_spec.js new file mode 100644 index 0000000000..3daf51823b --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Widget_Error_spec.js @@ -0,0 +1,17 @@ +const dsl = require("../../../../fixtures/buttondsl.json"); + +describe("Widget error state", function() { + before(() => { + cy.addDsl(dsl); + }); + it("Check widget error state", function() { + cy.openPropertyPane("buttonwidget"); + + cy.get(".t--property-control-visible") + .find(".t--js-toggle") + .click(); + cy.testJsontext("visible", "Test"); + + cy.contains(".t--widget-error-count", 1); + }); +}); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Chart_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Chart_spec.js index 261a1741fe..91abacd7e7 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Chart_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Chart_spec.js @@ -1,7 +1,7 @@ const commonlocators = require("../../../../locators/commonlocators.json"); const viewWidgetsPage = require("../../../../locators/ViewWidgets.json"); const publish = require("../../../../locators/publishWidgetspage.json"); -const dsl = require("../../../../fixtures/displayWidgetDsl.json"); +const dsl = require("../../../../fixtures/chartUpdatedDsl.json"); const pages = require("../../../../locators/Pages.json"); describe("Chart Widget Functionality", function() { @@ -43,7 +43,11 @@ describe("Chart Widget Functionality", function() { cy.get(viewWidgetsPage.chartType) .last() .should("have.text", "Column Chart"); - cy.testJsontext("chartseries", JSON.stringify(this.data.chartInput)); + cy.testJsontext( + "chart-series-data-control", + JSON.stringify(this.data.chartInput), + ); + cy.get(".t--propertypane").click("right"); cy.get(viewWidgetsPage.chartWidget) .should("be.visible") .and((chart) => { diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Modal_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Modal_spec.js index ba257c5ae2..e36c3f6648 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Modal_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Modal_spec.js @@ -8,7 +8,7 @@ describe("Modal Widget Functionality", function() { it("Add new Modal", () => { cy.get(explorer.addWidget).click(); - cy.dragAndDropToCanvas("modalwidget", { x: 300, y: -300 }); + cy.dragAndDropToCanvas("modalwidget", { x: 300, y: 300 }); cy.get(".t--modal-widget").should("exist"); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Copy_Paste_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Copy_Paste_spec.js index e398325e27..c5648f5efb 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Copy_Paste_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Copy_Paste_spec.js @@ -37,14 +37,14 @@ describe("Test Suite to validate copy/paste table Widget", function() { .contains("UNDO") .click({ force: true }); */ - cy.GlobalSearchEntity("Table2"); + cy.GlobalSearchEntity("Table1Copy"); cy.get(".t--entity-collapse-toggle") .last() .click(); cy.get(apiwidget.propertyList).then(function($lis) { expect($lis).to.have.length(8); - expect($lis.eq(0)).to.contain("{{Table2.selectedRow}}"); - expect($lis.eq(1)).to.contain("{{Table2.selectedRows}}"); + expect($lis.eq(0)).to.contain("{{Table1Copy.selectedRow}}"); + expect($lis.eq(1)).to.contain("{{Table1Copy.selectedRows}}"); }); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_DragAndDropWidget_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_DragAndDropWidget_spec.js index a2d387bd31..06b63c3340 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_DragAndDropWidget_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_DragAndDropWidget_spec.js @@ -15,7 +15,8 @@ describe("Entity explorer Drag and Drop widgets testcases", function() { cy.get(commonlocators.entityExplorersearch) .clear() .type("form"); - cy.dragAndDropToCanvas("formwidget", { x: 300, y: -300 }); + cy.dragAndDropToCanvas("formwidget", { x: 300, y: 80 }); + cy.get(formWidgetsPage.formD).click(); /** * @param{Text} Random Text * @param{FormWidget}Mouseover diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js index f094bf74d7..12cd1d8c7a 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js @@ -101,10 +101,11 @@ describe("Entity explorer tests related to query and datasource", function() { .find(explorer.collapse) .click(); cy.get(apiwidget.propertyList).then(function($lis) { - expect($lis).to.have.length(3); + expect($lis).to.have.length(4); expect($lis.eq(0)).to.contain("{{Query1.isLoading}}"); expect($lis.eq(1)).to.contain("{{Query1.data}}"); - expect($lis.eq(2)).to.contain("{{Query1.run()}}"); + expect($lis.eq(2)).to.contain("{{Query1.responseMeta}}"); + expect($lis.eq(3)).to.contain("{{Query1.run()}}"); }); cy.Createpage(pageid); cy.GlobalSearchEntity("Query1"); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js index c6627d91bf..2a4774093a 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js @@ -28,7 +28,8 @@ describe("Test Suite to validate copy/delete/undo functionalites", function() { cy.wait(500); cy.get(commonlocators.toastBody) .first() - .contains("Copied"); + .contains("Copied") + .click(); cy.get("body").type(`{${modifierKey}}v`, { force: true }); cy.wait("@updateLayout").should( "have.nested.property", @@ -45,11 +46,11 @@ describe("Test Suite to validate copy/delete/undo functionalites", function() { cy.get(commonlocators.toastAction) .contains("UNDO") .click({ force: true }); - cy.GlobalSearchEntity("Form1"); + cy.GlobalSearchEntity("FormTestCopy"); cy.get(apiwidget.propertyList).then(function($lis) { expect($lis).to.have.length(2); - expect($lis.eq(0)).to.contain("{{Form1.isVisible}}"); - expect($lis.eq(1)).to.contain("{{Form1.data}}"); + expect($lis.eq(0)).to.contain("{{FormTestCopy.isVisible}}"); + expect($lis.eq(1)).to.contain("{{FormTestCopy.data}}"); }); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_2_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_2_spec.js index cdb0cd513d..0208539c48 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_2_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_2_spec.js @@ -74,9 +74,9 @@ describe("DatePicker Widget Property pane tests with js bindings", function() { cy.get(".t--property-control-defaultdate .bp3-input").type("2020-02-01"); cy.closePropertyPane(); cy.openPropertyPane("datepickerwidget2"); - cy.get(formWidgetsPage.toggleJsMinDate).click(); + cy.get(formWidgetsPage.toggleJsMinDate).click({ force: true }); cy.get(".t--property-control-mindate .bp3-input").type("2020-01-01"); - cy.get(formWidgetsPage.toggleJsMaxDate).click(); + cy.get(formWidgetsPage.toggleJsMaxDate).click({ force: true }); cy.get(".t--property-control-maxdate .bp3-input").type("2020-02-10"); cy.closePropertyPane(); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/GlobalSearch/GlobalSearch_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/GlobalSearch/GlobalSearch_spec.js index 3f60f9e819..b6fabfd216 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/GlobalSearch/GlobalSearch_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/GlobalSearch/GlobalSearch_spec.js @@ -42,8 +42,8 @@ describe("GlobalSearch", function() { .its("store") .invoke("getState") .then((state) => { - const { selectedWidget } = state.ui.widgetDragResize; - expect(selectedWidget).to.be.equal(table.widgetId); + const { lastSelectedWidget } = state.ui.widgetDragResize; + expect(lastSelectedWidget).to.be.equal(table.widgetId); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Onboarding/Onboarding_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Onboarding/Onboarding_spec.js index d8712160d2..98de0012e7 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Onboarding/Onboarding_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Onboarding/Onboarding_spec.js @@ -50,7 +50,7 @@ describe("Onboarding", function() { // Add widget cy.get(".t--add-widget").click(); - cy.dragAndDropToCanvas("tablewidget", { x: 30, y: -30 }); + cy.dragAndDropToCanvas("tablewidget", { x: 360, y: 20 }); // wait for animation duration // eslint-disable-next-line cypress/no-unnecessary-waiting diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ProductUpdates/ProductUpdates_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ProductUpdates/ProductUpdates_spec.js index db433c36c7..338970ff7b 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ProductUpdates/ProductUpdates_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ProductUpdates/ProductUpdates_spec.js @@ -13,7 +13,7 @@ describe("Check for product updates button and modal", function() { const { releaseItems, newReleasesCount } = state.ui.releases; if (Array.isArray(releaseItems) && releaseItems.length > 0) { cy.get("[data-cy=t--product-updates-btn]") - .contains(newReleasesCount) + .contains("What's New?") .click({ force: true }); //eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); // modal transition diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceBasicProfile_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceBasicProfile_spec.js index cbfdba5572..aac6a3abef 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceBasicProfile_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceBasicProfile_spec.js @@ -1,22 +1,26 @@ -const testdata = require("../../../../fixtures/testdata.json"); -describe("Create a rest datasource", function() { - beforeEach(() => { - cy.startRoutesForDatasource(); - }); +/* + * Commenting this spec as its flaky + * + * */ +// const testdata = require("../../../../fixtures/testdata.json"); +// describe("Create a rest datasource", function() { +// beforeEach(() => { +// cy.startRoutesForDatasource(); +// }); - it("Create a rest datasource", function() { - cy.NavigateToAPI_Panel(); - cy.CreateAPI("Testapi"); - cy.enterDatasource(testdata.basicURl); - cy.get(".t--store-as-datasource").click(); - cy.addBasicProfileDetails("test", "test@123"); - cy.saveDatasource(); - cy.contains(".datasource-highlight", "envyenksqii9nf3.m.pipedream.net"); - cy.SaveAndRunAPI(); - cy.wait(2000); - var encodedStringBtoA = btoa("test:test@123"); - cy.log(encodedStringBtoA); - cy.ResponseStatusCheck(testdata.successStatusCode); - cy.ResponseTextCheck("Basic ".concat(encodedStringBtoA)); - }); -}); +// it("Create a rest datasource", function() { +// cy.NavigateToAPI_Panel(); +// cy.CreateAPI("Testapi"); +// cy.enterDatasource(testdata.basicURl); +// cy.get(".t--store-as-datasource").click(); +// cy.addBasicProfileDetails("test", "test@123"); +// cy.saveDatasource(); +// cy.contains(".datasource-highlight", "envyenksqii9nf3.m.pipedream.net"); +// cy.SaveAndRunAPI(); +// cy.wait(2000); +// var encodedStringBtoA = btoa("test:test@123"); +// cy.log(encodedStringBtoA); +// cy.ResponseStatusCheck(testdata.successStatusCode); +// cy.ResponseTextCheck("Basic ".concat(encodedStringBtoA)); +// }); +// }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_API_Pane_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_API_Pane_spec.js index c14b38effc..0e60dda003 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_API_Pane_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_API_Pane_spec.js @@ -27,10 +27,11 @@ describe("Entity explorer API pane related testcases", function() { .find(explorer.collapse) .click(); cy.get(apiwidget.propertyList).then(function($lis) { - expect($lis).to.have.length(3); + expect($lis).to.have.length(4); expect($lis.eq(0)).to.contain("{{FirstAPI.isLoading}}"); expect($lis.eq(1)).to.contain("{{FirstAPI.data}}"); - expect($lis.eq(2)).to.contain("{{FirstAPI.run()}}"); + expect($lis.eq(2)).to.contain("{{FirstAPI.responseMeta}}"); + expect($lis.eq(3)).to.contain("{{FirstAPI.run()}}"); }); cy.get(apiwidget.actionlist) .contains(testdata.Get) diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js index 952c0cdaaf..bf7a8c4c50 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js @@ -54,10 +54,11 @@ describe("Entity explorer tests related to copy query", function() { .find(explorer.collapse) .click(); cy.get(apiwidget.propertyList).then(function($lis) { - expect($lis).to.have.length(3); + expect($lis).to.have.length(4); expect($lis.eq(0)).to.contain("{{Query1.isLoading}}"); expect($lis.eq(1)).to.contain("{{Query1.data}}"); - expect($lis.eq(2)).to.contain("{{Query1.run()}}"); + expect($lis.eq(2)).to.contain("{{Query1.responseMeta}}"); + expect($lis.eq(3)).to.contain("{{Query1.run()}}"); }); }); }); @@ -71,16 +72,18 @@ describe("Entity explorer tests related to copy query", function() { .invoke("show") .click({ force: true }); cy.copyEntityToPage(pageid); - cy.SearchEntityandOpen("Query1Copy"); + cy.SearchEntityandOpen("Query1"); cy.runQuery(); - cy.get(`.t--entity.action:contains(Query1Copy)`) + cy.get(`.t--entity.action:contains(Query1)`).should("have.length", 2); + cy.get(`.t--entity.action:contains(Query1)`) .find(explorer.collapse) - .click(); + .click({ multiple: true }); cy.get(apiwidget.propertyList).then(function($lis) { - expect($lis).to.have.length(3); - expect($lis.eq(0)).to.contain("{{Query1Copy.isLoading}}"); - expect($lis.eq(1)).to.contain("{{Query1Copy.data}}"); - expect($lis.eq(2)).to.contain("{{Query1Copy.run()}}"); + expect($lis).to.have.length(4); + expect($lis.eq(0)).to.contain("{{Query1.isLoading}}"); + expect($lis.eq(1)).to.contain("{{Query1.data}}"); + expect($lis.eq(2)).to.contain("{{Query1.responseMeta}}"); + expect($lis.eq(3)).to.contain("{{Query1.run()}}"); }); }); @@ -109,7 +112,7 @@ describe("Entity explorer tests related to copy query", function() { ); }); - cy.SearchEntityandOpen("Query1Copy"); + cy.SearchEntityandOpen("Query1"); cy.deleteQuery(); }); }); diff --git a/app/client/cypress/locators/Debugger.json b/app/client/cypress/locators/Debugger.json new file mode 100644 index 0000000000..f2186aa053 --- /dev/null +++ b/app/client/cypress/locators/Debugger.json @@ -0,0 +1,3 @@ +{ + "debuggerIcon": ".t--debugger" +} \ No newline at end of file diff --git a/app/client/cypress/locators/Widgets.json b/app/client/cypress/locators/Widgets.json index 3e67eecebb..514ff56cc2 100644 --- a/app/client/cypress/locators/Widgets.json +++ b/app/client/cypress/locators/Widgets.json @@ -38,6 +38,8 @@ "textInputval": ".t--draggable-textwidget span.t--widget-name", "textCenterAlign": ".t--property-control-textalign .t--icon-tab-CENTER", "ColumnAction": ".t--property-control-rowbutton button", + "SearchTextChangeAction": ".t--property-control-onsearchtextchanged button", + "tableSearchTextChangeSelected": ".t--property-control-onsearchtextchanged", "videoWidget": ".t--draggable-videowidget", "autoPlay": ".t--property-control-autoplay > .bp3-control > .bp3-control-indicator", "defaultOption": ".t--property-control-defaultoption .CodeMirror-code", diff --git a/app/client/cypress/locators/apiWidgetslocator.json b/app/client/cypress/locators/apiWidgetslocator.json index 2727f72efe..9bdb4100dd 100644 --- a/app/client/cypress/locators/apiWidgetslocator.json +++ b/app/client/cypress/locators/apiWidgetslocator.json @@ -52,5 +52,8 @@ "actionlist": ".action div div", "settings": "li:contains('Settings')", "onPageLoad": "[data-cy=executeOnLoad]", - "renameEntity": ".single-select >div:contains('Edit Name')" + "renameEntity": ".single-select >div:contains('Edit Name')", + "paramsTab": "//li//span[text()='Params']", + "paramKey": "(//div[contains(@class,'t--actionConfiguration.queryParameters[0].key.0')]//textarea)[1]", + "paramValue": "(//div[contains(@class,'t--actionConfiguration.queryParameters[0].value.0')]//textarea)[1]" } diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index dfc0cd4425..5b8e20e933 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -1143,7 +1143,7 @@ Cypress.Commands.add("widgetText", (text, inputcss, innercss) => { cy.get(inputcss) .first() .trigger("mouseover", { force: true }); - cy.get(innercss).should("have.text", text); + cy.contains(innercss, text); }); Cypress.Commands.add("editColName", (text) => { @@ -1870,11 +1870,11 @@ Cypress.Commands.add("testDatasource", () => { Cypress.Commands.add("saveDatasource", () => { cy.get(".t--save-datasource").click(); - cy.wait("@saveDatasource").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); + cy.wait("@saveDatasource") + .then((xhr) => { + cy.log(JSON.stringify(xhr.response.body)); + }) + .should("have.nested.property", "response.body.responseMeta.status", 200); }); Cypress.Commands.add("testSaveDatasource", () => { @@ -2011,8 +2011,8 @@ Cypress.Commands.add("dragAndDropToCanvas", (widgetType, { x, y }) => { .trigger("mousedown", { button: 0 }, { force: true }) .trigger("mousemove", x, y, { force: true }); cy.get(explorer.dropHere) - .click() - .trigger("mouseup", { force: true }); + .click(x, y + 20) + .trigger("mouseup", x, y + 20, { force: true }); }); Cypress.Commands.add("executeDbQuery", (queryName) => { @@ -2035,7 +2035,9 @@ Cypress.Commands.add("openPropertyPane", (widgetType) => { .first() .trigger("mouseover", { force: true }) .wait(500); - cy.get(`${selector}:first-of-type .t--widget-propertypane-toggle`) + cy.get( + `${selector}:first-of-type .t--widget-propertypane-toggle > .t--widget-name`, + ) .first() .click({ force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting @@ -2342,3 +2344,11 @@ Cypress.Commands.add("callApi", (apiname) => { Cypress.Commands.add("assertPageSave", () => { cy.get(commonlocators.saveStatusSuccess); }); + +Cypress.Commands.add("ValidateQueryParams", (param) => { + cy.xpath(apiwidget.paramsTab) + .should("be.visible") + .click({ force: true }); + cy.xpath(apiwidget.paramKey).first().contains(param.key); + cy.xpath(apiwidget.paramValue).first().contains(param.value); +}); diff --git a/app/client/jest.config.js b/app/client/jest.config.js index c88bf5f8ec..f390ccddc2 100644 --- a/app/client/jest.config.js +++ b/app/client/jest.config.js @@ -27,6 +27,9 @@ module.exports = { "test/(.*)": "/test/$1", }, globals: { + "ts-jest": { + isolatedModules: true, + }, APPSMITH_FEATURE_CONFIGS: { sentry: { dsn: parseConfig("__APPSMITH_SENTRY_DSN__"), diff --git a/app/client/package.json b/app/client/package.json index bc24cf83d9..347bbb8a6a 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -40,6 +40,7 @@ "@types/react-table": "^7.0.13", "@types/styled-components": "^5.1.3", "@types/tinycolor2": "^1.4.2", + "@types/zipcelx": "^1.5.0", "@uppy/core": "^1.16.0", "@uppy/dashboard": "^1.16.0", "@uppy/file-input": "^1.4.22", @@ -144,7 +145,8 @@ "typescript": "^4.1.3", "unescape-js": "^1.1.4", "url-search-params-polyfill": "^8.0.0", - "worker-loader": "^3.0.2" + "worker-loader": "^3.0.2", + "zipcelx": "^1.6.2" }, "scripts": { "analyze": "source-map-explorer 'build/static/js/*.js'", @@ -224,6 +226,7 @@ "eslint-plugin-prettier": "^3.1.4", "eslint-plugin-react": "^7.21.3", "eslint-plugin-react-hooks": "^2.3.0", + "eslint-plugin-sort-destructure-keys": "^1.3.5", "factory.ts": "^0.5.1", "jest-canvas-mock": "^2.3.1", "mocha": "^7.1.0", diff --git a/app/client/public/index.html b/app/client/public/index.html index 558f9ccca9..70250975eb 100755 --- a/app/client/public/index.html +++ b/app/client/public/index.html @@ -199,7 +199,7 @@ intercomAppID: APP_ID, mailEnabled: parseConfig("__APPSMITH_MAIL_ENABLED__"), disableTelemetry: DISABLE_TELEMETRY === "" || DISABLE_TELEMETRY, - cloudServicesBaseUrl: parseConfig("__APPSMITH_CLOUD_SERVICES_BASE_URL__") + cloudServicesBaseUrl: parseConfig("__APPSMITH_CLOUD_SERVICES_BASE_URL__") || "https://cs.appsmith.com" }; diff --git a/app/client/src/actions/actionActions.ts b/app/client/src/actions/actionActions.ts index 673f0b1282..3e79882a47 100644 --- a/app/client/src/actions/actionActions.ts +++ b/app/client/src/actions/actionActions.ts @@ -233,6 +233,12 @@ export const updateActionProperty = ( }); }; +export const executePageLoadActionsComplete = () => { + return { + type: ReduxActionTypes.EXECUTE_PAGE_LOAD_ACTIONS_COMPLETE, + }; +}; + export const setActionsToExecuteOnPageLoad = ( actions: Array<{ executeOnLoad: boolean; diff --git a/app/client/src/actions/debuggerActions.ts b/app/client/src/actions/debuggerActions.ts index a0ca54e4a7..a44558e514 100644 --- a/app/client/src/actions/debuggerActions.ts +++ b/app/client/src/actions/debuggerActions.ts @@ -29,3 +29,7 @@ export const updateErrorLog = (payload: Message) => ({ type: ReduxActionTypes.DEBUGGER_UPDATE_ERROR_LOG, payload, }); + +export const resetDebuggerState = () => ({ + type: ReduxActionTypes.RESET_DEBUGGER_STATE, +}); diff --git a/app/client/src/actions/pageActions.tsx b/app/client/src/actions/pageActions.tsx index f454c0349d..3bf4ab40ab 100644 --- a/app/client/src/actions/pageActions.tsx +++ b/app/client/src/actions/pageActions.tsx @@ -203,6 +203,12 @@ export type WidgetDelete = { isShortcut?: boolean; }; +export type MultipleWidgetDeletePayload = { + widgetIds: string[]; + disallowUndo?: boolean; + isShortcut?: boolean; +}; + export type WidgetResize = { widgetId: string; leftColumn: number; diff --git a/app/client/src/actions/widgetActions.tsx b/app/client/src/actions/widgetActions.tsx index 03e1f59548..be7a5674d4 100644 --- a/app/client/src/actions/widgetActions.tsx +++ b/app/client/src/actions/widgetActions.tsx @@ -65,11 +65,27 @@ export const focusWidget = ( export const selectWidget = ( widgetId?: string, -): ReduxAction<{ widgetId?: string }> => ({ + isMultiSelect?: boolean, +): ReduxAction<{ widgetId?: string; isMultiSelect?: boolean }> => ({ type: ReduxActionTypes.SELECT_WIDGET, - payload: { widgetId }, + payload: { widgetId, isMultiSelect }, }); +export const selectAllWidgets = ( + widgetIds?: string[], +): ReduxAction<{ widgetIds?: string[] }> => { + return { + type: ReduxActionTypes.SELECT_MULTIPLE_WIDGETS, + payload: { widgetIds }, + }; +}; + +export const selectAllWidgetsInit = () => { + return { + type: ReduxActionTypes.SELECT_MULTIPLE_WIDGETS_INIT, + }; +}; + export const showModal = (id: string) => { return { type: ReduxActionTypes.SHOW_MODAL, diff --git a/app/client/src/api/ApiUtils.ts b/app/client/src/api/ApiUtils.ts index 2da9b22cf9..c6d0c24656 100644 --- a/app/client/src/api/ApiUtils.ts +++ b/app/client/src/api/ApiUtils.ts @@ -102,7 +102,7 @@ export const apiFailureResponseInterceptor = (error: any) => { // Redirect to login and set a redirect url. history.replace({ pathname: AUTH_LOGIN_URL, - search: `redirectUrl=${currentUrl}`, + search: `redirectUrl=${encodeURIComponent(currentUrl)}`, }); return Promise.reject({ code: ERROR_CODES.REQUEST_NOT_AUTHORISED, diff --git a/app/client/src/api/ImportApi.ts b/app/client/src/api/ImportApi.ts index 310d4c5515..eac6e0ad76 100644 --- a/app/client/src/api/ImportApi.ts +++ b/app/client/src/api/ImportApi.ts @@ -14,7 +14,7 @@ class CurlImportApi extends Api { static curlImportURL = `v1/import`; static curlImport(request: CurlImportRequest): AxiosPromise { - const { pageId, name, curl, organizationId } = request; + const { curl, name, organizationId, pageId } = request; return Api.post(CurlImportApi.curlImportURL, curl, { type: "CURL", pageId, diff --git a/app/client/src/assets/icons/control/download-data-icon.svg b/app/client/src/assets/icons/control/download-data-icon.svg new file mode 100644 index 0000000000..2045fa1fb3 --- /dev/null +++ b/app/client/src/assets/icons/control/download-data-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/client/src/assets/icons/control/download-table.svg b/app/client/src/assets/icons/control/download-table.svg deleted file mode 100755 index 129ee6b5ad..0000000000 --- a/app/client/src/assets/icons/control/download-table.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/client/src/assets/icons/control/filter-icon.svg b/app/client/src/assets/icons/control/filter-icon.svg old mode 100755 new mode 100644 index 1723d3efe8..e5a827016e --- a/app/client/src/assets/icons/control/filter-icon.svg +++ b/app/client/src/assets/icons/control/filter-icon.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/app/client/src/comments/AppComments/AppCommentsHeader.tsx b/app/client/src/comments/AppComments/AppCommentsHeader.tsx index 5fb37c55a6..8a2e1a7f39 100644 --- a/app/client/src/comments/AppComments/AppCommentsHeader.tsx +++ b/app/client/src/comments/AppComments/AppCommentsHeader.tsx @@ -26,7 +26,7 @@ type Props = { }; const AppCommentsHeader = withTheme( - ({ onClose, isOpen, setIsOpen, theme }: Props) => { + ({ isOpen, onClose, setIsOpen, theme }: Props) => { const showCommentThreads = useCallback(() => { if (!isOpen) setIsOpen(true); }, [isOpen]); diff --git a/app/client/src/comments/CommentCard/CommentCard.tsx b/app/client/src/comments/CommentCard/CommentCard.tsx index ed09cb9ccd..05374ec28c 100644 --- a/app/client/src/comments/CommentCard/CommentCard.tsx +++ b/app/client/src/comments/CommentCard/CommentCard.tsx @@ -91,10 +91,10 @@ const useSelectCommentUsingQuery = (commentId: string) => { function CommentCard({ comment, - isParentComment, - toggleResolved, - resolved, commentThreadId, + isParentComment, + resolved, + toggleResolved, }: { comment: Comment; isParentComment?: boolean; diff --git a/app/client/src/comments/CommentCard/CommentContextMenu.tsx b/app/client/src/comments/CommentCard/CommentContextMenu.tsx index bef783b01c..e9b525a5c4 100644 --- a/app/client/src/comments/CommentCard/CommentContextMenu.tsx +++ b/app/client/src/comments/CommentCard/CommentContextMenu.tsx @@ -58,7 +58,7 @@ type Props = { deleteComment: typeof noop; }; -function CommentContextMenu({ pin, copyCommentLink, deleteComment }: Props) { +function CommentContextMenu({ copyCommentLink, deleteComment, pin }: Props) { const [isOpen, setIsOpen] = useState(false); const options = useMemo( diff --git a/app/client/src/comments/inlineComments/InlineCommentPin.tsx b/app/client/src/comments/inlineComments/InlineCommentPin.tsx index 6a265d8a40..65e1a367cc 100644 --- a/app/client/src/comments/inlineComments/InlineCommentPin.tsx +++ b/app/client/src/comments/inlineComments/InlineCommentPin.tsx @@ -47,7 +47,7 @@ const useSelectCommentThreadUsingQuery = (commentThreadId: string) => { const InlineCommentPin = withTheme( ({ commentThreadId, theme }: { commentThreadId: string; theme: Theme }) => { const commentThread = useSelector(commentThreadsSelector(commentThreadId)); - const { top, left } = get(commentThread, "position", { + const { left, top } = get(commentThread, "position", { top: 0, left: 0, }); diff --git a/app/client/src/comments/inlineComments/UnpublishedCommentThread.tsx b/app/client/src/comments/inlineComments/UnpublishedCommentThread.tsx index 5861dbd56c..df54754a7f 100644 --- a/app/client/src/comments/inlineComments/UnpublishedCommentThread.tsx +++ b/app/client/src/comments/inlineComments/UnpublishedCommentThread.tsx @@ -27,13 +27,13 @@ const CommentTriggerContainer = styled.div<{ top: number; left: number }>` // TODO look into drying this up using comment thread component const UnpublishedCommentThread = withTheme( ({ - theme, commentThread, + theme, }: { commentThread: CommentThread; theme: Theme; }) => { - const { top, left } = get(commentThread, "position", { + const { left, top } = get(commentThread, "position", { top: 0, left: 0, }); diff --git a/app/client/src/comments/tests/Comments.test.tsx b/app/client/src/comments/tests/Comments.test.tsx index 07ad0806b6..dd3cb0fb05 100644 --- a/app/client/src/comments/tests/Comments.test.tsx +++ b/app/client/src/comments/tests/Comments.test.tsx @@ -49,7 +49,7 @@ describe("Comment threads", () => { }); it("can be created", async (done) => { - const { getByDataCy, getAllByDataCy, findByDataCy, findByText } = render( + const { findByDataCy, findByText, getAllByDataCy, getByDataCy } = render(
, @@ -87,7 +87,7 @@ describe("Comment threads", () => { done(); }); it("accept replies", async (done) => { - const { getByDataCy, findByText, findByDataCy } = render( + const { findByDataCy, findByText, getByDataCy } = render(
, diff --git a/app/client/src/components/ads/Button.tsx b/app/client/src/components/ads/Button.tsx index ea97229575..b380b1f70f 100644 --- a/app/client/src/components/ads/Button.tsx +++ b/app/client/src/components/ads/Button.tsx @@ -380,7 +380,7 @@ function TextLoadingState({ text }: { text?: string }) { return {text}; } -function IconLoadingState({ size, icon }: { size?: Size; icon?: IconName }) { +function IconLoadingState({ icon, size }: { size?: Size; icon?: IconName }) { return ; } diff --git a/app/client/src/components/ads/DraggableList.tsx b/app/client/src/components/ads/DraggableList.tsx index 79a03ed66d..a14d9bc176 100644 --- a/app/client/src/components/ads/DraggableList.tsx +++ b/app/client/src/components/ads/DraggableList.tsx @@ -32,7 +32,7 @@ const updateSpringStyles = ( // Styles when items are dragged/idle const dragIdleSpringStyles = ( order: Array, - { down, originalIndex, curIndex, y, itemHeight }: SpringStyleProps, + { curIndex, down, itemHeight, originalIndex, y }: SpringStyleProps, ) => (index: number) => { // picked/dragged item style if (down && index === originalIndex) { @@ -59,7 +59,7 @@ const DraggableListWrapper = styled.div` } `; -function DraggableList({ items, ItemRenderer, onUpdate, itemHeight }: any) { +function DraggableList({ itemHeight, ItemRenderer, items, onUpdate }: any) { // order of items in the list const order = useRef(items.map((_: any, index: any) => index)); @@ -119,7 +119,7 @@ function DraggableList({ items, ItemRenderer, onUpdate, itemHeight }: any) { }} style={{ height: items.length * itemHeight }} > - {springs.map(({ zIndex, y, scale }, i) => ( + {springs.map(({ scale, y, zIndex }, i) => ( + ItemRenderer={({ index, item }: any) => renderComponent({ deleteOption, updateOption, diff --git a/app/client/src/components/ads/EditableText.tsx b/app/client/src/components/ads/EditableText.tsx index bca0528165..9fc1374617 100644 --- a/app/client/src/components/ads/EditableText.tsx +++ b/app/client/src/components/ads/EditableText.tsx @@ -154,11 +154,11 @@ const IconWrapper = styled.div` export function EditableText(props: EditableTextProps) { const { - onBlur, - onTextChanged, - isInvalid: inputValidation, defaultValue, isEditingDefault, + isInvalid: inputValidation, + onBlur, + onTextChanged, valueTransform, } = props; const [isEditing, setIsEditing] = useState(!!isEditingDefault); diff --git a/app/client/src/components/ads/EmojiPicker.tsx b/app/client/src/components/ads/EmojiPicker.tsx index 7829e7ec0e..719abcd789 100644 --- a/app/client/src/components/ads/EmojiPicker.tsx +++ b/app/client/src/components/ads/EmojiPicker.tsx @@ -8,8 +8,8 @@ import { Theme } from "constants/DefaultTheme"; // TODO remove: (trigger tests) const EmojiPicker = withTheme( ({ - theme, onSelectEmoji, + theme, }: { theme: Theme; onSelectEmoji: (e: React.MouseEvent, emojiObject: IEmojiData) => void; diff --git a/app/client/src/components/ads/MentionsInput.tsx b/app/client/src/components/ads/MentionsInput.tsx index 94525cb16f..1c2b8c2031 100644 --- a/app/client/src/components/ads/MentionsInput.tsx +++ b/app/client/src/components/ads/MentionsInput.tsx @@ -25,13 +25,13 @@ type Props = { }; function MentionsInput({ - onSubmit, - suggestions, - onSearchSuggestions, - editorState, - setEditorState, autoFocus, + editorState, + onSearchSuggestions, + onSubmit, placeholder, + setEditorState, + suggestions, }: Props) { const ref = useRef(null); const [open, setOpen] = useState(false); diff --git a/app/client/src/components/ads/ScrollIndicator.tsx b/app/client/src/components/ads/ScrollIndicator.tsx index c9219337b0..7ffc3fafef 100644 --- a/app/client/src/components/ads/ScrollIndicator.tsx +++ b/app/client/src/components/ads/ScrollIndicator.tsx @@ -53,11 +53,11 @@ interface Props { mode?: "DARK" | "LIGHT"; } function ScrollIndicator({ - containerRef, - top, - bottom, - right, alwaysShowScrollbar, + bottom, + containerRef, + right, + top, }: Props) { const [{ thumbPosition }, setThumbPosition] = useSpring<{ thumbPosition: number; diff --git a/app/client/src/components/ads/Table.tsx b/app/client/src/components/ads/Table.tsx index fdfd1501be..2c1f3d8e5c 100644 --- a/app/client/src/components/ads/Table.tsx +++ b/app/client/src/components/ads/Table.tsx @@ -93,14 +93,14 @@ interface TableProps { } function Table(props: TableProps) { - const { data, columns } = props; + const { columns, data } = props; const { - getTableProps, getTableBodyProps, + getTableProps, headerGroups, - rows, prepareRow, + rows, } = useTable({ columns, data }, useSortBy); return ( diff --git a/app/client/src/components/ads/TextInput.tsx b/app/client/src/components/ads/TextInput.tsx index 633528236b..4fc64505d0 100644 --- a/app/client/src/components/ads/TextInput.tsx +++ b/app/client/src/components/ads/TextInput.tsx @@ -84,7 +84,7 @@ const boxStyles = ( const StyledInput = styled((props) => { // we are removing non input related props before passing them in the components // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { inputStyle, inputRef, dataType, theme, ...inputProps } = props; + const { dataType, inputRef, inputStyle, theme, ...inputProps } = props; return props.asyncControl ? ( { chartInstance = new FusionCharts(); getChartType = () => { - const { chartType, allowHorizontalScroll, chartData } = this.props; + const { allowHorizontalScroll, chartData, chartType } = this.props; const dataLength = Object.keys(chartData).length; const isMSChart = dataLength > 1; switch (chartType) { diff --git a/app/client/src/components/designSystems/appsmith/CreatableDropdown.tsx b/app/client/src/components/designSystems/appsmith/CreatableDropdown.tsx index d6465d62a9..7220d1656c 100644 --- a/app/client/src/components/designSystems/appsmith/CreatableDropdown.tsx +++ b/app/client/src/components/designSystems/appsmith/CreatableDropdown.tsx @@ -77,14 +77,14 @@ const selectStyles = { class CreatableDropdown extends React.Component { render() { const { - placeholder, - options, - isLoading, - input, - noOptionsMessage, components, + input, inputValue, + isLoading, + noOptionsMessage, onInputChange, + options, + placeholder, } = this.props; const optionalProps: Partial = {}; if (noOptionsMessage) optionalProps.noOptionsMessage = noOptionsMessage; diff --git a/app/client/src/components/designSystems/appsmith/DraggableListComponent.tsx b/app/client/src/components/designSystems/appsmith/DraggableListComponent.tsx index ca1fb37219..967ef2a981 100644 --- a/app/client/src/components/designSystems/appsmith/DraggableListComponent.tsx +++ b/app/client/src/components/designSystems/appsmith/DraggableListComponent.tsx @@ -81,16 +81,16 @@ export class DroppableComponent extends React.Component< render() { const { - renderComponent, deleteOption, - updateOption, - toggleVisibility, onEdit, + renderComponent, + toggleVisibility, + updateOption, } = this.props; return ( - {({ innerRef, droppableProps, placeholder }) => ( + {({ droppableProps, innerRef, placeholder }) => ( } {...droppableProps} @@ -103,7 +103,7 @@ export class DroppableComponent extends React.Component< index={index} key={item.id} > - {({ innerRef, draggableProps, dragHandleProps }) => ( + {({ draggableProps, dragHandleProps, innerRef }) => ( } {...draggableProps} diff --git a/app/client/src/components/designSystems/appsmith/Dropdown.tsx b/app/client/src/components/designSystems/appsmith/Dropdown.tsx index 4a4dc958c0..646fad90e5 100644 --- a/app/client/src/components/designSystems/appsmith/Dropdown.tsx +++ b/app/client/src/components/designSystems/appsmith/Dropdown.tsx @@ -54,7 +54,7 @@ const selectStyles = { }; export function BaseDropdown(props: DropdownProps) { - const { input, customSelectStyles } = props; + const { customSelectStyles, input } = props; return (