-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: filteredTableData property in autocomplete suggestions #35856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Pavan134
wants to merge
8
commits into
appsmithorg:release
from
Pavan134:bug-filtered-table-data-property-of-table-widget-doesnt-show-up-on-auto-complete
Closed
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
453fa0f
fix: filteredTableData property in autocomplete suggestions
Pavan134 2d39d27
feat: added unit test cases
Pavan134 73ad852
feat: changed properties of dataTreeEntity in test file
Pavan134 05ed6c9
fix: formatted using prettier
Pavan134 c72c91a
fix:cypress test file in JS port to TS
Pavan134 8eba899
fix:resolved the issue
Pavan134 459c912
fix: inserted new line
Pavan134 edecbf0
fix: inserted new line at line 88 in test file
Pavan134 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
...ient/cypress/e2e/Regression/ClientSide/Widgets/TableV2/check_filterTableData_auto_spec.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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(); | ||
|
|
||
| }) | ||
| }); | ||
200 changes: 200 additions & 0 deletions
200
app/client/src/widgets/TableWidgetV2/widget/checkFilteredDataProperty.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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: "", | ||
|
rahulbarwal marked this conversation as resolved.
Outdated
|
||
| 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."); | ||
| }, | ||
|
rahulbarwal marked this conversation as resolved.
Outdated
|
||
| 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": "" | ||
| } | ||
| ], | ||
|
rahulbarwal marked this conversation as resolved.
Outdated
|
||
| } | ||
| 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", | ||
| }); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this red changes. Linter error. Kindly run linter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sagar-qa007 How to run linter