From 720304c977c7281b9cabec7ef6ab5da37c57703d Mon Sep 17 00:00:00 2001 From: wahyu Date: Tue, 19 Dec 2023 11:54:01 +0700 Subject: [PATCH] send overdue data to fe --- view-mode/function/ganttConfig.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/view-mode/function/ganttConfig.js b/view-mode/function/ganttConfig.js index 1b62b0f..26718bf 100644 --- a/view-mode/function/ganttConfig.js +++ b/view-mode/function/ganttConfig.js @@ -379,7 +379,7 @@ gantt.templates.task_class = function (start, end, task) { return classes.join(' '); } }; - +let dataOverdue = []; gantt.templates.rightside_text = function (start, end, task) { if (task.planned_end) { if (end.getTime() > task.planned_end.getTime()) { @@ -398,6 +398,15 @@ gantt.templates.rightside_text = function (start, end, task) { end_date: end, task: task }, 'day'); + let found = dataOverdue.find((element) => element.id == task.id); + if (!found) { + dataOverdue.push({ + id: task.id, + text: task.text, + overdue: overdue + }) + } + window.parent.postMessage({ type: 'dataOverdueUpdate', dataOverdue: dataOverdue }, '*'); var text = "Overdue: " + overdue + " days"; return text; }