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(tree): add Tree Collapse Grid State/Preset #791

Merged
merged 3 commits into from
Jun 12, 2021

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Jun 12, 2021

  • add ways to reapply Tree Collapse previous state whenever we want
  • add initiallyCollapsed flag to Tree Data Option to allow loading the grid as collapsed or not from the start (defaults to false)
  • add Grid Preset that can be used with Grid State
  • add __hasChildren flag to every dataset item that will always be included & also refactor Tree Formatters to use this new flag instead of querying next item
  • add __collapsed flag on all items which are parents, in other words don't add this flag to child item that have no children themselves
  • considerably improve speed of full expand/collapse performance (because the previous code was using setItems which was slowing down the toggling drastically)

TODOs

  • working POC code
  • add full unit test suite
  • add Cypress E2E tests to cover new feature

- add ways to reapply Tree Collapse previous state whenever we want
- add `initiallyCollapsed` flag to Tree Data Option to allow loading the grid as collapsed or not from the start (defaults to false)
- add Grid Preset that can be used with Grid State
- add `__hasChildren` flag to every dataset item that will always be included & also refactor Tree Formatters to use this new flag instead of querying next item
- add `__collapsed` flag on all items which are parents, in other words don't add this flag to child item that have no children themselves
- considerably improve speed of full expand/collapse performance (because the previous code was using `setItems` which was slowing down the toggling drastically)
@ghiscoding ghiscoding changed the title feat(tree): add Tree Collapse Grid State/Preset WIP - feat(tree): add Tree Collapse Grid State/Preset Jun 12, 2021
@codecov
Copy link

codecov bot commented Jun 12, 2021

Codecov Report

Merging #791 (fe91b02) into master (8651976) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            master      #791    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          162       162            
  Lines        11203     11315   +112     
  Branches      3938      3978    +40     
==========================================
+ Hits         11203     11315   +112     
Impacted Files Coverage Δ
...ngular-slickgrid/extensions/headerMenuExtension.ts 100.00% <ø> (ø)
...lickgrid/components/angular-slickgrid.component.ts 100.00% <100.00%> (ø)
src/app/modules/angular-slickgrid/constants.ts 100.00% <100.00%> (ø)
...ngular-slickgrid/formatters/treeExportFormatter.ts 100.00% <100.00%> (ø)
...ules/angular-slickgrid/formatters/treeFormatter.ts 100.00% <100.00%> (ø)
...dules/angular-slickgrid/services/filter.service.ts 100.00% <100.00%> (ø)
...modules/angular-slickgrid/services/grid.service.ts 100.00% <100.00%> (ø)
...es/angular-slickgrid/services/gridState.service.ts 100.00% <100.00%> (ø)
...dules/angular-slickgrid/services/shared.service.ts 100.00% <100.00%> (ø)
...modules/angular-slickgrid/services/sort.service.ts 100.00% <100.00%> (ø)
... and 2 more

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 8651976...fe91b02. Read the comment docs.

@ghiscoding ghiscoding changed the title WIP - feat(tree): add Tree Collapse Grid State/Preset feat(tree): add Tree Collapse Grid State/Preset Jun 12, 2021
@ghiscoding ghiscoding merged commit 60ae015 into master Jun 12, 2021
@ghiscoding ghiscoding deleted the feat/tree-data-collapsed-state branch June 12, 2021 14:43
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.

1 participant