UBER-885: Fix Object filter (#3716)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-09-20 00:21:09 +07:00 committed by GitHub
parent 87ee2a028f
commit 7e0fe4e91f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 15 deletions

View File

@ -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<void> {},
async upgrade (client: MigrationUpgradeClient): Promise<void> {}
async upgrade (client: MigrationUpgradeClient): Promise<void> {
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
)
}
}
}

View File

@ -23,7 +23,6 @@
import tracker from '../../../plugin'
export let query: DocumentQuery<Issue> | 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 }}

View File

@ -13,7 +13,7 @@
// limitations under the License.
-->
<script lang="ts">
import { Doc, DocumentQuery, Ref, SortingOrder } from '@hcengineering/core'
import { Doc, DocumentQuery, Ref } from '@hcengineering/core'
import { createQuery } from '@hcengineering/presentation'
import { Issue, Project } from '@hcengineering/tracker'
import { Label, Spinner } from '@hcengineering/ui'
@ -35,16 +35,8 @@
let query: DocumentQuery<Issue>
$: query = { 'relations._id': object._id, 'relations._class': object._class }
const subIssuesQuery = createQuery()
let subIssues: Issue[] = []
let projects: Map<Ref<Project>, Project> | undefined
$: subIssuesQuery.query(tracker.class.Issue, query, async (result) => (subIssues = result), {
sort: { rank: SortingOrder.Ascending }
})
const projectsQuery = createQuery()
$: projectsQuery.query(tracker.class.Project, {}, async (result) => {
@ -52,12 +44,12 @@
})
</script>
{#if subIssues !== undefined && viewlet !== undefined}
{#if projects && subIssues.length > 0}
{#if viewlet !== undefined}
{#if projects}
<SubIssueList
bind:viewOptions
{viewlet}
issues={subIssues}
{query}
{projects}
{disableHeader}
{compactMode}