fix lookup options (#830)

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2022-01-17 10:59:33 +01:00 committed by GitHub
parent 87ca27978a
commit e92cf3272a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 10 deletions

View File

@ -48,7 +48,14 @@ export type DocumentQuery<T extends Doc> = {
/**
* @public
*/
export type Refs<T extends Doc> = Partial<Pick<T, KeysByType<T, Ref<Doc>>>>
export type ToClassRef<T extends object> = {
[P in keyof T]?: T[P] extends Ref<infer X> ? Ref<Class<X>> : never
}
/**
* @public
*/
export type Refs<T extends Doc> = ToClassRef<Pick<T, KeysByType<T, Ref<Doc>>>>
/**
* @public

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
import type { Ref, Space, Doc, Class } from '@anticrm/core'
import type { Ref, Space, Doc, Class, FindOptions } from '@anticrm/core'
import type { Issue } from '@anticrm/task'
import { createQuery } from '@anticrm/presentation'
import { CircleButton, IconAdd, showPopup, Label } from '@anticrm/ui'
@ -36,6 +36,13 @@
const createApp = (ev: MouseEvent): void =>
showPopup(CreateTask, { parent: { _id: objectId, _class, space } }, ev.target as HTMLElement, () => {})
const options: FindOptions<Issue> = {
lookup: {
state: task.class.State,
space: core.class.Space
}
}
</script>
<div class="applications-container">
@ -47,14 +54,7 @@
<Table
_class={task.class.Issue}
config={['', '$lookup.space.name', '$lookup.state']}
options={
{
lookup: {
state: task.class.State,
space: core.class.Space
}
}
}
{options}
query={ { attachedTo: objectId } }
/>
{:else}