mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +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=""
|
||||
{states}
|
||||
{options}
|
||||
query={{}}
|
||||
query={{ attachedTo: tracker.ids.NoParent }}
|
||||
fieldName={'status'}
|
||||
rankFieldName={'rank'}
|
||||
on:content={(evt) => {
|
||||
|
@ -2,18 +2,13 @@
|
||||
import type { Ref, WithLookup } from '@anticrm/core'
|
||||
import { Component } from '@anticrm/ui'
|
||||
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 viewlet: WithLookup<Viewlet> | undefined
|
||||
export let config: (string | BuildModelKey)[] | undefined = undefined
|
||||
export let query = {}
|
||||
export let viewOptions: {
|
||||
groupBy: IssuesGrouping
|
||||
orderBy: IssuesOrdering
|
||||
completedIssuesPeriod: IssuesDateModificationPeriod
|
||||
shouldShowEmptyGroups: boolean
|
||||
}
|
||||
export let viewOptions: ViewOptions
|
||||
</script>
|
||||
|
||||
{#if viewlet?.$lookup?.descriptor?.component}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
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 { Filter, Viewlet } from '@anticrm/view'
|
||||
import { FilterButton } from '@anticrm/view-resources'
|
||||
@ -12,12 +12,7 @@
|
||||
export let viewlets: WithLookup<Viewlet>[] = []
|
||||
export let label: string
|
||||
export let filters: Filter[] = []
|
||||
export let viewOptions: {
|
||||
groupBy: IssuesGrouping
|
||||
orderBy: IssuesOrdering
|
||||
completedIssuesPeriod: IssuesDateModificationPeriod
|
||||
shouldShowEmptyGroups: boolean
|
||||
}
|
||||
export let viewOptions: ViewOptions
|
||||
|
||||
const handleOptionsEditorOpened = (event: MouseEvent) => {
|
||||
if (!currentSpace) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
import core, { Ref, Space, WithLookup } from '@anticrm/core'
|
||||
import { IntlString, translate } from '@anticrm/platform'
|
||||
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 view, { Filter, Viewlet } from '@anticrm/view'
|
||||
import { FilterBar } from '@anticrm/view-resources'
|
||||
@ -19,11 +19,12 @@
|
||||
|
||||
let viewlet: WithLookup<Viewlet> | undefined = undefined
|
||||
let filters: Filter[]
|
||||
let viewOptions = {
|
||||
let viewOptions: ViewOptions = {
|
||||
groupBy: IssuesGrouping.Status,
|
||||
orderBy: IssuesOrdering.Status,
|
||||
completedIssuesPeriod: IssuesDateModificationPeriod.All,
|
||||
shouldShowEmptyGroups: false
|
||||
shouldShowEmptyGroups: false,
|
||||
shouldShowSubIssues: false
|
||||
}
|
||||
let resultQuery = {}
|
||||
|
||||
|
@ -2,14 +2,7 @@
|
||||
import { ScrollBox } from '@anticrm/ui'
|
||||
import IssuesListBrowser from './IssuesListBrowser.svelte'
|
||||
import tracker from '../../plugin'
|
||||
import {
|
||||
Issue,
|
||||
IssuesDateModificationPeriod,
|
||||
IssuesGrouping,
|
||||
IssuesOrdering,
|
||||
IssueStatus,
|
||||
Team
|
||||
} from '@anticrm/tracker'
|
||||
import { Issue, IssueStatus, Team, ViewOptions } from '@anticrm/tracker'
|
||||
import { Class, Doc, Ref, SortingOrder, WithLookup } from '@anticrm/core'
|
||||
import {
|
||||
getCategories,
|
||||
@ -26,16 +19,12 @@
|
||||
export let currentSpace: Ref<Team>
|
||||
export let config: (string | BuildModelKey)[]
|
||||
export let query = {}
|
||||
export let viewOptions: {
|
||||
groupBy: IssuesGrouping
|
||||
orderBy: IssuesOrdering
|
||||
completedIssuesPeriod: IssuesDateModificationPeriod
|
||||
shouldShowEmptyGroups: boolean
|
||||
}
|
||||
export let viewOptions: ViewOptions
|
||||
|
||||
$: ({ groupBy, orderBy, shouldShowEmptyGroups } = viewOptions)
|
||||
$: ({ groupBy, orderBy, shouldShowEmptyGroups, shouldShowSubIssues } = viewOptions)
|
||||
$: groupByKey = issuesGroupKeyMap[groupBy]
|
||||
$: orderByKey = issuesOrderKeyMap[orderBy]
|
||||
$: subIssuesQuery = shouldShowSubIssues ? {} : { attachedTo: tracker.ids.NoParent }
|
||||
|
||||
const statusesQuery = createQuery()
|
||||
let statuses: IssueStatus[] = []
|
||||
@ -58,7 +47,7 @@
|
||||
let issues: WithLookup<Issue>[] = []
|
||||
$: issuesQuery.query(
|
||||
tracker.class.Issue,
|
||||
query,
|
||||
{ ...subIssuesQuery, ...query },
|
||||
(result) => {
|
||||
issues = result
|
||||
},
|
||||
|
@ -172,6 +172,17 @@ export interface Project extends Doc {
|
||||
documents: number
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ViewOptions {
|
||||
groupBy: IssuesGrouping
|
||||
orderBy: IssuesOrdering
|
||||
completedIssuesPeriod: IssuesDateModificationPeriod
|
||||
shouldShowEmptyGroups: boolean
|
||||
shouldShowSubIssues: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user