diff --git a/plugins/tracker-resources/src/components/CreateIssue.svelte b/plugins/tracker-resources/src/components/CreateIssue.svelte index 142f283337..3ee69bde5f 100644 --- a/plugins/tracker-resources/src/components/CreateIssue.svelte +++ b/plugins/tracker-resources/src/components/CreateIssue.svelte @@ -624,6 +624,7 @@ value={object} kind={'secondary'} size={'large'} + defaultIssueStatus={draft ? undefined : currentProject?.defaultIssueStatus} shouldShowLabel={true} on:change={({ detail }) => (object.status = detail)} /> diff --git a/plugins/tracker-resources/src/components/issues/StatusEditor.svelte b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte index d24f1d9323..a0060e6fe9 100644 --- a/plugins/tracker-resources/src/components/issues/StatusEditor.svelte +++ b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte @@ -38,6 +38,7 @@ export let size: ButtonSize = 'large' export let justify: 'left' | 'center' = 'left' export let width: string | undefined = undefined + export let defaultIssueStatus: Ref | undefined = undefined const client = getClient() const dispatch = createEventDispatcher() @@ -75,15 +76,21 @@ function getSelectedStatus ( statuses: WithLookup[] | undefined, - value: ValueType + value: ValueType, + defaultStatus: Ref | undefined ): WithLookup | undefined { + if (defaultStatus !== undefined) { + defaultIssueStatus = undefined + changeStatus(defaultStatus) + return statuses?.find((status) => status._id === defaultStatus) + } const current = statuses?.find((status) => status._id === value.status) if (current) return current changeStatus(statuses?.[0]?._id) return statuses?.[0] } - $: selectedStatus = getSelectedStatus(statuses, value) + $: selectedStatus = getSelectedStatus(statuses, value, defaultIssueStatus) $: selectedStatusLabel = shouldShowLabel ? selectedStatus?.name : undefined $: statusesInfo = statuses?.map((s) => { return {