mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 11:42:30 +03: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,
|
||||
IssueTemplateChild,
|
||||
Project,
|
||||
Sprint,
|
||||
SprintStatus,
|
||||
TimeReportDayType
|
||||
} from '@hcengineering/tracker'
|
||||
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 = {
|
||||
async migrate (client: MigrationClient): Promise<void> {
|
||||
await client.update(
|
||||
@ -762,6 +772,8 @@ export const trackerOperation: MigrateOperation = {
|
||||
ofAttribute: tracker.attribute.IssueStatus
|
||||
}
|
||||
)
|
||||
|
||||
await fixSprintEmptyStatuses(client)
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
|
@ -20,12 +20,20 @@
|
||||
import SprintStatusSelector from './SprintStatusSelector.svelte'
|
||||
|
||||
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 size: ButtonSize = 'large'
|
||||
export let justify: 'left' | 'center' = 'left'
|
||||
export let width: string | undefined = '100%'
|
||||
|
||||
function handleComponentStatusChange (newSprintStatus: SprintStatus | undefined) {
|
||||
if (newSprintStatus === undefined || onChange === undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
onChange(newSprintStatus)
|
||||
}
|
||||
|
||||
$: isEditable = onChange !== undefined
|
||||
</script>
|
||||
|
||||
@ -37,5 +45,5 @@
|
||||
{isEditable}
|
||||
showTooltip={isEditable ? { label: tracker.string.SetStatus } : undefined}
|
||||
selectedSprintStatus={value}
|
||||
onSprintStatusChange={onChange}
|
||||
onSprintStatusChange={handleComponentStatusChange}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user