mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-17 05:47:32 +00:00
add active/backlog tabs to all issues (#3208)
Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
This commit is contained in:
parent
683efe95b3
commit
b2c9527b16
@ -1003,13 +1003,6 @@ export function createModel (builder: Builder): void {
|
|||||||
locationResolver: tracker.resolver.Location,
|
locationResolver: tracker.resolver.Location,
|
||||||
navigatorModel: {
|
navigatorModel: {
|
||||||
specials: [
|
specials: [
|
||||||
// {
|
|
||||||
// id: 'inbox',
|
|
||||||
// position: 'top',
|
|
||||||
// label: tracker.string.Inbox,
|
|
||||||
// icon: tracker.icon.Inbox,
|
|
||||||
// component: tracker.component.Inbox
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
id: myIssuesId,
|
id: myIssuesId,
|
||||||
position: 'top',
|
position: 'top',
|
||||||
@ -1022,20 +1015,13 @@ export function createModel (builder: Builder): void {
|
|||||||
position: 'top',
|
position: 'top',
|
||||||
label: tracker.string.AllIssues,
|
label: tracker.string.AllIssues,
|
||||||
icon: tracker.icon.Issues,
|
icon: tracker.icon.Issues,
|
||||||
component: tracker.component.IssuesView,
|
component: tracker.component.Issues,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
query: { '$lookup.space.archived': false },
|
baseQuery: { '$lookup.space.archived': false },
|
||||||
space: undefined,
|
space: undefined,
|
||||||
title: tracker.string.AllIssues
|
title: tracker.string.AllIssues
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// {
|
|
||||||
// id: 'views',
|
|
||||||
// position: 'top',
|
|
||||||
// label: tracker.string.Views,
|
|
||||||
// icon: tracker.icon.Views,
|
|
||||||
// component: tracker.component.Views
|
|
||||||
// },
|
|
||||||
],
|
],
|
||||||
spaces: [
|
spaces: [
|
||||||
{
|
{
|
||||||
@ -1049,7 +1035,10 @@ export function createModel (builder: Builder): void {
|
|||||||
id: issuesId,
|
id: issuesId,
|
||||||
label: tracker.string.Issues,
|
label: tracker.string.Issues,
|
||||||
icon: tracker.icon.Issues,
|
icon: tracker.icon.Issues,
|
||||||
component: tracker.component.Issues
|
component: tracker.component.Issues,
|
||||||
|
componentProps: {
|
||||||
|
title: tracker.string.Issues
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: componentsId,
|
id: componentsId,
|
||||||
@ -1063,12 +1052,6 @@ export function createModel (builder: Builder): void {
|
|||||||
icon: tracker.icon.Milestone,
|
icon: tracker.icon.Milestone,
|
||||||
component: tracker.component.Milestones
|
component: tracker.component.Milestones
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// id: scrumsId,
|
|
||||||
// label: tracker.string.Scrums,
|
|
||||||
// icon: tracker.icon.Scrum,
|
|
||||||
// component: tracker.component.Scrums
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
id: templatesId,
|
id: templatesId,
|
||||||
label: tracker.string.IssueTemplates,
|
label: tracker.string.IssueTemplates,
|
||||||
|
@ -21,7 +21,9 @@
|
|||||||
import { createQuery } from '@hcengineering/presentation'
|
import { createQuery } from '@hcengineering/presentation'
|
||||||
import { IModeSelector } from '../../utils'
|
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][] = [
|
const config: [string, IntlString, object][] = [
|
||||||
['all', tracker.string.All, {}],
|
['all', tracker.string.All, {}],
|
||||||
@ -29,7 +31,9 @@
|
|||||||
['backlog', tracker.string.Backlog, {}]
|
['backlog', tracker.string.Backlog, {}]
|
||||||
]
|
]
|
||||||
|
|
||||||
$: all = { space: currentSpace }
|
$: spaceQuery = currentSpace ? { space: currentSpace } : {}
|
||||||
|
|
||||||
|
$: all = { ...baseQuery, ...spaceQuery }
|
||||||
|
|
||||||
const activeStatusQuery = createQuery()
|
const activeStatusQuery = createQuery()
|
||||||
let active: DocumentQuery<Issue>
|
let active: DocumentQuery<Issue>
|
||||||
@ -37,10 +41,10 @@
|
|||||||
tracker.class.IssueStatus,
|
tracker.class.IssueStatus,
|
||||||
{
|
{
|
||||||
category: { $in: [tracker.issueStatusCategory.Unstarted, tracker.issueStatusCategory.Started] },
|
category: { $in: [tracker.issueStatusCategory.Unstarted, tracker.issueStatusCategory.Started] },
|
||||||
space: currentSpace
|
...spaceQuery
|
||||||
},
|
},
|
||||||
(result) => {
|
(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> = {}
|
let backlog: DocumentQuery<Issue> = {}
|
||||||
$: backlogStatusQuery.query(
|
$: backlogStatusQuery.query(
|
||||||
tracker.class.IssueStatus,
|
tracker.class.IssueStatus,
|
||||||
{ category: tracker.issueStatusCategory.Backlog, space: currentSpace },
|
{ category: tracker.issueStatusCategory.Backlog, ...spaceQuery },
|
||||||
(result) => {
|
(result) => {
|
||||||
backlog = { status: { $in: result.map(({ _id }) => _id) }, space: currentSpace }
|
backlog = { status: { $in: result.map(({ _id }) => _id) }, ...spaceQuery }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -71,4 +75,6 @@
|
|||||||
} as IModeSelector
|
} as IModeSelector
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<IssuesView {query} space={currentSpace} title={tracker.string.Issues} {modeSelectorProps} />
|
{#key query && currentSpace}
|
||||||
|
<IssuesView {query} space={currentSpace} {title} {modeSelectorProps} />
|
||||||
|
{/key}
|
||||||
|
Loading…
Reference in New Issue
Block a user