mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-23 01:55:00 +02:00
add model-workbench and fix queries
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
@@ -15,11 +15,10 @@
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
import { onDestroy, createEventDispatcher } from 'svelte'
|
||||
import type { Ref } from '@anticrm/core'
|
||||
import type { Application } from '@anticrm/workbench'
|
||||
import { getCurrentLocation, navigate } from '@anticrm/ui'
|
||||
import { getClient } from '@anticrm/presentation'
|
||||
import { createQuery } from '@anticrm/presentation'
|
||||
import workbench from '@anticrm/workbench'
|
||||
|
||||
import AppItem from './AppItem.svelte'
|
||||
@@ -27,7 +26,9 @@
|
||||
export let active: Ref<Application> | undefined
|
||||
|
||||
let apps: Application[] = []
|
||||
onDestroy(getClient().query(workbench.class.Application, {}, result => { apps = result }))
|
||||
|
||||
const query = createQuery()
|
||||
$: query.query(workbench.class.Application, {}, result => { apps = result })
|
||||
|
||||
function navigateApp(app: Ref<Application>) {
|
||||
const loc = getCurrentLocation()
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
import Add from './icons/Add.svelte'
|
||||
import Star from './icons/Star.svelte'
|
||||
|
||||
import { getClient } from '@anticrm/presentation'
|
||||
import { getClient, createQuery } from '@anticrm/presentation'
|
||||
import { showModal } from '@anticrm/ui'
|
||||
import { classIcon } from '../utils'
|
||||
import core from '@anticrm/core'
|
||||
@@ -30,13 +30,10 @@
|
||||
export let createItemDialog: AnyComponent | undefined
|
||||
|
||||
const client = getClient()
|
||||
const query = createQuery()
|
||||
let data: Space | undefined
|
||||
|
||||
let unsubscribe = () => {}
|
||||
$: {
|
||||
unsubscribe()
|
||||
unsubscribe = client.query(core.class.Space, { _id: space }, result => { data = result[0] })
|
||||
}
|
||||
$: query.query(core.class.Space, { _id: space }, result => { data = result[0] })
|
||||
|
||||
function showCreateDialog() {
|
||||
showModal(createItemDialog as AnyComponent, { space })
|
||||
|
||||
Reference in New Issue
Block a user