mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-19 23:00:13 +00: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
|
* @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
|
* @public
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<script lang="ts">
|
<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 type { Issue } from '@anticrm/task'
|
||||||
import { createQuery } from '@anticrm/presentation'
|
import { createQuery } from '@anticrm/presentation'
|
||||||
import { CircleButton, IconAdd, showPopup, Label } from '@anticrm/ui'
|
import { CircleButton, IconAdd, showPopup, Label } from '@anticrm/ui'
|
||||||
@ -36,6 +36,13 @@
|
|||||||
|
|
||||||
const createApp = (ev: MouseEvent): void =>
|
const createApp = (ev: MouseEvent): void =>
|
||||||
showPopup(CreateTask, { parent: { _id: objectId, _class, space } }, ev.target as HTMLElement, () => {})
|
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>
|
</script>
|
||||||
|
|
||||||
<div class="applications-container">
|
<div class="applications-container">
|
||||||
@ -47,14 +54,7 @@
|
|||||||
<Table
|
<Table
|
||||||
_class={task.class.Issue}
|
_class={task.class.Issue}
|
||||||
config={['', '$lookup.space.name', '$lookup.state']}
|
config={['', '$lookup.space.name', '$lookup.state']}
|
||||||
options={
|
{options}
|
||||||
{
|
|
||||||
lookup: {
|
|
||||||
state: task.class.State,
|
|
||||||
space: core.class.Space
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
query={ { attachedTo: objectId } }
|
query={ { attachedTo: objectId } }
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
|
Loading…
Reference in New Issue
Block a user