Skip to content
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

feat: selection preservation mode api #5887

Merged
merged 28 commits into from
Jan 15, 2024

Conversation

ugur-vaadin
Copy link
Contributor

@ugur-vaadin ugur-vaadin commented Dec 31, 2023

Description

This PR introduces new API to provide the following 3 selection preservation mode options:

  • Preserve selection
  • Preserve selected items that still exist after data change (not supported for lazy data providers)
  • Discard selection

for the following 4 components:

  • Grid (default mode: preserve all)
  • MultiSelectListBox (default mode: discard)
  • RadioButtonGroup (default mode: discard)
  • CheckboxGroup (default mode: discard)

The default modes are the same as before in order to not cause breaking changes.

The API is on the component level, and is controlled by setting an enum SelectionPreservationMode using:

  • setSelectionPreservationMode(SelectionPreservationMode)
  • getSelectionPreservationMode

Fixes #5744

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/contributing/overview
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

@ugur-vaadin ugur-vaadin force-pushed the feat-add-api-for-enhanced-selection-on-refresh branch 2 times, most recently from 66d6f10 to bc61d77 Compare January 4, 2024 11:56
@ugur-vaadin ugur-vaadin marked this pull request as ready for review January 4, 2024 11:57
@ugur-vaadin ugur-vaadin force-pushed the feat-add-api-for-enhanced-selection-on-refresh branch from 03a0ab8 to 1ca8090 Compare January 4, 2024 20:41
@ugur-vaadin ugur-vaadin changed the title feat: initial implementation of api for enhanced selection feat: selection preserving strategy api Jan 4, 2024
@ugur-vaadin ugur-vaadin changed the title feat: selection preserving strategy api feat: selection preservation strategy api Jan 4, 2024
@sissbruecker sissbruecker self-requested a review January 8, 2024 11:21
@ugur-vaadin ugur-vaadin changed the title feat: selection preservation strategy api feat: selection preservation mode api Jan 10, 2024
@ugur-vaadin ugur-vaadin force-pushed the feat-add-api-for-enhanced-selection-on-refresh branch from 2bbb57b to 8ae2c59 Compare January 10, 2024 11:05
@ugur-vaadin ugur-vaadin force-pushed the feat-add-api-for-enhanced-selection-on-refresh branch from 8ae2c59 to b912379 Compare January 15, 2024 11:48
@ugur-vaadin ugur-vaadin enabled auto-merge (squash) January 15, 2024 11:48
Copy link

sonarcloud bot commented Jan 15, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

7 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ugur-vaadin ugur-vaadin merged commit 91de754 into main Jan 15, 2024
5 checks passed
@ugur-vaadin ugur-vaadin deleted the feat-add-api-for-enhanced-selection-on-refresh branch January 15, 2024 12:32
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.4.0.alpha2 and is also targeting the upcoming stable 24.4.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API for enhanced selection on items refresh
3 participants