From e8d5739847dce2aaea879c4664a5d26728fcc543 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Tue, 24 Jan 2023 23:49:20 +0700 Subject: [PATCH] Few fixes (#2536) Signed-off-by: Andrey Sobolev --- .../src/components/ModelView.svelte | 7 ++-- .../src/components/issues/IssuesView.svelte | 3 +- .../projects/ProjectsTimeline.svelte | 34 ++++++++----------- server-plugins/openai/src/openai.ts | 4 +-- server-plugins/openai/src/resources.ts | 2 +- server/core/src/indexer/summary.ts | 2 +- 6 files changed, 23 insertions(+), 29 deletions(-) diff --git a/plugins/devmodel-resources/src/components/ModelView.svelte b/plugins/devmodel-resources/src/components/ModelView.svelte index 2a8371a6c2..632b100db0 100644 --- a/plugins/devmodel-resources/src/components/ModelView.svelte +++ b/plugins/devmodel-resources/src/components/ModelView.svelte @@ -20,13 +20,14 @@ import { toIntl } from '..' import ContentPopup from './ContentPopup.svelte' - let txes: (TxCUD & { index: number })[] = [] + type TxCUDIndex = TxCUD & { index: number } + let txes: TxCUDIndex[] = [] const activityQuery = createQuery() - $: activityQuery.query(core.class.TxCUD, { objectSpace: core.space.Model }, (result) => { + $: activityQuery.query>(core.class.TxCUD, { objectSpace: core.space.Model }, (result) => { let c = 0 - txes = result.map((t) => ({ ...t, index: c++ })) + txes = result.map((t) => ({ ...t, index: c++ } as TxCUDIndex)) }) diff --git a/plugins/tracker-resources/src/components/issues/IssuesView.svelte b/plugins/tracker-resources/src/components/issues/IssuesView.svelte index 5590a79b13..b366faa69a 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesView.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesView.svelte @@ -68,9 +68,8 @@ const teamQuery = createQuery() let _teams: Map, Team> | undefined = undefined - let _result: any + $: teamQuery.query(tracker.class.Team, {}, (result) => { - _result = JSON.stringify(result, undefined, 2) _teams = toIdMap(result) }) diff --git a/plugins/tracker-resources/src/components/projects/ProjectsTimeline.svelte b/plugins/tracker-resources/src/components/projects/ProjectsTimeline.svelte index cdd46c495d..aa01c9f855 100644 --- a/plugins/tracker-resources/src/components/projects/ProjectsTimeline.svelte +++ b/plugins/tracker-resources/src/components/projects/ProjectsTimeline.svelte @@ -19,7 +19,7 @@ import { Issue, Project } from '@hcengineering/tracker' import { CheckBox, Spinner, Timeline, TimelineRow } from '@hcengineering/ui' import { AttributeModel, BuildModelKey } from '@hcengineering/view' - import { buildModel, getObjectPresenter, LoadingProps } from '@hcengineering/view-resources' + import { buildModel, LoadingProps } from '@hcengineering/view-resources' import { createEventDispatcher } from 'svelte' import tracker from '../../plugin' import ProjectPresenter from './ProjectPresenter.svelte' @@ -42,8 +42,6 @@ } } - let personPresenter: AttributeModel - $: options = { ...baseOptions } as FindOptions $: selectedObjectIdsSet = new Set>(selectedObjectIds.map((it) => it._id)) let selectedRows: number[] = [] @@ -56,10 +54,6 @@ selectedRows = tRows } else selectedRows = [] - $: getObjectPresenter(client, contact.class.Person, { key: '' }).then((p) => { - personPresenter = p - }) - export const onObjectChecked = (docs: Doc[], value: boolean) => { dispatch('check', { docs, value }) } @@ -174,20 +168,20 @@ {/if}