-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix: Incorrect updation of selctedRowIndex when primary column is set. #36393
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
Merged
rahulbarwal
merged 14 commits into
release
from
fix-36080/selectedRowIndex-getting-updated-unnecessarily
Sep 20, 2024
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9f29d54
Since we are sending filteredTableData for row selection, we don't ne…
rahulbarwal 611d9d9
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
rahulbarwal 7e9b98e
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
rahulbarwal f8665d7
Adds tests for selectedRowIndex bug
rahulbarwal 0833c3f
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
rahulbarwal 4938857
Upgrade to ts
rahulbarwal 3f030d8
Upgrade test functionality to use helper methods.
rahulbarwal 69b58b5
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
rahulbarwal cd876e7
Moved fixture data to `fixtures` directory.
rahulbarwal 1f7a16b
Since we have moved fixture data, it does not make sense ot have a di…
rahulbarwal da68a80
Update usage of cy.
rahulbarwal fdac3cb
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
rahulbarwal 05ec2fe
Adds sanity to table specs.
rahulbarwal 1a2d644
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
rahulbarwal 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
55 changes: 0 additions & 55 deletions
55
...lient/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.js
This file was deleted.
Oops, something went wrong.
114 changes: 114 additions & 0 deletions
114
...lient/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.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,114 @@ | ||
| import EditorNavigation, { | ||
| EntityType, | ||
| PageLeftPane, | ||
| PagePaneSegment, | ||
| } from "../../../../../support/Pages/EditorNavigation"; | ||
|
|
||
| import dsl from "../../../../../fixtures/tableV2AndTextDsl.json"; | ||
| import widgetsPage from "../../../../../locators/Widgets.json"; | ||
| import commonlocators from "../../../../../locators/commonlocators.json"; | ||
| import publish from "../../../../../locators/publishWidgetspage.json"; | ||
|
|
||
| import { tableDataJSObject } from "../../../../../fixtures/tableV2FilteringWithPrimaryColumnJSObjectWidthData"; | ||
| import { | ||
| agHelper, | ||
| jsEditor, | ||
| locators, | ||
| table, | ||
| } from "../../../../../support/Objects/ObjectsCore"; | ||
|
|
||
| describe( | ||
| "Table Widget V2 Filtered Table data in autocomplete", | ||
| { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, | ||
| function () { | ||
| before("Table Widget V2 Functionality", () => { | ||
| agHelper.AddDsl("tableV2AndTextDsl"); | ||
| agHelper.GetNClick(locators._widgetInCanvas("tablewidgetv2")); | ||
| }); | ||
|
|
||
| it("1. Table Widget V2 Functionality To Filter and search data", function () { | ||
| table.SearchTable("query"); | ||
| agHelper.GetNClick(publish.filterBtn, 0, true); | ||
| agHelper.GetNClick(publish.attributeDropdown, 0, true); | ||
|
|
||
| agHelper | ||
| .GetElement(publish.attributeValue) | ||
| .contains("task") | ||
| .click({ force: true }); | ||
| agHelper.GetNClick(publish.conditionDropdown, 0, true); | ||
| agHelper | ||
| .GetElement(publish.attributeValue) | ||
| .contains("contains") | ||
| .click({ force: true }); | ||
| agHelper.TypeText(publish.tableFilterInputValue, "bind"); | ||
|
|
||
| agHelper.GetNClick(widgetsPage.filterApplyBtn, 0, true); | ||
| table.CloseFilter(); | ||
| }); | ||
|
|
||
| it("2. Table Widget V2 Functionality to validate filtered table data", function () { | ||
| EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); | ||
| (cy as any).testJsontext("text", "{{Table1.filteredTableData[0].task}}"); | ||
| table.ReadTableRowColumnData(0, 1, "v2").then((tabData: string) => { | ||
| agHelper.AssertText( | ||
| commonlocators.labelTextStyle, | ||
| "text", | ||
| tabData as string, | ||
| ); | ||
| }); | ||
|
|
||
| //Table Widget V2 Functionality to validate filtered table data with actual table data | ||
| const tableData = JSON.parse(dsl.dsl.children[0].tableData as string); | ||
| agHelper.AssertText( | ||
| commonlocators.labelTextStyle, | ||
| "text", | ||
| tableData[1].task as string, | ||
| ); | ||
| }); | ||
|
|
||
| it("3. When primary key is set, selectedRowIndex should not updated after data update", function () { | ||
| // https://github.com/appsmithorg/appsmith/issues/36080 | ||
| jsEditor.CreateJSObject(tableDataJSObject, { | ||
| paste: true, | ||
| completeReplace: true, | ||
| toRun: false, | ||
| shouldCreateNewJSObj: true, | ||
| prettify: true, | ||
| }); | ||
| jsEditor.CreateJSObject(manipulateDataJSObject, { | ||
| paste: true, | ||
| completeReplace: true, | ||
| toRun: true, | ||
| shouldCreateNewJSObj: true, | ||
| prettify: true, | ||
| }); | ||
| PageLeftPane.switchSegment(PagePaneSegment.UI); | ||
|
|
||
| agHelper.AddDsl("tableV2FilteringWithPrimaryColumn"); | ||
| table.SearchTable("Engineering"); | ||
| table.ReadTableRowColumnData(2, 0, "v2").then((text) => { | ||
| expect(text).to.equal("Michael Wilson"); | ||
| }); | ||
|
|
||
| table.SelectTableRow(2, 0, true, "v2"); | ||
|
|
||
| agHelper.GetText(locators._textWidget, "text").then((text) => { | ||
| agHelper.ClickButton("Submit"); | ||
|
|
||
| table.ReadTableRowColumnData(2, 0, "v2").then((text) => { | ||
| expect(text).to.equal("Michael Wilson1"); | ||
| }); | ||
| agHelper.AssertText(locators._textWidget, "text", text as string); | ||
| }); | ||
| }); | ||
| }, | ||
| ); | ||
|
|
||
| export const manipulateDataJSObject = `export default { | ||
| data: JSObject1.initData, | ||
| makeNewCopy() { | ||
| const my = _.cloneDeep(this.data); | ||
| my[5].name =my[5].name+"1"; | ||
rahulbarwal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| this.data = my; | ||
| } | ||
| }`; | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.