mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-21 07:46:24 +00:00
Filter subissues (#2051)
Signed-off-by: Dvinyanin Alexandr <dvinyanin.alexandr@gmail.com>
This commit is contained in:
parent
156afd757a
commit
29f46845a9
@ -115,7 +115,7 @@
|
|||||||
search=""
|
search=""
|
||||||
{states}
|
{states}
|
||||||
{options}
|
{options}
|
||||||
query={{}}
|
query={{ attachedTo: tracker.ids.NoParent }}
|
||||||
fieldName={'status'}
|
fieldName={'status'}
|
||||||
rankFieldName={'rank'}
|
rankFieldName={'rank'}
|
||||||
on:content={(evt) => {
|
on:content={(evt) => {
|
||||||
|
@ -2,18 +2,13 @@
|
|||||||
import type { Ref, WithLookup } from '@anticrm/core'
|
import type { Ref, WithLookup } from '@anticrm/core'
|
||||||
import { Component } from '@anticrm/ui'
|
import { Component } from '@anticrm/ui'
|
||||||
import { BuildModelKey, Viewlet } from '@anticrm/view'
|
import { BuildModelKey, Viewlet } from '@anticrm/view'
|
||||||
import { IssuesDateModificationPeriod, IssuesGrouping, IssuesOrdering, Team } from '@anticrm/tracker'
|
import { Team, ViewOptions } from '@anticrm/tracker'
|
||||||
|
|
||||||
export let currentSpace: Ref<Team>
|
export let currentSpace: Ref<Team>
|
||||||
export let viewlet: WithLookup<Viewlet> | undefined
|
export let viewlet: WithLookup<Viewlet> | undefined
|
||||||
export let config: (string | BuildModelKey)[] | undefined = undefined
|
export let config: (string | BuildModelKey)[] | undefined = undefined
|
||||||
export let query = {}
|
export let query = {}
|
||||||
export let viewOptions: {
|
export let viewOptions: ViewOptions
|
||||||
groupBy: IssuesGrouping
|
|
||||||
orderBy: IssuesOrdering
|
|
||||||
completedIssuesPeriod: IssuesDateModificationPeriod
|
|
||||||
shouldShowEmptyGroups: boolean
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if viewlet?.$lookup?.descriptor?.component}
|
{#if viewlet?.$lookup?.descriptor?.component}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Ref, WithLookup } from '@anticrm/core'
|
import { Ref, WithLookup } from '@anticrm/core'
|
||||||
import { IssuesDateModificationPeriod, IssuesGrouping, IssuesOrdering, Team } from '@anticrm/tracker'
|
import { Team, ViewOptions } from '@anticrm/tracker'
|
||||||
import { Button, Icon, Tooltip, IconOptions, showPopup, eventToHTMLElement } from '@anticrm/ui'
|
import { Button, Icon, Tooltip, IconOptions, showPopup, eventToHTMLElement } from '@anticrm/ui'
|
||||||
import { Filter, Viewlet } from '@anticrm/view'
|
import { Filter, Viewlet } from '@anticrm/view'
|
||||||
import { FilterButton } from '@anticrm/view-resources'
|
import { FilterButton } from '@anticrm/view-resources'
|
||||||
@ -12,12 +12,7 @@
|
|||||||
export let viewlets: WithLookup<Viewlet>[] = []
|
export let viewlets: WithLookup<Viewlet>[] = []
|
||||||
export let label: string
|
export let label: string
|
||||||
export let filters: Filter[] = []
|
export let filters: Filter[] = []
|
||||||
export let viewOptions: {
|
export let viewOptions: ViewOptions
|
||||||
groupBy: IssuesGrouping
|
|
||||||
orderBy: IssuesOrdering
|
|
||||||
completedIssuesPeriod: IssuesDateModificationPeriod
|
|
||||||
shouldShowEmptyGroups: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleOptionsEditorOpened = (event: MouseEvent) => {
|
const handleOptionsEditorOpened = (event: MouseEvent) => {
|
||||||
if (!currentSpace) {
|
if (!currentSpace) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import core, { Ref, Space, WithLookup } from '@anticrm/core'
|
import core, { Ref, Space, WithLookup } from '@anticrm/core'
|
||||||
import { IntlString, translate } from '@anticrm/platform'
|
import { IntlString, translate } from '@anticrm/platform'
|
||||||
import { getClient } from '@anticrm/presentation'
|
import { getClient } from '@anticrm/presentation'
|
||||||
import { IssuesDateModificationPeriod, IssuesGrouping, IssuesOrdering, Team } from '@anticrm/tracker'
|
import { IssuesDateModificationPeriod, IssuesGrouping, IssuesOrdering, Team, ViewOptions } from '@anticrm/tracker'
|
||||||
import { Button, IconDetails } from '@anticrm/ui'
|
import { Button, IconDetails } from '@anticrm/ui'
|
||||||
import view, { Filter, Viewlet } from '@anticrm/view'
|
import view, { Filter, Viewlet } from '@anticrm/view'
|
||||||
import { FilterBar } from '@anticrm/view-resources'
|
import { FilterBar } from '@anticrm/view-resources'
|
||||||
@ -19,11 +19,12 @@
|
|||||||
|
|
||||||
let viewlet: WithLookup<Viewlet> | undefined = undefined
|
let viewlet: WithLookup<Viewlet> | undefined = undefined
|
||||||
let filters: Filter[]
|
let filters: Filter[]
|
||||||
let viewOptions = {
|
let viewOptions: ViewOptions = {
|
||||||
groupBy: IssuesGrouping.Status,
|
groupBy: IssuesGrouping.Status,
|
||||||
orderBy: IssuesOrdering.Status,
|
orderBy: IssuesOrdering.Status,
|
||||||
completedIssuesPeriod: IssuesDateModificationPeriod.All,
|
completedIssuesPeriod: IssuesDateModificationPeriod.All,
|
||||||
shouldShowEmptyGroups: false
|
shouldShowEmptyGroups: false,
|
||||||
|
shouldShowSubIssues: false
|
||||||
}
|
}
|
||||||
let resultQuery = {}
|
let resultQuery = {}
|
||||||
|
|
||||||
|
@ -2,14 +2,7 @@
|
|||||||
import { ScrollBox } from '@anticrm/ui'
|
import { ScrollBox } from '@anticrm/ui'
|
||||||
import IssuesListBrowser from './IssuesListBrowser.svelte'
|
import IssuesListBrowser from './IssuesListBrowser.svelte'
|
||||||
import tracker from '../../plugin'
|
import tracker from '../../plugin'
|
||||||
import {
|
import { Issue, IssueStatus, Team, ViewOptions } from '@anticrm/tracker'
|
||||||
Issue,
|
|
||||||
IssuesDateModificationPeriod,
|
|
||||||
IssuesGrouping,
|
|
||||||
IssuesOrdering,
|
|
||||||
IssueStatus,
|
|
||||||
Team
|
|
||||||
} from '@anticrm/tracker'
|
|
||||||
import { Class, Doc, Ref, SortingOrder, WithLookup } from '@anticrm/core'
|
import { Class, Doc, Ref, SortingOrder, WithLookup } from '@anticrm/core'
|
||||||
import {
|
import {
|
||||||
getCategories,
|
getCategories,
|
||||||
@ -26,16 +19,12 @@
|
|||||||
export let currentSpace: Ref<Team>
|
export let currentSpace: Ref<Team>
|
||||||
export let config: (string | BuildModelKey)[]
|
export let config: (string | BuildModelKey)[]
|
||||||
export let query = {}
|
export let query = {}
|
||||||
export let viewOptions: {
|
export let viewOptions: ViewOptions
|
||||||
groupBy: IssuesGrouping
|
|
||||||
orderBy: IssuesOrdering
|
|
||||||
completedIssuesPeriod: IssuesDateModificationPeriod
|
|
||||||
shouldShowEmptyGroups: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
$: ({ groupBy, orderBy, shouldShowEmptyGroups } = viewOptions)
|
$: ({ groupBy, orderBy, shouldShowEmptyGroups, shouldShowSubIssues } = viewOptions)
|
||||||
$: groupByKey = issuesGroupKeyMap[groupBy]
|
$: groupByKey = issuesGroupKeyMap[groupBy]
|
||||||
$: orderByKey = issuesOrderKeyMap[orderBy]
|
$: orderByKey = issuesOrderKeyMap[orderBy]
|
||||||
|
$: subIssuesQuery = shouldShowSubIssues ? {} : { attachedTo: tracker.ids.NoParent }
|
||||||
|
|
||||||
const statusesQuery = createQuery()
|
const statusesQuery = createQuery()
|
||||||
let statuses: IssueStatus[] = []
|
let statuses: IssueStatus[] = []
|
||||||
@ -58,7 +47,7 @@
|
|||||||
let issues: WithLookup<Issue>[] = []
|
let issues: WithLookup<Issue>[] = []
|
||||||
$: issuesQuery.query(
|
$: issuesQuery.query(
|
||||||
tracker.class.Issue,
|
tracker.class.Issue,
|
||||||
query,
|
{ ...subIssuesQuery, ...query },
|
||||||
(result) => {
|
(result) => {
|
||||||
issues = result
|
issues = result
|
||||||
},
|
},
|
||||||
|
@ -172,6 +172,17 @@ export interface Project extends Doc {
|
|||||||
documents: number
|
documents: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export interface ViewOptions {
|
||||||
|
groupBy: IssuesGrouping
|
||||||
|
orderBy: IssuesOrdering
|
||||||
|
completedIssuesPeriod: IssuesDateModificationPeriod
|
||||||
|
shouldShowEmptyGroups: boolean
|
||||||
|
shouldShowSubIssues: boolean
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user