From 453fa0f1299f5e1678745cf051c2231d94413471 Mon Sep 17 00:00:00 2001 From: Pavan134 Date: Fri, 23 Aug 2024 11:38:52 +0530 Subject: [PATCH 1/8] fix: filteredTableData property in autocomplete suggestions --- .../check_filterTableData_auto_spec.js | 77 +++++++++++++++++++ .../widgets/TableWidgetV2/widget/index.tsx | 1 + 2 files changed, 78 insertions(+) create mode 100644 app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js new file mode 100644 index 000000000000..15c8dc520bdb --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js @@ -0,0 +1,77 @@ +import * as _ from "../../../../../support/Objects/ObjectsCore"; +const dynamicInputLocators = require("../../../../../locators/DynamicInput.json"); + +const tableData = `[ + { + "id": 1, + "date": "2023-06-01T12:00:00-06:30", + "email": "test1@gmail.com", + "userName": "test1", + "department": "Marketing" + }, + { + "id": 2, + "date": "2023-06-02T12:00:00-06:30", + "email": "test2@gmail.com", + "userName": "test2", + "department": "Marketing" + }, + { + "id": 3, + "date": "2023-06-03T12:00:00-06:30", + "email": "test3@gmail.com", + "userName": "test3", + "department": "HR" + }, + { + "id": 4, + "date": "2023-06-04T12:00:00-06:30", + "email": "test4@gmail.com", + "userName": "test4", + "department": "HR" + }, + { + "id": 5, + "date": "2023-06-05T12:00:00-06:30", + "email": "test5@gmail.com", + "userName": "test5", + "department": "IT" + }, + { + "id": 6, + "email": "test6@gmail.com", + "userName": "test6", + "date": "2023-06-06T12:00:00-06:30", + "department": "IT" + }, + { + "id": 7, + "date": "2023-06-07T12:00:00-06:30", + "email": "test7@gmail.com", + "userName": "test7", + "department": "Customer Service" + } + ]`; +describe( + "filteredTableData property in autocomplete suggestions of table widget", + { tags: ["@tag.Widget", "@tag.Table"] }, + () => { + it("check 'filteredTableData' property in autocomplete suggestions",()=>{ + _.agHelper.AddDsl("tableV2NewDsl"); + cy.openPropertyPane("tablewidgetv2"); + _.propPane.EnterJSContext("Table data", tableData); + _.propPane.TogglePropertyState("Allow filtering", "On"); + + _.table.OpenNFilterTable("department", "contains", "Marketing"); + _.table.CloseFilter(); + + cy.openPropertyPane("textwidget"); + cy.testCodeMirror("/") + cy.get(`${dynamicInputLocators.hints} li`) + .eq(0) + .should("have.text", "Add a binding").click(); + _.propPane.TypeTextIntoField("Text", "Table1.",false); + cy.get(`${dynamicInputLocators.hints} li`).contains("filteredTableData").should('be.visible').click(); + + }) +}); \ No newline at end of file diff --git a/app/client/src/widgets/TableWidgetV2/widget/index.tsx b/app/client/src/widgets/TableWidgetV2/widget/index.tsx index 09f45d48be86..02ea53a1b9c3 100644 --- a/app/client/src/widgets/TableWidgetV2/widget/index.tsx +++ b/app/client/src/widgets/TableWidgetV2/widget/index.tsx @@ -474,6 +474,7 @@ class TableWidgetV2 extends BaseWidget { isAddRowInProgress: "bool", previousPageVisited: generateTypeDef(widget.previousPageVisited), nextPageVisited: generateTypeDef(widget.nextPageButtonClicked), + filteredTableData: generateTypeDef(widget.filteredTableData) }; if (this.getFeatureFlag(ALLOW_TABLE_WIDGET_SERVER_SIDE_FILTERING)) { From 2d39d2797e5b99dc70e6f9cc56efa710bdb308ad Mon Sep 17 00:00:00 2001 From: Pavan134 Date: Tue, 27 Aug 2024 22:43:14 +0530 Subject: [PATCH 2/8] feat: added unit test cases --- .../widget/checkFilteredDataProperty.test.ts | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts diff --git a/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts b/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts new file mode 100644 index 000000000000..f2e59a9dc8ff --- /dev/null +++ b/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts @@ -0,0 +1,200 @@ +import { dataTreeTypeDefCreator } from "utils/autocomplete/dataTreeTypeDefCreator"; +import type { + DataTreeEntityObject, + WidgetEntityConfig, +} from "ee/entities/DataTree/types"; +import { + ENTITY_TYPE, + EvaluationSubstitutionType, +} from "entities/DataTree/dataTreeFactory"; + +import TableWidget from "widgets/TableWidgetV2"; +import { registerWidgets } from "WidgetProvider/factory/registrationHelper"; +import type { TableWidgetProps } from "../constants"; +import type { batchUpdateWidgetMetaPropertyType, DebouncedExecuteActionPayload } from "widgets/MetaHOC"; +describe("Bug: check filteredTableData property in autocomplete definitions of table widget", () => { + it("check filteredTableData property", () => { + registerWidgets([TableWidget]); + const tableWidgetProps:TableWidgetProps={ + pristine: false, + label: "data", + searchText: "", + type: "TABLE_WIDGET_V2", + defaultSearchText: "", + tableData: [ + { + "id": 1, + "name": "pavan" + }, + { + "id": 2, + "name": "anil" + }, + { + "id": 3, + "name": "radha" + } + ], + pageSize: 0, + onSearchTextChanged: "", + onSort: "", + selectedRowIndices: [], + frozenColumnIndices: { + "id":1 + }, + primaryColumns: { + id:{ + "allowCellWrapping": false, + "allowSameOptionsInNewRow": true, + "index": 0, + "width": 150, + "originalId": "id", + "id": "id", + "alias": "id", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "number", + "textSize": "0.875rem", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellEditable": false, + "isEditable": false, + "isCellVisible": true, + "isDerived": false, + "label": "id", + "isSaveVisible": true, + "isDiscardVisible": true, + "validation": {}, + "currencyCode": "USD", + "decimals": 0, + "thousandSeparator": true, + "notation": "standard", + "fontStyle": "", + "cellBackground": "", + "textColor": "", + computedValue: "" + } + }, + derivedColumns: { + id:{ + id: "", + originalId: "", + columnType: "", + isVisible: false, + index: 0, + isDerived: false, + computedValue: "", + alias: "", + allowCellWrapping: false, + width: 0, + isCellEditable: false, + isEditable: false + } + }, + sortOrder: { + column: "", + order: null + }, + transientTableData: {}, + primaryColor: "", + borderRadius: "", + isEditableCellsValid: {}, + isAddRowInProgress: false, + newRow: {}, + firstEditableColumnIdByOrder: "", + enableServerSideFiltering: false, + onTableFilterUpdate: "", + hoverValue: "", + onHoverTable: "", + widgetId: "", + widgetName: "", + renderMode: "CANVAS", + version: 0, + parentColumnSpace: 0, + parentRowSpace: 0, + leftColumn: 0, + rightColumn: 0, + topRow: 0, + bottomRow: 0, + isLoading: false, + commitBatchMetaUpdates: function (): void { + throw new Error("Function not implemented."); + }, + pushBatchMetaUpdates: function (propertyName: string | batchUpdateWidgetMetaPropertyType, propertyValue?: unknown, actionExecution?: DebouncedExecuteActionPayload | undefined): void { + throw new Error("Function not implemented."); + }, + updateWidgetMetaProperty: function (propertyName: string, propertyValue: unknown, actionExecution?: DebouncedExecuteActionPayload | undefined): void { + throw new Error("Function not implemented."); + }, + allowAddNewRow: false, + onAddNewRowSave: "", + onAddNewRowDiscard: "", + defaultNewRow: {}, + "filteredTableData": [ + { + "id": 1, + "name": "pavan", + "__originalIndex__": 0, + "__primaryKey__": 1, + "EditActions1": "" + }, + { + "id": 2, + "name": "anil", + "__originalIndex__": 1, + "__primaryKey__": 2, + "EditActions1": "" + }, + { + "id": 3, + "name": "radha", + "__originalIndex__": 2, + "__primaryKey__": 3, + "EditActions1": "" + } + ], + } + const dataTreeEntity: DataTreeEntityObject = { + ENTITY_TYPE: ENTITY_TYPE.WIDGET, + meta: {}, + ...tableWidgetProps + + }; + const dataTreeEntityConfig: WidgetEntityConfig = { + bindingPaths: { + defaultText: EvaluationSubstitutionType.TEMPLATE, + }, + reactivePaths: { + defaultText: EvaluationSubstitutionType.TEMPLATE, + }, + triggerPaths: { + onTextChange: true, + }, + validationPaths: {}, + logBlackList: {}, + propertyOverrideDependency: {}, + overridingPropertyPaths: {}, + privateWidgets: {}, + defaultMetaProps: [], + widgetId: "yolo", + widgetName: "Table1", + type: "TABLE_WIDGET_V2", + ENTITY_TYPE: ENTITY_TYPE.WIDGET, + }; + const { def, entityInfo } = dataTreeTypeDefCreator( + { + Table1: dataTreeEntity, + }, + {}, + dataTreeEntityConfig, + ); + + expect(def).toHaveProperty("Table1.filteredTableData"); + expect(entityInfo.get("Table1")).toStrictEqual({ + type: ENTITY_TYPE.WIDGET, + subType: "TABLE_WIDGET_V2", + }); + }); +}); \ No newline at end of file From 73ad852a35bdd75d12b9dee362bf32da6ba997bd Mon Sep 17 00:00:00 2001 From: Pavan134 Date: Tue, 27 Aug 2024 23:13:31 +0530 Subject: [PATCH 3/8] feat: changed properties of dataTreeEntity in test file --- .../widget/checkFilteredDataProperty.test.ts | 183 ++++-------------- 1 file changed, 40 insertions(+), 143 deletions(-) diff --git a/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts b/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts index f2e59a9dc8ff..d87883fa589f 100644 --- a/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts +++ b/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts @@ -1,6 +1,7 @@ import { dataTreeTypeDefCreator } from "utils/autocomplete/dataTreeTypeDefCreator"; import type { DataTreeEntityObject, + WidgetEntity, WidgetEntityConfig, } from "ee/entities/DataTree/types"; import { @@ -15,152 +16,49 @@ import type { batchUpdateWidgetMetaPropertyType, DebouncedExecuteActionPayload } describe("Bug: check filteredTableData property in autocomplete definitions of table widget", () => { it("check filteredTableData property", () => { registerWidgets([TableWidget]); - const tableWidgetProps:TableWidgetProps={ - pristine: false, - label: "data", - searchText: "", - type: "TABLE_WIDGET_V2", - defaultSearchText: "", - tableData: [ - { - "id": 1, - "name": "pavan" - }, - { - "id": 2, - "name": "anil" - }, - { - "id": 3, - "name": "radha" - } + const dataTreeEntity: WidgetEntity = { + meta: {}, + ENTITY_TYPE: ENTITY_TYPE.WIDGET, + widgetId: "123", + type: "TABLE_WIDGET_V2", + widgetName: "Table1", + renderMode: "CANVAS", + version: 1, + parentColumnSpace: 1, + parentRowSpace: 2, + leftColumn: 2, + rightColumn: 3, + topRow: 1, + bottomRow: 2, + isLoading: false, + tableData: [ + { id: 1, name: "pavan" }, + { id: 2, name: "anil" }, + { id: 3, name: "radha" }, ], - pageSize: 0, - onSearchTextChanged: "", - onSort: "", - selectedRowIndices: [], - frozenColumnIndices: { - "id":1 - }, - primaryColumns: { - id:{ - "allowCellWrapping": false, - "allowSameOptionsInNewRow": true, - "index": 0, - "width": 150, - "originalId": "id", - "id": "id", - "alias": "id", - "horizontalAlignment": "LEFT", - "verticalAlignment": "CENTER", - "columnType": "number", - "textSize": "0.875rem", - "enableFilter": true, - "enableSort": true, - "isVisible": true, - "isDisabled": false, - "isCellEditable": false, - "isEditable": false, - "isCellVisible": true, - "isDerived": false, - "label": "id", - "isSaveVisible": true, - "isDiscardVisible": true, - "validation": {}, - "currencyCode": "USD", - "decimals": 0, - "thousandSeparator": true, - "notation": "standard", - "fontStyle": "", - "cellBackground": "", - "textColor": "", - computedValue: "" - } + filteredTableData: [ + { + id: 1, + name: "pavan", + __originalIndex__: 0, + __primaryKey__: 1, + EditActions1: "", }, - derivedColumns: { - id:{ - id: "", - originalId: "", - columnType: "", - isVisible: false, - index: 0, - isDerived: false, - computedValue: "", - alias: "", - allowCellWrapping: false, - width: 0, - isCellEditable: false, - isEditable: false - } + { + id: 2, + name: "anil", + __originalIndex__: 1, + __primaryKey__: 2, + EditActions1: "", }, - sortOrder: { - column: "", - order: null + { + id: 3, + name: "radha", + __originalIndex__: 2, + __primaryKey__: 3, + EditActions1: "", }, - transientTableData: {}, - primaryColor: "", - borderRadius: "", - isEditableCellsValid: {}, - isAddRowInProgress: false, - newRow: {}, - firstEditableColumnIdByOrder: "", - enableServerSideFiltering: false, - onTableFilterUpdate: "", - hoverValue: "", - onHoverTable: "", - widgetId: "", - widgetName: "", - renderMode: "CANVAS", - version: 0, - parentColumnSpace: 0, - parentRowSpace: 0, - leftColumn: 0, - rightColumn: 0, - topRow: 0, - bottomRow: 0, - isLoading: false, - commitBatchMetaUpdates: function (): void { - throw new Error("Function not implemented."); - }, - pushBatchMetaUpdates: function (propertyName: string | batchUpdateWidgetMetaPropertyType, propertyValue?: unknown, actionExecution?: DebouncedExecuteActionPayload | undefined): void { - throw new Error("Function not implemented."); - }, - updateWidgetMetaProperty: function (propertyName: string, propertyValue: unknown, actionExecution?: DebouncedExecuteActionPayload | undefined): void { - throw new Error("Function not implemented."); - }, - allowAddNewRow: false, - onAddNewRowSave: "", - onAddNewRowDiscard: "", - defaultNewRow: {}, - "filteredTableData": [ - { - "id": 1, - "name": "pavan", - "__originalIndex__": 0, - "__primaryKey__": 1, - "EditActions1": "" - }, - { - "id": 2, - "name": "anil", - "__originalIndex__": 1, - "__primaryKey__": 2, - "EditActions1": "" - }, - { - "id": 3, - "name": "radha", - "__originalIndex__": 2, - "__primaryKey__": 3, - "EditActions1": "" - } - ], - } - const dataTreeEntity: DataTreeEntityObject = { - ENTITY_TYPE: ENTITY_TYPE.WIDGET, - meta: {}, - ...tableWidgetProps - + ], }; const dataTreeEntityConfig: WidgetEntityConfig = { bindingPaths: { @@ -190,7 +88,6 @@ describe("Bug: check filteredTableData property in autocomplete definitions of t {}, dataTreeEntityConfig, ); - expect(def).toHaveProperty("Table1.filteredTableData"); expect(entityInfo.get("Table1")).toStrictEqual({ type: ENTITY_TYPE.WIDGET, From 05ed6c9d1f034c643dc7f4bf7564d73cc7a86d60 Mon Sep 17 00:00:00 2001 From: Pavan134 Date: Wed, 11 Sep 2024 15:52:03 +0530 Subject: [PATCH 4/8] fix: formatted using prettier --- .../check_filterTableData_auto_spec.js | 44 ++--- .../widget/checkFilteredDataProperty.test.ts | 155 +++++++++--------- .../widgets/TableWidgetV2/widget/index.tsx | 2 +- 3 files changed, 101 insertions(+), 100 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js index 15c8dc520bdb..a8ea2ce65758 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js @@ -53,25 +53,29 @@ const tableData = `[ } ]`; describe( - "filteredTableData property in autocomplete suggestions of table widget", - { tags: ["@tag.Widget", "@tag.Table"] }, - () => { - it("check 'filteredTableData' property in autocomplete suggestions",()=>{ - _.agHelper.AddDsl("tableV2NewDsl"); - cy.openPropertyPane("tablewidgetv2"); - _.propPane.EnterJSContext("Table data", tableData); - _.propPane.TogglePropertyState("Allow filtering", "On"); + "filteredTableData property in autocomplete suggestions of table widget", + { tags: ["@tag.Widget", "@tag.Table"] }, + () => { + it("check 'filteredTableData' property in autocomplete suggestions", () => { + _.agHelper.AddDsl("tableV2NewDsl"); + cy.openPropertyPane("tablewidgetv2"); + _.propPane.EnterJSContext("Table data", tableData); + _.propPane.TogglePropertyState("Allow filtering", "On"); - _.table.OpenNFilterTable("department", "contains", "Marketing"); - _.table.CloseFilter(); + _.table.OpenNFilterTable("department", "contains", "Marketing"); + _.table.CloseFilter(); - cy.openPropertyPane("textwidget"); - cy.testCodeMirror("/") - cy.get(`${dynamicInputLocators.hints} li`) - .eq(0) - .should("have.text", "Add a binding").click(); - _.propPane.TypeTextIntoField("Text", "Table1.",false); - cy.get(`${dynamicInputLocators.hints} li`).contains("filteredTableData").should('be.visible').click(); - - }) -}); \ No newline at end of file + cy.openPropertyPane("textwidget"); + cy.testCodeMirror("/"); + cy.get(`${dynamicInputLocators.hints} li`) + .eq(0) + .should("have.text", "Add a binding") + .click(); + _.propPane.TypeTextIntoField("Text", "Table1.", false); + cy.get(`${dynamicInputLocators.hints} li`) + .contains("filteredTableData") + .should("be.visible") + .click(); + }); + }, +); diff --git a/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts b/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts index d87883fa589f..7b23764a4b3a 100644 --- a/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts +++ b/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts @@ -1,6 +1,5 @@ import { dataTreeTypeDefCreator } from "utils/autocomplete/dataTreeTypeDefCreator"; import type { - DataTreeEntityObject, WidgetEntity, WidgetEntityConfig, } from "ee/entities/DataTree/types"; @@ -11,87 +10,85 @@ import { import TableWidget from "widgets/TableWidgetV2"; import { registerWidgets } from "WidgetProvider/factory/registrationHelper"; -import type { TableWidgetProps } from "../constants"; -import type { batchUpdateWidgetMetaPropertyType, DebouncedExecuteActionPayload } from "widgets/MetaHOC"; describe("Bug: check filteredTableData property in autocomplete definitions of table widget", () => { - it("check filteredTableData property", () => { - registerWidgets([TableWidget]); - const dataTreeEntity: WidgetEntity = { - meta: {}, - ENTITY_TYPE: ENTITY_TYPE.WIDGET, - widgetId: "123", - type: "TABLE_WIDGET_V2", - widgetName: "Table1", - renderMode: "CANVAS", - version: 1, - parentColumnSpace: 1, - parentRowSpace: 2, - leftColumn: 2, - rightColumn: 3, - topRow: 1, - bottomRow: 2, - isLoading: false, - tableData: [ - { id: 1, name: "pavan" }, - { id: 2, name: "anil" }, - { id: 3, name: "radha" }, - ], - filteredTableData: [ - { - id: 1, - name: "pavan", - __originalIndex__: 0, - __primaryKey__: 1, - EditActions1: "", - }, - { - id: 2, - name: "anil", - __originalIndex__: 1, - __primaryKey__: 2, - EditActions1: "", - }, - { - id: 3, - name: "radha", - __originalIndex__: 2, - __primaryKey__: 3, - EditActions1: "", - }, - ], - }; - const dataTreeEntityConfig: WidgetEntityConfig = { - bindingPaths: { - defaultText: EvaluationSubstitutionType.TEMPLATE, - }, - reactivePaths: { - defaultText: EvaluationSubstitutionType.TEMPLATE, + it("check filteredTableData property", () => { + registerWidgets([TableWidget]); + const dataTreeEntity: WidgetEntity = { + meta: {}, + ENTITY_TYPE: ENTITY_TYPE.WIDGET, + widgetId: "123", + type: "TABLE_WIDGET_V2", + widgetName: "Table1", + renderMode: "CANVAS", + version: 1, + parentColumnSpace: 1, + parentRowSpace: 2, + leftColumn: 2, + rightColumn: 3, + topRow: 1, + bottomRow: 2, + isLoading: false, + tableData: [ + { id: 1, name: "pavan" }, + { id: 2, name: "anil" }, + { id: 3, name: "radha" }, + ], + filteredTableData: [ + { + id: 1, + name: "pavan", + __originalIndex__: 0, + __primaryKey__: 1, + EditActions1: "", }, - triggerPaths: { - onTextChange: true, + { + id: 2, + name: "anil", + __originalIndex__: 1, + __primaryKey__: 2, + EditActions1: "", }, - validationPaths: {}, - logBlackList: {}, - propertyOverrideDependency: {}, - overridingPropertyPaths: {}, - privateWidgets: {}, - defaultMetaProps: [], - widgetId: "yolo", - widgetName: "Table1", - type: "TABLE_WIDGET_V2", - ENTITY_TYPE: ENTITY_TYPE.WIDGET, - }; - const { def, entityInfo } = dataTreeTypeDefCreator( { - Table1: dataTreeEntity, + id: 3, + name: "radha", + __originalIndex__: 2, + __primaryKey__: 3, + EditActions1: "", }, - {}, - dataTreeEntityConfig, - ); - expect(def).toHaveProperty("Table1.filteredTableData"); - expect(entityInfo.get("Table1")).toStrictEqual({ - type: ENTITY_TYPE.WIDGET, - subType: "TABLE_WIDGET_V2", - }); + ], + }; + const dataTreeEntityConfig: WidgetEntityConfig = { + bindingPaths: { + defaultText: EvaluationSubstitutionType.TEMPLATE, + }, + reactivePaths: { + defaultText: EvaluationSubstitutionType.TEMPLATE, + }, + triggerPaths: { + onTextChange: true, + }, + validationPaths: {}, + logBlackList: {}, + propertyOverrideDependency: {}, + overridingPropertyPaths: {}, + privateWidgets: {}, + defaultMetaProps: [], + widgetId: "yolo", + widgetName: "Table1", + type: "TABLE_WIDGET_V2", + ENTITY_TYPE: ENTITY_TYPE.WIDGET, + }; + const { def, entityInfo } = dataTreeTypeDefCreator( + { + Table1: dataTreeEntity, + }, + {}, + dataTreeEntityConfig, + ); + expect(def).toHaveProperty("Table1.filteredTableData"); + expect(entityInfo.get("Table1")).toStrictEqual({ + type: ENTITY_TYPE.WIDGET, + subType: "TABLE_WIDGET_V2", }); -}); \ No newline at end of file + }); +}); diff --git a/app/client/src/widgets/TableWidgetV2/widget/index.tsx b/app/client/src/widgets/TableWidgetV2/widget/index.tsx index 02ea53a1b9c3..94e017b9c07c 100644 --- a/app/client/src/widgets/TableWidgetV2/widget/index.tsx +++ b/app/client/src/widgets/TableWidgetV2/widget/index.tsx @@ -474,7 +474,7 @@ class TableWidgetV2 extends BaseWidget { isAddRowInProgress: "bool", previousPageVisited: generateTypeDef(widget.previousPageVisited), nextPageVisited: generateTypeDef(widget.nextPageButtonClicked), - filteredTableData: generateTypeDef(widget.filteredTableData) + filteredTableData: generateTypeDef(widget.filteredTableData), }; if (this.getFeatureFlag(ALLOW_TABLE_WIDGET_SERVER_SIDE_FILTERING)) { From c72c91a6cd0b1a655ffac067953d163b30b654f6 Mon Sep 17 00:00:00 2001 From: Pavan134 Date: Mon, 16 Sep 2024 11:59:50 +0530 Subject: [PATCH 5/8] fix:cypress test file in JS port to TS --- ...ableData_auto_spec.js => check_filterTableData_auto_spec.ts} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/{check_filterTableData_auto_spec.js => check_filterTableData_auto_spec.ts} (96%) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.ts similarity index 96% rename from app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js rename to app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.ts index a8ea2ce65758..a9d44e8f755a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.ts @@ -1,5 +1,5 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; -const dynamicInputLocators = require("../../../../../locators/DynamicInput.json"); +import dynamicInputLocators from "../../../../../locators/DynamicInput.json"; const tableData = `[ { From 8eba89991b1d012de1d1aedece742f8412bf252d Mon Sep 17 00:00:00 2001 From: Pavan134 Date: Tue, 17 Sep 2024 16:30:28 +0530 Subject: [PATCH 6/8] fix:resolved the issue --- .../Widgets/TableV2/TableV2_Widget_Copy_Paste_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Copy_Paste_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Copy_Paste_spec.js index 8f453239bc97..6caa708659c7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Copy_Paste_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Copy_Paste_spec.js @@ -51,7 +51,7 @@ describe( }); cy.wait(200); cy.get(apiwidget.propertyList).then(function ($lis) { - expect($lis).to.have.length(22); + expect($lis).to.have.length(23); expect($lis.eq(0)).to.contain("{{Table1Copy.selectedRow}}"); expect($lis.eq(1)).to.contain("{{Table1Copy.selectedRows}}"); }); @@ -68,7 +68,7 @@ describe( }); cy.wait(200); cy.get(apiwidget.propertyList).then(function ($lis) { - expect($lis).to.have.length(23); + expect($lis).to.have.length(24); expect($lis.last()).to.contain("{{Table1Copy.filters}}"); }); }); From 459c912cac9cc05e710661014e33762482ac1df8 Mon Sep 17 00:00:00 2001 From: Pavan134 Date: Sat, 21 Sep 2024 20:56:05 +0530 Subject: [PATCH 7/8] fix: inserted new line --- .../TableWidgetV2/widget/checkFilteredDataProperty.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts b/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts index 7b23764a4b3a..42ae98ecf620 100644 --- a/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts +++ b/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts @@ -86,6 +86,7 @@ describe("Bug: check filteredTableData property in autocomplete definitions of t dataTreeEntityConfig, ); expect(def).toHaveProperty("Table1.filteredTableData"); + expect(entityInfo.get("Table1")).toStrictEqual({ type: ENTITY_TYPE.WIDGET, subType: "TABLE_WIDGET_V2", From edecbf0e32046acf581c83dd13e707b308ad5133 Mon Sep 17 00:00:00 2001 From: Pavan134 Date: Mon, 23 Sep 2024 13:19:07 +0530 Subject: [PATCH 8/8] fix: inserted new line at line 88 in test file --- .../TableWidgetV2/widget/checkFilteredDataProperty.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts b/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts index 42ae98ecf620..fc54aa3511b9 100644 --- a/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts +++ b/app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts @@ -85,8 +85,8 @@ describe("Bug: check filteredTableData property in autocomplete definitions of t {}, dataTreeEntityConfig, ); + expect(def).toHaveProperty("Table1.filteredTableData"); - expect(entityInfo.get("Table1")).toStrictEqual({ type: ENTITY_TYPE.WIDGET, subType: "TABLE_WIDGET_V2",