mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-08 21:27:45 +03:00
UBER-885: Fix Object filter (#3716)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
87ee2a028f
commit
7e0fe4e91f
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 }}
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user