mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-21 15:59:15 +00:00
UBERF-4560: filter out spaces that are archived for kanban (#4147)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
7b5fdb67c2
commit
8db7bc4475
@ -87,7 +87,9 @@
|
|||||||
resultQuery = mergeQueries(p, query)
|
resultQuery = mergeQueries(p, query)
|
||||||
})
|
})
|
||||||
|
|
||||||
$: queryNoLookup = getCategoryQueryNoLookup(resultQuery)
|
$: queryNoLookup = getCategoryQueryNoLookup(
|
||||||
|
mergeQueries(resultQuery, activeSpaces.length > 0 ? { space: { $in: activeSpaces } } : {})
|
||||||
|
)
|
||||||
const lookup: Lookup<Task> = {
|
const lookup: Lookup<Task> = {
|
||||||
...(options?.lookup ?? {}),
|
...(options?.lookup ?? {}),
|
||||||
space: task.class.Project,
|
space: task.class.Project,
|
||||||
@ -119,9 +121,10 @@
|
|||||||
|
|
||||||
let fastDocs: DocWithRank[] = []
|
let fastDocs: DocWithRank[] = []
|
||||||
let slowDocs: DocWithRank[] = []
|
let slowDocs: DocWithRank[] = []
|
||||||
|
let activeSpaces: Ref<Project>[] = []
|
||||||
const docsQuery = createQuery()
|
const docsQuery = createQuery()
|
||||||
const docsQuerySlow = createQuery()
|
const docsQuerySlow = createQuery()
|
||||||
|
const activeSpaceQuery = createQuery()
|
||||||
|
|
||||||
let fastQueryIds = new Set<Ref<DocWithRank>>()
|
let fastQueryIds = new Set<Ref<DocWithRank>>()
|
||||||
|
|
||||||
@ -136,7 +139,16 @@
|
|||||||
...getCategoryQueryProjection(client.getHierarchy(), _class, queryNoLookup, viewOptions.groupBy)
|
...getCategoryQueryProjection(client.getHierarchy(), _class, queryNoLookup, viewOptions.groupBy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$: activeSpaceQuery.query(
|
||||||
|
task.class.Project,
|
||||||
|
{
|
||||||
|
archived: false
|
||||||
|
},
|
||||||
|
(res) => {
|
||||||
|
activeSpaces = res.map((r: Project) => r._id)
|
||||||
|
},
|
||||||
|
{ projection: { _id: 1 } }
|
||||||
|
)
|
||||||
$: docsQuery.query(
|
$: docsQuery.query(
|
||||||
_class,
|
_class,
|
||||||
queryNoLookup,
|
queryNoLookup,
|
||||||
|
Loading…
Reference in New Issue
Block a user