Group / ungroup should not always be present in the context menu (#1890)

Co-authored-by: rene_mbp <harryloveslearning@googlemail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
Rene 2020-07-09 22:32:27 +02:00 committed by GitHub
parent 5664de0459
commit 51a8ab65f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 593 additions and 0 deletions

View file

@ -82,6 +82,14 @@ export class ActionManager implements ActionsManagerInterface {
return Object.values(this.actions)
.filter(actionFilter)
.filter((action) => "contextItemLabel" in action)
.filter((action) =>
action.contextItemPredicate
? action.contextItemPredicate(
this.getElementsIncludingDeleted(),
this.getAppState(),
)
: true,
)
.sort(
(a, b) =>
(a.contextMenuOrder !== undefined ? a.contextMenuOrder : 999) -