mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 16:56:07 +00: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'],
|
keyBinding: ['keyC'],
|
||||||
input: 'none',
|
input: 'none',
|
||||||
category: tracker.category.Tracker,
|
category: tracker.category.Tracker,
|
||||||
target: tracker.class.Issue,
|
target: core.class.Doc,
|
||||||
context: {
|
context: {
|
||||||
mode: ['browser'],
|
mode: ['browser'],
|
||||||
application: tracker.app.Tracker,
|
application: tracker.app.Tracker,
|
||||||
|
@ -89,9 +89,16 @@
|
|||||||
const docs = getSelection($focusStore, $selectionStore)
|
const docs = getSelection($focusStore, $selectionStore)
|
||||||
let fActions: WithLookup<Action>[] = actions
|
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) {
|
for (const d of docs) {
|
||||||
fActions = filterActions(client, d, fActions)
|
fActions = filterActions(client, d, fActions)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (docs.length === 0) {
|
if (docs.length === 0) {
|
||||||
fActions = fActions.filter((it) => it.input === 'none')
|
fActions = fActions.filter((it) => it.input === 'none')
|
||||||
const overrideRemove: Array<Ref<Action>> = []
|
const overrideRemove: Array<Ref<Action>> = []
|
||||||
@ -102,11 +109,6 @@
|
|||||||
}
|
}
|
||||||
fActions = fActions.filter((it) => !overrideRemove.includes(it._id))
|
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)
|
fActions = await filterVisibleActions(fActions, docs)
|
||||||
// Sort by category.
|
// Sort by category.
|
||||||
supportedActions = fActions.sort((a, b) => a.category.localeCompare(b.category))
|
supportedActions = fActions.sort((a, b) => a.category.localeCompare(b.category))
|
||||||
|
Loading…
Reference in New Issue
Block a user