From 7e0fe4e91f0325a3b02817854673c967550ba5d8 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Wed, 20 Sep 2023 00:21:09 +0700 Subject: [PATCH] UBER-885: Fix Object filter (#3716) Signed-off-by: Andrey Sobolev --- models/core/src/migration.ts | 23 ++++++++++++++++++- .../issues/edit/SubIssueList.svelte | 2 -- .../issues/related/RelatedIssues.svelte | 16 ++++--------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/models/core/src/migration.ts b/models/core/src/migration.ts index 01d2fe246d..42bf5b674b 100644 --- a/models/core/src/migration.ts +++ b/models/core/src/migration.ts @@ -13,9 +13,30 @@ // limitations under the License. // +import core, { TxOperations } from '@hcengineering/core' import { MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@hcengineering/model' export const coreOperation: MigrateOperation = { async migrate (client: MigrationClient): Promise {}, - async upgrade (client: MigrationUpgradeClient): Promise {} + async upgrade (client: MigrationUpgradeClient): Promise { + const tx = new TxOperations(client, core.account.System) + + const spaceSpace = await tx.findOne(core.class.Space, { + _id: core.space.Space + }) + if (spaceSpace === undefined) { + await tx.createDoc( + core.class.Space, + core.space.Space, + { + name: 'Space for all spaces', + description: 'Spaces', + private: false, + archived: false, + members: [] + }, + core.space.Space + ) + } + } } diff --git a/plugins/tracker-resources/src/components/issues/edit/SubIssueList.svelte b/plugins/tracker-resources/src/components/issues/edit/SubIssueList.svelte index c8885356ba..a53829bb55 100644 --- a/plugins/tracker-resources/src/components/issues/edit/SubIssueList.svelte +++ b/plugins/tracker-resources/src/components/issues/edit/SubIssueList.svelte @@ -23,7 +23,6 @@ import tracker from '../../../plugin' export let query: DocumentQuery | undefined = undefined - export let issues: Issue[] | undefined = undefined export let viewlet: Viewlet export let viewOptions: ViewOptions export let disableHeader: boolean = false @@ -83,7 +82,6 @@ viewOptionsConfig={viewlet.viewOptions?.other} config={preference.find((it) => it.attachedTo === viewlet._id)?.config ?? viewlet.config} {configurations} - documents={issues} {query} flatHeaders={true} props={{ projects }} diff --git a/plugins/tracker-resources/src/components/issues/related/RelatedIssues.svelte b/plugins/tracker-resources/src/components/issues/related/RelatedIssues.svelte index 7a6baf308f..8395ea38ab 100644 --- a/plugins/tracker-resources/src/components/issues/related/RelatedIssues.svelte +++ b/plugins/tracker-resources/src/components/issues/related/RelatedIssues.svelte @@ -13,7 +13,7 @@ // limitations under the License. --> -{#if subIssues !== undefined && viewlet !== undefined} - {#if projects && subIssues.length > 0} +{#if viewlet !== undefined} + {#if projects}