UBER-751 Filter components and milestones by project (#3600)

Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2023-08-17 13:34:16 +07:00
committed by GitHub
parent 2a26b85a6a
commit c28fc1014d
8 changed files with 22 additions and 10 deletions
@@ -723,6 +723,7 @@
<ComponentSelector
focusIndex={8}
value={object.component}
space={_space}
onChange={handleComponentIdChanged}
isEditable={true}
kind={'regular'}
@@ -736,8 +737,8 @@
<MilestoneSelector
focusIndex={9}
value={object.milestone}
space={_space}
onChange={handleMilestoneIdChanged}
useComponent={(!originalIssue && object.component) || undefined}
kind={'regular'}
size={'large'}
short
@@ -53,6 +53,8 @@
await client.update(value, { component: newComponentId })
}
}
$: _space = space ?? ('space' in value ? value.space : undefined)
</script>
{#if (value.component && value.component !== $activeComponent && groupBy !== 'component') || shouldShowPlaceholder}
@@ -67,13 +69,13 @@
{shape}
{width}
{justify}
{space}
{isEditable}
{shouldShowLabel}
{popupPlaceholder}
{onlyIcon}
{enlargedText}
{shrink}
space={_space}
value={value.component}
short={compression}
onChange={handleComponentIdChanged}
@@ -384,6 +384,7 @@
{#if enabledConfig(config, 'component')}
<ComponentEditor
value={issue}
{space}
isEditable={true}
kind={'link-bordered'}
size={'small'}
@@ -173,12 +173,12 @@
<span class="label">
<Label label={tracker.string.Component} />
</span>
<ComponentEditor value={issue} size={'medium'} />
<ComponentEditor value={issue} space={issue.space} size={'medium'} />
<span class="label">
<Label label={tracker.string.Milestone} />
</span>
<MilestoneEditor value={issue} size={'medium'} />
<MilestoneEditor value={issue} space={issue.space} size={'medium'} />
{#if issue.dueDate !== null}
<div class="divider" />
@@ -16,7 +16,7 @@
import { Ref } from '@hcengineering/core'
import { IntlString } from '@hcengineering/platform'
import { createQuery, getClient } from '@hcengineering/presentation'
import { Issue, IssueTemplate, Milestone } from '@hcengineering/tracker'
import { Issue, IssueTemplate, Milestone, Project } from '@hcengineering/tracker'
import {
ButtonKind,
ButtonShape,
@@ -30,6 +30,7 @@
import { createEventDispatcher } from 'svelte'
export let value: Issue | IssueTemplate
export let space: Ref<Project> | undefined = undefined
export let isEditable: boolean = true
export let shouldShowLabel: boolean = true
export let popupPlaceholder: IntlString = tracker.string.MoveToMilestone
@@ -73,6 +74,8 @@
})
}
$: _space = space ?? value.space
$: twoRows = $deviceInfo.twoRows
</script>
@@ -89,6 +92,7 @@
{popupPlaceholder}
{onlyIcon}
{enlargedText}
space={_space}
short={compression}
showTooltip={{ label: value.milestone ? tracker.string.MoveToMilestone : tracker.string.AddToMilestone }}
value={value.milestone}
@@ -117,6 +121,7 @@
{popupPlaceholder}
{onlyIcon}
{enlargedText}
space={_space}
showTooltip={{ label: value.milestone ? tracker.string.MoveToMilestone : tracker.string.AddToMilestone }}
value={value.milestone}
onChange={handleMilestoneIdChanged}
@@ -16,13 +16,14 @@
import { Ref, SortingOrder } from '@hcengineering/core'
import { getEmbeddedLabel, IntlString, translate } from '@hcengineering/platform'
import { createQuery } from '@hcengineering/presentation'
import { Component, Milestone } from '@hcengineering/tracker'
import { Milestone, Project } from '@hcengineering/tracker'
import type { ButtonKind, ButtonSize, LabelAndProps } from '@hcengineering/ui'
import { Button, ButtonShape, eventToHTMLElement, SelectPopup, showPopup, Label, themeStore } from '@hcengineering/ui'
import tracker from '../../plugin'
import { milestoneStatusAssets } from '../../types'
export let value: Ref<Milestone> | null | undefined
export let space: Ref<Project> | undefined = undefined
export let shouldShowLabel: boolean = true
export let isEditable: boolean = true
export let onChange: ((newMilestoneId: Ref<Milestone> | undefined) => void) | undefined = undefined
@@ -38,7 +39,6 @@
export let focusIndex: number | undefined = undefined
export let isAction: boolean = false
export let useComponent: Ref<Component> | undefined = undefined
export let showTooltip: LabelAndProps | undefined = undefined
let selectedMilestone: Milestone | undefined
@@ -46,9 +46,9 @@
const query = createQuery()
let rawMilestones: Milestone[] = []
query.query(
$: query.query(
tracker.class.Milestone,
useComponent ? { component: useComponent } : {},
space ? { space } : {},
(res) => {
rawMilestones = res
},
@@ -204,6 +204,7 @@
/>
<EstimationEditor kind={'regular'} size={'large'} value={object} />
<ComponentSelector
{space}
value={object.component}
onChange={handleComponentIdChanged}
isEditable={true}
@@ -211,9 +212,9 @@
size={'large'}
/>
<MilestoneSelector
{space}
value={object.milestone}
onChange={handleMilestoneIdChanged}
useComponent={object.component ?? undefined}
kind={'regular'}
size={'large'}
/>
+2
View File
@@ -954,6 +954,8 @@ const view = plugin(viewId, {
attribute: string
isAction?: boolean
fillProps?: Record<string, string>
// Or list of values to select from
values?: { icon?: Asset, label: IntlString, id: number | string }[]
}>