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

fix(demo): we should be able to move row(s) and keep selections #352

Merged
merged 2 commits into from
May 26, 2021

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented May 26, 2021

  • grid state should only be allowed to change row selection only when Pagination is enabled
  • refactor some part of the code to use more optional chaining (?.) syntax for cleaner and smaller code
  • move around some of the Cypress tests so that it makes sure that moving rows will keep row selections

- grid state should only be allowed to change row selection only when Pagination is enabled
- refactor some part of the code to use more optional chaining (?.) syntax for cleaner and smaller code
- move around some of the Cypress tests so that it makes sure that moving rows will keep selections
@ghiscoding ghiscoding requested a review from AnnetteZhang May 26, 2021 14:59
@codecov
Copy link

codecov bot commented May 26, 2021

Codecov Report

Merging #352 (5b8eb70) into master (6220216) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #352   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          212       212           
  Lines        13241     13230   -11     
  Branches      4340      4337    -3     
=========================================
- Hits         13241     13230   -11     
Impacted Files Coverage Δ
packages/common/src/services/gridState.service.ts 100.00% <100.00%> (ø)
packages/common/src/services/sort.service.ts 100.00% <100.00%> (ø)
packages/common/src/editors/textEditor.ts 100.00% <0.00%> (ø)
packages/common/src/editors/floatEditor.ts 100.00% <0.00%> (ø)
packages/common/src/editors/integerEditor.ts 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6220216...5b8eb70. Read the comment docs.

Copy link
Collaborator

@AnnetteZhang AnnetteZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment

@@ -258,9 +258,9 @@ export class GridStateService {
*/
getCurrentPagination(): CurrentPagination | null {
if (this._gridOptions.enablePagination) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like _gridOptions can be null sometimes. If you check null on line 260 with "?.", you can remove the "?." on line 261.

@ghiscoding ghiscoding merged commit c400b6b into master May 26, 2021
@ghiscoding ghiscoding deleted the bugfix/row-move-with-selection branch May 26, 2021 16:03
ghiscoding-SE pushed a commit that referenced this pull request May 28, 2021
- previous PR #352 that fixed row selection with row move actually caused a regression with toggling of pagination, when removing Pagination on the fly it will show all items in the grid and there is code in the Grid State Service that will take row selections from all page and reselect them when we toggle to No Pagination, and we need to change our `enablePagination` only after that Grid State Service is finished else we end up missing row selection from all other pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants