mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-23 20:13:20 +00:00
TSK-1339: show dueDate for cancelled/done issues (#3091)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
c08b711782
commit
55f968af6d
@ -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'
|
||||
}
|
||||
|
@ -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}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user