mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 08:20:39 +00: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.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
import core, { TxOperations } from '@hcengineering/core'
|
||||||
import { MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@hcengineering/model'
|
import { MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@hcengineering/model'
|
||||||
|
|
||||||
export const coreOperation: MigrateOperation = {
|
export const coreOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {},
|
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'
|
import tracker from '../../../plugin'
|
||||||
|
|
||||||
export let query: DocumentQuery<Issue> | undefined = undefined
|
export let query: DocumentQuery<Issue> | undefined = undefined
|
||||||
export let issues: Issue[] | undefined = undefined
|
|
||||||
export let viewlet: Viewlet
|
export let viewlet: Viewlet
|
||||||
export let viewOptions: ViewOptions
|
export let viewOptions: ViewOptions
|
||||||
export let disableHeader: boolean = false
|
export let disableHeader: boolean = false
|
||||||
@ -83,7 +82,6 @@
|
|||||||
viewOptionsConfig={viewlet.viewOptions?.other}
|
viewOptionsConfig={viewlet.viewOptions?.other}
|
||||||
config={preference.find((it) => it.attachedTo === viewlet._id)?.config ?? viewlet.config}
|
config={preference.find((it) => it.attachedTo === viewlet._id)?.config ?? viewlet.config}
|
||||||
{configurations}
|
{configurations}
|
||||||
documents={issues}
|
|
||||||
{query}
|
{query}
|
||||||
flatHeaders={true}
|
flatHeaders={true}
|
||||||
props={{ projects }}
|
props={{ projects }}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Doc, DocumentQuery, Ref, SortingOrder } from '@hcengineering/core'
|
import { Doc, DocumentQuery, Ref } from '@hcengineering/core'
|
||||||
import { createQuery } from '@hcengineering/presentation'
|
import { createQuery } from '@hcengineering/presentation'
|
||||||
import { Issue, Project } from '@hcengineering/tracker'
|
import { Issue, Project } from '@hcengineering/tracker'
|
||||||
import { Label, Spinner } from '@hcengineering/ui'
|
import { Label, Spinner } from '@hcengineering/ui'
|
||||||
@ -35,16 +35,8 @@
|
|||||||
let query: DocumentQuery<Issue>
|
let query: DocumentQuery<Issue>
|
||||||
$: query = { 'relations._id': object._id, 'relations._class': object._class }
|
$: query = { 'relations._id': object._id, 'relations._class': object._class }
|
||||||
|
|
||||||
const subIssuesQuery = createQuery()
|
|
||||||
|
|
||||||
let subIssues: Issue[] = []
|
|
||||||
|
|
||||||
let projects: Map<Ref<Project>, Project> | undefined
|
let projects: Map<Ref<Project>, Project> | undefined
|
||||||
|
|
||||||
$: subIssuesQuery.query(tracker.class.Issue, query, async (result) => (subIssues = result), {
|
|
||||||
sort: { rank: SortingOrder.Ascending }
|
|
||||||
})
|
|
||||||
|
|
||||||
const projectsQuery = createQuery()
|
const projectsQuery = createQuery()
|
||||||
|
|
||||||
$: projectsQuery.query(tracker.class.Project, {}, async (result) => {
|
$: projectsQuery.query(tracker.class.Project, {}, async (result) => {
|
||||||
@ -52,12 +44,12 @@
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if subIssues !== undefined && viewlet !== undefined}
|
{#if viewlet !== undefined}
|
||||||
{#if projects && subIssues.length > 0}
|
{#if projects}
|
||||||
<SubIssueList
|
<SubIssueList
|
||||||
bind:viewOptions
|
bind:viewOptions
|
||||||
{viewlet}
|
{viewlet}
|
||||||
issues={subIssues}
|
{query}
|
||||||
{projects}
|
{projects}
|
||||||
{disableHeader}
|
{disableHeader}
|
||||||
{compactMode}
|
{compactMode}
|
||||||
|
Loading…
Reference in New Issue
Block a user