TSK-124 fix (#2092)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov
2022-06-16 17:33:52 +07:00
committed by GitHub
parent c6f759e1f9
commit dfdbe15576
3 changed files with 61 additions and 15 deletions
@@ -16,7 +16,7 @@
import { createEventDispatcher } from 'svelte'
import { AttachedData, Ref, SortingOrder, WithLookup } from '@anticrm/core'
import { Issue, IssueStatus } from '@anticrm/tracker'
import { getClient } from '@anticrm/presentation'
import { createQuery, getClient } from '@anticrm/presentation'
import { tooltip, TooltipAlignment } from '@anticrm/ui'
import type { ButtonKind, ButtonSize } from '@anticrm/ui'
import tracker from '../../plugin'
@@ -34,6 +34,7 @@
export let width: string | undefined = '100%'
const client = getClient()
const statusesQuery = createQuery()
const dispatch = createEventDispatcher()
const handleStatusChanged = async (newStatus: Ref<IssueStatus> | undefined) => {
@@ -49,14 +50,17 @@
}
$: if (!statuses) {
const query = '_id' in value ? { attachedTo: value.space } : {}
client
.findAll(tracker.class.IssueStatus, query, {
statusesQuery.query(
tracker.class.IssueStatus,
query,
(result) => {
statuses = result
},
{
lookup: { category: tracker.class.IssueStatusCategory },
sort: { rank: SortingOrder.Ascending }
})
.then((result) => {
statuses = result
})
}
)
}
</script>