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: add sub-menu(s) to GridMenu plugin #1151

Merged
merged 11 commits into from
Oct 26, 2023
Merged

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Oct 26, 2023

  • currently only works by click event on sub-menus, the mouseover will be implemented in a future PR

TODOs

  • add full unit test coverage
  • add Cypress E2E tests
  • sub-menus events are leaking, it needs to be fixed before merging
  • it might be nice to add auto-align top/bottom especially for sub-menus
  • instead of creating GridMenu then hiding it in the DOM, we should create it on the fly and destroy it when closed, meaning that if the user never clicks on it then we will never add it to the DOM but the previous was creating a GridMenu (and ColumnPicker) for every grids in the page

image

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #1151 (30bba7f) into master (c9e8327) will not change coverage.
Report is 7 commits behind head on master.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #1151   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          245       245           
  Lines        16997     17075   +78     
  Branches      6113      6151   +38     
=========================================
+ Hits         16997     17075   +78     
Files Coverage Δ
packages/common/src/extensions/menuBaseClass.ts 100.00% <100.00%> (ø)
...ges/common/src/extensions/menuFromCellBaseClass.ts 100.00% <100.00%> (ø)
...ackages/common/src/extensions/slickColumnPicker.ts 100.00% <100.00%> (ø)
packages/common/src/extensions/slickContextMenu.ts 100.00% <100.00%> (ø)
packages/common/src/extensions/slickGridMenu.ts 100.00% <100.00%> (ø)
...ckages/common/src/services/bindingEvent.service.ts 100.00% <100.00%> (ø)

... and 6 files with indirect coverage changes

ghiscoding-SE and others added 7 commits October 26, 2023 11:16
- in order to bind and unbind a set of event listeners more easily, we can add an optional group name, for example this will be helpful to unbind all event related to sub-menus while still keeping other event listeners in place
- previous PR #1150 brought this new feature but it was found that if the bounded events to unbind are at the end of the array and we called `unbindAll`, it wasn't removing all espected events because calling `splice` whithin the logic was reindexing the array causing an index offset and it missed unbounding them all.
- the best approach is to loop in reverse order which has no consequences on the array indexes and will not cause offset
@ghiscoding ghiscoding changed the title WIP - feat: add sub-menu(s) to GridMenu plugin feat: add sub-menu(s) to GridMenu plugin Oct 26, 2023
@ghiscoding ghiscoding merged commit 5178310 into master Oct 26, 2023
5 checks passed
@ghiscoding ghiscoding deleted the feat/gridmenu-sub-menus branch October 26, 2023 21:37
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