From 93bc04843f19c99e5795f9c66976ef7ceeec328b Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Thu, 6 Apr 2023 10:52:56 +0600 Subject: [PATCH] SubIssues status another project fix (#2904) Signed-off-by: Denis Bykhov --- .../src/components/SubIssues.svelte | 13 +++++++++++++ .../templates/DraftIssueChildEditor.svelte | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/plugins/tracker-resources/src/components/SubIssues.svelte b/plugins/tracker-resources/src/components/SubIssues.svelte index 701bf6695e..c6e262872b 100644 --- a/plugins/tracker-resources/src/components/SubIssues.svelte +++ b/plugins/tracker-resources/src/components/SubIssues.svelte @@ -34,6 +34,7 @@ export let component: Ref | null = null export let subIssues: IssueDraft[] = [] export let shouldSaveDraft: boolean = false + let lastProject = project let isCollapsed = false let isCreating = $draftsStore[tracker.ids.IssueDraftChild] !== undefined @@ -48,6 +49,18 @@ } } + $: onProjectChange(project) + + function onProjectChange (project: Project | undefined) { + if (lastProject?._id === project?._id) return + lastProject = project + if (project === undefined) return + subIssues.forEach((p) => { + p.status = project.defaultIssueStatus + p.space = project._id + }) + } + const client = getClient() export async function save (parents: IssueParentInfo[]) { diff --git a/plugins/tracker-resources/src/components/templates/DraftIssueChildEditor.svelte b/plugins/tracker-resources/src/components/templates/DraftIssueChildEditor.svelte index 01d10753a4..56da9168bd 100644 --- a/plugins/tracker-resources/src/components/templates/DraftIssueChildEditor.svelte +++ b/plugins/tracker-resources/src/components/templates/DraftIssueChildEditor.svelte @@ -233,3 +233,9 @@ + +