working leantime widget 62
This commit is contained in:
parent
257606726c
commit
8ac9ba4366
@ -16,6 +16,7 @@ interface Task {
|
|||||||
date: string;
|
date: string;
|
||||||
editFrom: string;
|
editFrom: string;
|
||||||
editTo: string;
|
editTo: string;
|
||||||
|
editorId: string;
|
||||||
authorFirstname?: string;
|
authorFirstname?: string;
|
||||||
authorLastname?: string;
|
authorLastname?: string;
|
||||||
tags?: string;
|
tags?: string;
|
||||||
@ -114,7 +115,11 @@ export function Flow() {
|
|||||||
|
|
||||||
// Sort tasks by date (oldest first)
|
// Sort tasks by date (oldest first)
|
||||||
const sortedTasks = data.tasks
|
const sortedTasks = data.tasks
|
||||||
.filter((task: Task) => task.headline && typeof task.headline === 'string')
|
.filter((task: Task) =>
|
||||||
|
task.headline &&
|
||||||
|
typeof task.headline === 'string' &&
|
||||||
|
task.editorId // Only show tasks assigned to the current user
|
||||||
|
)
|
||||||
.sort((a: Task, b: Task) => getDateToSort(a) - getDateToSort(b));
|
.sort((a: Task, b: Task) => getDateToSort(a) - getDateToSort(b));
|
||||||
|
|
||||||
// Limit to 6 tasks
|
// Limit to 6 tasks
|
||||||
@ -166,6 +171,11 @@ export function Flow() {
|
|||||||
<h3 className="text-sm font-medium truncate" title={task.headline}>
|
<h3 className="text-sm font-medium truncate" title={task.headline}>
|
||||||
{task.headline}
|
{task.headline}
|
||||||
</h3>
|
</h3>
|
||||||
|
{task.dateToFinish && task.dateToFinish !== '0000-00-00 00:00:00' && (
|
||||||
|
<p className="text-xs text-gray-500 mt-1">
|
||||||
|
Due: {formatDate(task.dateToFinish)}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user