mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-12 05:27:56 +00:00
[UBER-350] Ignore draft value when creating issue from category (#3335)
Signed-off-by: Sergei Ogorelkov <sergei.ogorelkov@icloud.com>
This commit is contained in:
parent
d97f72234b
commit
8802e3204f
@ -73,10 +73,10 @@
|
|||||||
|
|
||||||
export let space: Ref<Project>
|
export let space: Ref<Project>
|
||||||
export let status: Ref<IssueStatus> | undefined = undefined
|
export let status: Ref<IssueStatus> | undefined = undefined
|
||||||
export let priority: IssuePriority = IssuePriority.NoPriority
|
export let priority: IssuePriority | undefined = undefined
|
||||||
export let assignee: Ref<Employee> | null = null
|
export let assignee: Ref<Employee> | null = null
|
||||||
export let component: Ref<ComponentType> | null = $activeComponent ?? null
|
export let component: Ref<ComponentType> | null = null
|
||||||
export let milestone: Ref<Milestone> | null = $activeMilestone ?? null
|
export let milestone: Ref<Milestone> | null = null
|
||||||
export let relatedTo: Doc | undefined
|
export let relatedTo: Doc | undefined
|
||||||
export let shouldSaveDraft: boolean = false
|
export let shouldSaveDraft: boolean = false
|
||||||
export let parentIssue: Issue | undefined
|
export let parentIssue: Issue | undefined
|
||||||
@ -101,7 +101,7 @@
|
|||||||
const parentQuery = createQuery()
|
const parentQuery = createQuery()
|
||||||
|
|
||||||
let _space = draft?.space ?? space
|
let _space = draft?.space ?? space
|
||||||
let object = draft ?? getDefaultObject(id)
|
let object = getDefaultObjectFromDraft() ?? getDefaultObject(id)
|
||||||
let isAssigneeTouched = false
|
let isAssigneeTouched = false
|
||||||
|
|
||||||
function objectChange (object: IssueDraft, empty: any) {
|
function objectChange (object: IssueDraft, empty: any) {
|
||||||
@ -127,18 +127,33 @@
|
|||||||
parentIssue = undefined
|
parentIssue = undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDefaultObjectFromDraft (): IssueDraft | undefined {
|
||||||
|
if (!draft) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...draft,
|
||||||
|
...(status != null ? { status } : {}),
|
||||||
|
...(priority != null ? { priority } : {}),
|
||||||
|
...(assignee != null ? { assignee } : {}),
|
||||||
|
...(component != null ? { component } : {}),
|
||||||
|
...(milestone != null ? { milestone } : {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getDefaultObject (id: Ref<Issue> | undefined = undefined, ignoreOriginal = false): IssueDraft {
|
function getDefaultObject (id: Ref<Issue> | undefined = undefined, ignoreOriginal = false): IssueDraft {
|
||||||
const base: IssueDraft = {
|
const base: IssueDraft = {
|
||||||
_id: id ?? generateId(),
|
_id: id ?? generateId(),
|
||||||
title: '',
|
title: '',
|
||||||
description: '',
|
description: '',
|
||||||
priority,
|
priority: priority ?? IssuePriority.NoPriority,
|
||||||
space: _space,
|
space: _space,
|
||||||
component,
|
component: component ?? $activeComponent ?? null,
|
||||||
dueDate: null,
|
dueDate: null,
|
||||||
attachments: 0,
|
attachments: 0,
|
||||||
estimation: 0,
|
estimation: 0,
|
||||||
milestone,
|
milestone: milestone ?? $activeMilestone ?? null,
|
||||||
status,
|
status,
|
||||||
assignee,
|
assignee,
|
||||||
labels: [],
|
labels: [],
|
||||||
@ -186,9 +201,9 @@
|
|||||||
status: status ?? currentProject?.defaultIssueStatus,
|
status: status ?? currentProject?.defaultIssueStatus,
|
||||||
parentIssue: parentIssue?._id,
|
parentIssue: parentIssue?._id,
|
||||||
description: '<p></p>',
|
description: '<p></p>',
|
||||||
component,
|
component: component ?? $activeComponent ?? null,
|
||||||
milestone,
|
milestone: milestone ?? $activeMilestone ?? null,
|
||||||
priority,
|
priority: priority ?? IssuePriority.NoPriority,
|
||||||
space: _space
|
space: _space
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user