Update project insights controller and frontend components for overlogged tasks
- Modified SQL query in the ProjectInsightsController to filter out tasks with zero total minutes and mismatched logged time. - Updated OverLoggedTasksTable to render overlogged time as a string for better readability. - Added a new property `overlogged_time_string` to the IInsightTasks interface to support the updated rendering logic.
This commit is contained in:
@@ -322,7 +322,7 @@ export default class ProjectInsightsController extends WorklenzControllerBase {
|
|||||||
(SELECT get_task_assignees(tasks.id)) AS assignees
|
(SELECT get_task_assignees(tasks.id)) AS assignees
|
||||||
FROM tasks
|
FROM tasks
|
||||||
JOIN work_log ON work_log.task_id = tasks.id
|
JOIN work_log ON work_log.task_id = tasks.id
|
||||||
WHERE project_id = $1
|
WHERE project_id = $1 AND total_minutes <> 0 AND (total_minutes * 60) <> work_log.total_time_spent
|
||||||
AND CASE
|
AND CASE
|
||||||
WHEN ($2 IS TRUE) THEN project_id IS NOT NULL
|
WHEN ($2 IS TRUE) THEN project_id IS NOT NULL
|
||||||
ELSE archived IS FALSE END
|
ELSE archived IS FALSE END
|
||||||
|
|||||||
@@ -105,8 +105,8 @@ const OverLoggedTasksTable = () => {
|
|||||||
{
|
{
|
||||||
key: 'overLoggedTime',
|
key: 'overLoggedTime',
|
||||||
title: 'Over Logged Time',
|
title: 'Over Logged Time',
|
||||||
render: (record: IInsightTasks) => (
|
render: (_, record: IInsightTasks) => (
|
||||||
<Typography.Text>{record.overlogged_time}</Typography.Text>
|
<Typography.Text>{record.overlogged_time_string}</Typography.Text>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ export interface IInsightTasks {
|
|||||||
updated_at?: string;
|
updated_at?: string;
|
||||||
total_minutes?: string;
|
total_minutes?: string;
|
||||||
overlogged_time?: string;
|
overlogged_time?: string;
|
||||||
|
overlogged_time_string?: string;
|
||||||
days_overdue?: number;
|
days_overdue?: number;
|
||||||
is_overdue?: boolean;
|
is_overdue?: boolean;
|
||||||
parent_task_id?: string;
|
parent_task_id?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user