add active/backlog tabs to all issues (#3208)

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
This commit is contained in:
Ruslan Bayandinov 2023-05-18 01:29:49 +07:00 committed by GitHub
parent 683efe95b3
commit b2c9527b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 30 deletions

View File

@ -1003,13 +1003,6 @@ export function createModel (builder: Builder): void {
locationResolver: tracker.resolver.Location,
navigatorModel: {
specials: [
// {
// id: 'inbox',
// position: 'top',
// label: tracker.string.Inbox,
// icon: tracker.icon.Inbox,
// component: tracker.component.Inbox
// },
{
id: myIssuesId,
position: 'top',
@ -1022,20 +1015,13 @@ export function createModel (builder: Builder): void {
position: 'top',
label: tracker.string.AllIssues,
icon: tracker.icon.Issues,
component: tracker.component.IssuesView,
component: tracker.component.Issues,
componentProps: {
query: { '$lookup.space.archived': false },
baseQuery: { '$lookup.space.archived': false },
space: undefined,
title: tracker.string.AllIssues
}
}
// {
// id: 'views',
// position: 'top',
// label: tracker.string.Views,
// icon: tracker.icon.Views,
// component: tracker.component.Views
// },
],
spaces: [
{
@ -1049,7 +1035,10 @@ export function createModel (builder: Builder): void {
id: issuesId,
label: tracker.string.Issues,
icon: tracker.icon.Issues,
component: tracker.component.Issues
component: tracker.component.Issues,
componentProps: {
title: tracker.string.Issues
}
},
{
id: componentsId,
@ -1063,12 +1052,6 @@ export function createModel (builder: Builder): void {
icon: tracker.icon.Milestone,
component: tracker.component.Milestones
},
// {
// id: scrumsId,
// label: tracker.string.Scrums,
// icon: tracker.icon.Scrum,
// component: tracker.component.Scrums
// },
{
id: templatesId,
label: tracker.string.IssueTemplates,

View File

@ -21,7 +21,9 @@
import { createQuery } from '@hcengineering/presentation'
import { IModeSelector } from '../../utils'
export let currentSpace: Ref<Project>
export let currentSpace: Ref<Project> | undefined = undefined
export let baseQuery: DocumentQuery<Issue> = {}
export let title: IntlString
const config: [string, IntlString, object][] = [
['all', tracker.string.All, {}],
@ -29,7 +31,9 @@
['backlog', tracker.string.Backlog, {}]
]
$: all = { space: currentSpace }
$: spaceQuery = currentSpace ? { space: currentSpace } : {}
$: all = { ...baseQuery, ...spaceQuery }
const activeStatusQuery = createQuery()
let active: DocumentQuery<Issue>
@ -37,10 +41,10 @@
tracker.class.IssueStatus,
{
category: { $in: [tracker.issueStatusCategory.Unstarted, tracker.issueStatusCategory.Started] },
space: currentSpace
...spaceQuery
},
(result) => {
active = { status: { $in: result.map(({ _id }) => _id) }, space: currentSpace }
active = { status: { $in: result.map(({ _id }) => _id) }, ...spaceQuery }
}
)
@ -48,9 +52,9 @@
let backlog: DocumentQuery<Issue> = {}
$: backlogStatusQuery.query(
tracker.class.IssueStatus,
{ category: tracker.issueStatusCategory.Backlog, space: currentSpace },
{ category: tracker.issueStatusCategory.Backlog, ...spaceQuery },
(result) => {
backlog = { status: { $in: result.map(({ _id }) => _id) }, space: currentSpace }
backlog = { status: { $in: result.map(({ _id }) => _id) }, ...spaceQuery }
}
)
@ -71,4 +75,6 @@
} as IModeSelector
</script>
<IssuesView {query} space={currentSpace} title={tracker.string.Issues} {modeSelectorProps} />
{#key query && currentSpace}
<IssuesView {query} space={currentSpace} {title} {modeSelectorProps} />
{/key}