mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-12 19:30:52 +00:00
parent
5c83f1f84b
commit
179973ba7f
@ -18,7 +18,13 @@
|
||||
import notification from '@hcengineering/notification'
|
||||
import { Panel } from '@hcengineering/panel'
|
||||
import { getResource } from '@hcengineering/platform'
|
||||
import presentation, { createQuery, getClient, ActionContext, contextStore } from '@hcengineering/presentation'
|
||||
import presentation, {
|
||||
createQuery,
|
||||
getClient,
|
||||
ActionContext,
|
||||
contextStore,
|
||||
ComponentExtensions
|
||||
} from '@hcengineering/presentation'
|
||||
import setting, { settingId } from '@hcengineering/setting'
|
||||
import { Issue, Project } from '@hcengineering/tracker'
|
||||
import {
|
||||
@ -194,6 +200,7 @@
|
||||
</span>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="pre-utils">
|
||||
<ComponentExtensions extension={tracker.extensions.EditIssueHeader} />
|
||||
{#if saved}
|
||||
<Label label={presentation.string.Saved} />
|
||||
{/if}
|
||||
|
@ -24,12 +24,12 @@
|
||||
DatePresenter,
|
||||
deviceOptionsStore as deviceInfo
|
||||
} from '@hcengineering/ui'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { activeMilestone } from '../../issues'
|
||||
import tracker from '../../plugin'
|
||||
import MilestoneSelector from './MilestoneSelector.svelte'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
|
||||
export let value: Issue | IssueTemplate
|
||||
export let value: Issue | Issue[] | IssueTemplate
|
||||
export let space: Ref<Project> | undefined = undefined
|
||||
export let isEditable: boolean = true
|
||||
export let shouldShowLabel: boolean = true
|
||||
@ -51,7 +51,7 @@
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
const handleMilestoneIdChanged = async (newMilestoneId: Ref<Milestone> | null | undefined) => {
|
||||
if (!isEditable || newMilestoneId === undefined || value.milestone === newMilestoneId) {
|
||||
if (!isEditable || newMilestoneId === undefined || (!Array.isArray(value) && value.milestone === newMilestoneId)) {
|
||||
return
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
@ -68,19 +68,19 @@
|
||||
|
||||
const milestoneQuery = createQuery()
|
||||
let milestone: Milestone | undefined
|
||||
$: if (value.milestone) {
|
||||
$: if (!Array.isArray(value) && value.milestone) {
|
||||
milestoneQuery.query(tracker.class.Milestone, { _id: value.milestone }, (res) => {
|
||||
milestone = res.shift()
|
||||
})
|
||||
}
|
||||
|
||||
$: _space = space ?? value.space
|
||||
$: _space = space ?? (!Array.isArray(value) ? value.space : { $in: Array.from(new Set(value.map((it) => it.space))) })
|
||||
|
||||
$: twoRows = $deviceInfo.twoRows
|
||||
</script>
|
||||
|
||||
{#if kind === 'list'}
|
||||
{#if value.milestone}
|
||||
{#if !Array.isArray(value) && value.milestone}
|
||||
<div class={compression ? 'label-wrapper' : 'clear-mins'}>
|
||||
<MilestoneSelector
|
||||
{kind}
|
||||
@ -108,7 +108,7 @@
|
||||
class:label-wrapper={compression}
|
||||
style:flex-direction={twoRows ? 'column' : 'row'}
|
||||
>
|
||||
{#if (value.milestone && value.milestone !== $activeMilestone && groupBy !== 'milestone') || shouldShowPlaceholder}
|
||||
{#if (!Array.isArray(value) && value.milestone && value.milestone !== $activeMilestone && groupBy !== 'milestone') || shouldShowPlaceholder}
|
||||
<div class="flex-row-center" class:minus-margin-vSpace={kind === 'list-header'} class:compression style:width>
|
||||
<MilestoneSelector
|
||||
{kind}
|
||||
@ -122,8 +122,11 @@
|
||||
{onlyIcon}
|
||||
{enlargedText}
|
||||
space={_space}
|
||||
showTooltip={{ label: value.milestone ? tracker.string.MoveToMilestone : tracker.string.AddToMilestone }}
|
||||
value={value.milestone}
|
||||
showTooltip={{
|
||||
label:
|
||||
!Array.isArray(value) && value.milestone ? tracker.string.MoveToMilestone : tracker.string.AddToMilestone
|
||||
}}
|
||||
value={!Array.isArray(value) ? value.milestone : undefined}
|
||||
onChange={handleMilestoneIdChanged}
|
||||
{isAction}
|
||||
/>
|
||||
|
@ -13,17 +13,17 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Ref, SortingOrder } from '@hcengineering/core'
|
||||
import { getEmbeddedLabel, IntlString, translate } from '@hcengineering/platform'
|
||||
import { DocumentQuery, Ref, SortingOrder } from '@hcengineering/core'
|
||||
import { IntlString, getEmbeddedLabel, translate } from '@hcengineering/platform'
|
||||
import { createQuery } from '@hcengineering/presentation'
|
||||
import { Milestone, Project } from '@hcengineering/tracker'
|
||||
import { Milestone } from '@hcengineering/tracker'
|
||||
import type { ButtonKind, ButtonSize, LabelAndProps } from '@hcengineering/ui'
|
||||
import { Button, ButtonShape, eventToHTMLElement, SelectPopup, showPopup, Label, themeStore } from '@hcengineering/ui'
|
||||
import { Button, ButtonShape, Label, SelectPopup, eventToHTMLElement, showPopup, 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 space: DocumentQuery<Milestone>['space'] | undefined = undefined
|
||||
export let shouldShowLabel: boolean = true
|
||||
export let isEditable: boolean = true
|
||||
export let onChange: ((newMilestoneId: Ref<Milestone> | undefined) => void) | undefined = undefined
|
||||
|
@ -487,6 +487,7 @@ export default plugin(trackerId, {
|
||||
ProjectIssueTargetOptions: '' as Ref<Mixin<ProjectIssueTargetOptions>>
|
||||
},
|
||||
extensions: {
|
||||
IssueListHeader: '' as ComponentExtensionId
|
||||
IssueListHeader: '' as ComponentExtensionId,
|
||||
EditIssueHeader: '' as ComponentExtensionId
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user