From 5ef4205a97e122507fc05747f36e005a320da986 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 21 Apr 2023 17:55:29 +0600 Subject: [PATCH] Fix due date (#3042) Signed-off-by: Denis Bykhov --- plugins/recruit-resources/src/components/KanbanCard.svelte | 2 +- .../src/components/issues/DueDatePresenter.svelte | 1 + server/mongo/src/storage.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/recruit-resources/src/components/KanbanCard.svelte b/plugins/recruit-resources/src/components/KanbanCard.svelte index dc306ebae8..49a1d349bf 100644 --- a/plugins/recruit-resources/src/components/KanbanCard.svelte +++ b/plugins/recruit-resources/src/components/KanbanCard.svelte @@ -92,7 +92,7 @@ { await client.update(object, { dueDate: e }) }} diff --git a/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte b/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte index 3dde898156..01cae56b66 100644 --- a/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte +++ b/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte @@ -41,6 +41,7 @@ $: shouldRenderPresenter = dueDateMs !== null && + dueDateMs !== undefined && value.$lookup?.status?.category !== tracker.issueStatusCategory.Completed && value.$lookup?.status?.category !== tracker.issueStatusCategory.Canceled diff --git a/server/mongo/src/storage.ts b/server/mongo/src/storage.ts index 967c7ce1e0..d505723bdc 100644 --- a/server/mongo/src/storage.ts +++ b/server/mongo/src/storage.ts @@ -1063,7 +1063,7 @@ function fillDateSort (key: string, pipeline: any[], sort: any, options: FindOpt } pipeline.push({ $addFields: { - [`sort_isNull_${key}`]: { $eq: [`$${key}`, null] } + [`sort_isNull_${key}`]: { [key]: null } } }) sort[`sort_isNull_${key}`] = options.sort[_key] === SortingOrder.Ascending ? 1 : -1