TSK-1339: show dueDate for cancelled/done issues (#3091)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2023-04-27 20:06:59 +05:00 committed by GitHub
parent c08b711782
commit 55f968af6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -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'
}

View File

@ -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
</script>
<DueDatePresenter
@ -52,4 +52,5 @@
onChange={handleDueDateChanged}
editable={isEditable}
{kind}
shouldIgnoreOverdue={ignoreOverDue}
/>