mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-23 14:06:00 +03:00
fix lookup options (#830)
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
87ca27978a
commit
e92cf3272a
@ -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
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user