From 05f558a5ffce613912a57db13800c2bc053d3dce Mon Sep 17 00:00:00 2001 From: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> Date: Thu, 16 Jun 2022 19:51:28 +0600 Subject: [PATCH] EditIssue subissue loop fix (#2093) Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> --- .../src/components/TxView.svelte | 16 ++++++++++------ .../src/components/issues/edit/EditIssue.svelte | 7 ++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/plugins/activity-resources/src/components/TxView.svelte b/plugins/activity-resources/src/components/TxView.svelte index 0c3dad6117..ae60b95ee2 100644 --- a/plugins/activity-resources/src/components/TxView.svelte +++ b/plugins/activity-resources/src/components/TxView.svelte @@ -18,7 +18,7 @@ import contact, { EmployeeAccount, formatName } from '@anticrm/contact' import core, { AnyAttribute, Doc, getCurrentAccount, Ref } from '@anticrm/core' import { Asset, getResource } from '@anticrm/platform' - import { getClient } from '@anticrm/presentation' + import { createQuery, getClient } from '@anticrm/presentation' import { Button, Component, @@ -61,6 +61,7 @@ } const client = getClient() + const query = createQuery() function getProps (props: any, edit: boolean): any { return { ...props, edit } @@ -75,11 +76,14 @@ } }) - $: client - .findOne(contact.class.EmployeeAccount, { _id: tx.tx.modifiedBy as Ref }) - .then((account) => { - employee = account - }) + $: query.query( + contact.class.EmployeeAccount, + { _id: tx.tx.modifiedBy as Ref }, + (account) => { + ;[employee] = account + }, + { limit: 1 } + ) const showMenu = async (ev: MouseEvent): Promise => { const actions = await getActions(client, tx.doc as Doc) diff --git a/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte b/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte index 8d7bb1a786..fe19f8d9ba 100644 --- a/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte +++ b/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte @@ -86,14 +86,11 @@ ;[issue] = result title = issue.title description = issue.description + currentTeam = issue.$lookup?.space }, - { lookup: { attachedTo: tracker.class.Issue } } + { lookup: { attachedTo: tracker.class.Issue, space: tracker.class.Team } } ) - $: if (issue) { - client.findOne(tracker.class.Team, { _id: issue.space }).then((r) => (currentTeam = r)) - } - $: currentTeam && statusesQuery.query( tracker.class.IssueStatus,