mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
UBERF-4136: Fix global actions (#3961)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
d17a476af4
commit
6dc01fb12a
@ -207,7 +207,7 @@ export function createActions (builder: Builder, issuesId: string, componentsId:
|
||||
keyBinding: ['keyC'],
|
||||
input: 'none',
|
||||
category: tracker.category.Tracker,
|
||||
target: tracker.class.Issue,
|
||||
target: core.class.Doc,
|
||||
context: {
|
||||
mode: ['browser'],
|
||||
application: tracker.app.Tracker,
|
||||
|
@ -89,9 +89,16 @@
|
||||
const docs = getSelection($focusStore, $selectionStore)
|
||||
let fActions: WithLookup<Action>[] = actions
|
||||
|
||||
// We need to filter application based actions first, to prevent override for globals
|
||||
fActions = fActions.filter(
|
||||
(it) =>
|
||||
(it.$lookup?.category?.visible ?? true) &&
|
||||
(it.context.application === viewContext.application || it.context.application === undefined)
|
||||
)
|
||||
for (const d of docs) {
|
||||
fActions = filterActions(client, d, fActions)
|
||||
}
|
||||
|
||||
if (docs.length === 0) {
|
||||
fActions = fActions.filter((it) => it.input === 'none')
|
||||
const overrideRemove: Array<Ref<Action>> = []
|
||||
@ -102,11 +109,6 @@
|
||||
}
|
||||
fActions = fActions.filter((it) => !overrideRemove.includes(it._id))
|
||||
}
|
||||
fActions = fActions.filter(
|
||||
(it) =>
|
||||
(it.$lookup?.category?.visible ?? true) &&
|
||||
(it.context.application === viewContext.application || it.context.application === undefined)
|
||||
)
|
||||
fActions = await filterVisibleActions(fActions, docs)
|
||||
// Sort by category.
|
||||
supportedActions = fActions.sort((a, b) => a.category.localeCompare(b.category))
|
||||
|
Loading…
Reference in New Issue
Block a user