mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 19:58:09 +00:00
uberf-6639: fix create issue default status (#5685)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
parent
2d163bf428
commit
619939b2a5
@ -114,7 +114,7 @@ export async function createState<T extends Status> (
|
|||||||
if (exists !== undefined) {
|
if (exists !== undefined) {
|
||||||
return exists._id as Ref<T>
|
return exists._id as Ref<T>
|
||||||
}
|
}
|
||||||
const res = await client.createDoc(_class, task.space.Statuses, data)
|
const res = await client.createDoc(_class, core.space.Model, data)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,15 +96,18 @@
|
|||||||
return current
|
return current
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defaultIssueStatus !== undefined) {
|
if (defaultIssueStatus !== undefined) {
|
||||||
const res = statuses?.find((status) => status._id === defaultStatus)
|
const res = statuses?.find((status) => status._id === defaultStatus)
|
||||||
void changeStatus(res?._id, false)
|
// Might not exist for projects with multiple task types with different statuses
|
||||||
return res
|
if (res != null) {
|
||||||
|
void changeStatus(res?._id, false)
|
||||||
|
return res
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to choose first one, since it should not be case without status.
|
// We need to choose first one, since it should not be case without status.
|
||||||
if (value.status === undefined) {
|
void changeStatus(statuses?.[0]?._id, false)
|
||||||
void changeStatus(statuses?.[0]?._id, false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$: selectedStatus = getSelectedStatus(statuses, value, defaultIssueStatus)
|
$: selectedStatus = getSelectedStatus(statuses, value, defaultIssueStatus)
|
||||||
|
Loading…
Reference in New Issue
Block a user