-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix: multiselect widget selected values inside list widget #41214
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
Open
saharAdem
wants to merge
9
commits into
appsmithorg:release
Choose a base branch
from
saharAdem:fix/multiselect-widget-selections
base: release
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+167
−14
Open
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a55fd9b
fix: Multiselect widget selected values inside list widget
saharAdem 633558c
Resolve comments
saharAdem 16ae559
Resolve app smith comments
saharAdem 21fcf6d
Resolve AI comments
saharAdem fced85b
Resolve AI comments
saharAdem 9968a78
Resolve AI comments
saharAdem dcbab54
Resolve AI comments
saharAdem 2991046
Update function name
saharAdem f003104
Remove unused code
saharAdem 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
app/client/cypress/e2e/Regression/ClientSide/BugTests/MultiSelectWidget_Bug41210_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,84 @@ | ||
| import { locators } from "../../../../support/Objects/ObjectsCore"; | ||
| import * as _ from "../../../../support/Objects/ObjectsCore"; | ||
| import EditorNavigation, { | ||
| EntityType, | ||
| } from "../../../../support/Pages/EditorNavigation"; | ||
|
|
||
| describe("Bug 41210: MultiSelectWidgetV2 inside ListWidget - selected values and labels persist per item", function () { | ||
| const widgetSelector = (name: string) => `[data-widgetname-cy="${name}"]`; | ||
| const listContainer = `${widgetSelector("List1")} [type="CONTAINER_WIDGET"]`; | ||
|
|
||
| before(() => { | ||
| _.agHelper.AddDsl("Listv2/emptyList"); | ||
| _.jsEditor.CreateJSObject( | ||
| `export default { | ||
| listItems: [ | ||
| { id: 1, name: "Row 1" }, | ||
| { id: 2, name: "Row 2" }, | ||
| { id: 3, name: "Row 3" } | ||
| ], | ||
|
|
||
| getItems() { | ||
| return this.listItems; | ||
| }, | ||
|
|
||
| deleteItemAtIndex(index) { | ||
| this.listItems = this.listItems.filter((_, i) => i !== index); | ||
| return this.listItems; | ||
| } | ||
| }`, | ||
| { | ||
| paste: true, | ||
| completeReplace: true, | ||
| toRun: false, | ||
| shouldCreateNewJSObj: true, | ||
| prettify: false, | ||
| }, | ||
| ); | ||
| }); | ||
|
|
||
| it("should persist selected values for each list item and initialize with default values on first render", function () { | ||
| cy.dragAndDropToWidget("multiselectwidgetv2", "containerwidget", { | ||
| x: 250, | ||
| y: 50, | ||
| }); | ||
| _.propPane.UpdatePropertyFieldValue("Default selected values", '["GREEN"]'); | ||
| EditorNavigation.SelectEntityByName("List1", EntityType.Widget); | ||
| _.propPane.UpdatePropertyFieldValue("Items", `{{JSObject1.getItems()}}`); | ||
| _.agHelper.GetNClick(locators._enterPreviewMode); | ||
| _.agHelper.SelectFromMultiSelect(["Red"]); | ||
|
|
||
| cy.get(listContainer).eq(1).click(); | ||
| cy.get(listContainer).eq(0).click(); | ||
| cy.get( | ||
| `${locators._widgetByName("MultiSelect1")} .rc-select-selection-item`, | ||
| ).should("contain.text", "Red"); | ||
| }); | ||
|
|
||
| it("should delete first list item and keep selections mapped correctly", function () { | ||
| _.agHelper.GetNClick(locators._exitPreviewMode); | ||
| cy.dragAndDropToWidget("iconbuttonwidget", "containerwidget", { | ||
| x: 350, | ||
| y: 50, | ||
| }); | ||
|
|
||
| _.propPane.EnterJSContext("Icon", "trash"); | ||
| _.propPane.EnterJSContext( | ||
| "onClick", | ||
| `{{JSObject1.deleteItemAtIndex(currentIndex)}}`, | ||
| true, | ||
| false, | ||
| ); | ||
|
|
||
| _.agHelper.GetNClick(locators._enterPreviewMode); | ||
| _.agHelper.SelectFromMultiSelect(["Red"], 1); | ||
| _.agHelper.GetNClick(locators._widgetByName("IconButton1")); | ||
|
|
||
| cy.get(listContainer).should("have.length", 2); | ||
|
|
||
| cy.get(locators._widgetByName("MultiSelect1")) | ||
| .eq(0) | ||
| .find(".rc-select-selection-item") | ||
| .should("contain.text", "Red"); | ||
| }); | ||
| }); |
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
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.
Uh oh!
There was an error while loading. Please reload this page.