mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 00:37:47 +00:00
[TSK-1491] Fix empty sprint status on popup close (#3175)
Signed-off-by: Sergei Ogorelkov <sergei.ogorelkov@icloud.com>
This commit is contained in:
parent
dd712fcdd7
commit
ee0a120450
@ -40,6 +40,8 @@ import {
|
|||||||
IssueTemplate,
|
IssueTemplate,
|
||||||
IssueTemplateChild,
|
IssueTemplateChild,
|
||||||
Project,
|
Project,
|
||||||
|
Sprint,
|
||||||
|
SprintStatus,
|
||||||
TimeReportDayType
|
TimeReportDayType
|
||||||
} from '@hcengineering/tracker'
|
} from '@hcengineering/tracker'
|
||||||
import { DOMAIN_TRACKER } from '.'
|
import { DOMAIN_TRACKER } from '.'
|
||||||
@ -730,6 +732,14 @@ async function setCreate (client: MigrationClient): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fixSprintEmptyStatuses (client: MigrationClient): Promise<void> {
|
||||||
|
await client.update<Sprint>(
|
||||||
|
DOMAIN_TRACKER,
|
||||||
|
{ _class: tracker.class.Sprint, $or: [{ status: null }, { status: undefined }] },
|
||||||
|
{ status: SprintStatus.Planned }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export const trackerOperation: MigrateOperation = {
|
export const trackerOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {
|
async migrate (client: MigrationClient): Promise<void> {
|
||||||
await client.update(
|
await client.update(
|
||||||
@ -762,6 +772,8 @@ export const trackerOperation: MigrateOperation = {
|
|||||||
ofAttribute: tracker.attribute.IssueStatus
|
ofAttribute: tracker.attribute.IssueStatus
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
await fixSprintEmptyStatuses(client)
|
||||||
},
|
},
|
||||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||||
const tx = new TxOperations(client, core.account.System)
|
const tx = new TxOperations(client, core.account.System)
|
||||||
|
@ -20,12 +20,20 @@
|
|||||||
import SprintStatusSelector from './SprintStatusSelector.svelte'
|
import SprintStatusSelector from './SprintStatusSelector.svelte'
|
||||||
|
|
||||||
export let value: SprintStatus
|
export let value: SprintStatus
|
||||||
export let onChange: ((value: SprintStatus | undefined) => void) | undefined = undefined
|
export let onChange: ((value: SprintStatus) => void) | undefined = undefined
|
||||||
export let kind: ButtonKind = 'link'
|
export let kind: ButtonKind = 'link'
|
||||||
export let size: ButtonSize = 'large'
|
export let size: ButtonSize = 'large'
|
||||||
export let justify: 'left' | 'center' = 'left'
|
export let justify: 'left' | 'center' = 'left'
|
||||||
export let width: string | undefined = '100%'
|
export let width: string | undefined = '100%'
|
||||||
|
|
||||||
|
function handleComponentStatusChange (newSprintStatus: SprintStatus | undefined) {
|
||||||
|
if (newSprintStatus === undefined || onChange === undefined) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
onChange(newSprintStatus)
|
||||||
|
}
|
||||||
|
|
||||||
$: isEditable = onChange !== undefined
|
$: isEditable = onChange !== undefined
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -37,5 +45,5 @@
|
|||||||
{isEditable}
|
{isEditable}
|
||||||
showTooltip={isEditable ? { label: tracker.string.SetStatus } : undefined}
|
showTooltip={isEditable ? { label: tracker.string.SetStatus } : undefined}
|
||||||
selectedSprintStatus={value}
|
selectedSprintStatus={value}
|
||||||
onSprintStatusChange={onChange}
|
onSprintStatusChange={handleComponentStatusChange}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user