From 55f968af6d112c91a326754051b913d128ff4e87 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tumanov Date: Thu, 27 Apr 2023 20:06:59 +0500 Subject: [PATCH] TSK-1339: show dueDate for cancelled/done issues (#3091) Signed-off-by: Vyacheslav Tumanov --- .../src/components/calendar/DueDatePresenter.svelte | 5 +++++ .../src/components/issues/DueDatePresenter.svelte | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/ui/src/components/calendar/DueDatePresenter.svelte b/packages/ui/src/components/calendar/DueDatePresenter.svelte index a6caa682d5..4a28f7fa71 100644 --- a/packages/ui/src/components/calendar/DueDatePresenter.svelte +++ b/packages/ui/src/components/calendar/DueDatePresenter.svelte @@ -25,6 +25,7 @@ export let onChange: (newDate: number | null) => void export let kind: ButtonKind = 'link' export let editable: boolean = true + export let shouldIgnoreOverdue: boolean = false const today = new Date(new Date(Date.now()).setHours(0, 0, 0, 0)) $: isOverdue = value !== null && value < today.getTime() @@ -54,6 +55,10 @@ isOverdue: boolean, daysDifference: number | null ): 'overdue' | 'critical' | 'warning' | undefined => { + if (shouldIgnoreOverdue) { + return + } + if (isOverdue) { return 'overdue' } diff --git a/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte b/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte index 01cae56b66..935edbbba8 100644 --- a/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte +++ b/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte @@ -39,11 +39,11 @@ ) } - $: shouldRenderPresenter = - dueDateMs !== null && - dueDateMs !== undefined && - value.$lookup?.status?.category !== tracker.issueStatusCategory.Completed && - value.$lookup?.status?.category !== tracker.issueStatusCategory.Canceled + $: shouldRenderPresenter = dueDateMs != null + + $: ignoreOverDue = + value.$lookup?.status?.category === tracker.issueStatusCategory.Completed || + value.$lookup?.status?.category === tracker.issueStatusCategory.Canceled