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:
chamiakJ
2025-05-08 20:56:51 +05:30
parent e0b2fa2d6f
commit aaaaec6f36
3 changed files with 4 additions and 3 deletions

View File

@@ -322,7 +322,7 @@ export default class ProjectInsightsController extends WorklenzControllerBase {
(SELECT get_task_assignees(tasks.id)) AS assignees
FROM tasks
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
WHEN ($2 IS TRUE) THEN project_id IS NOT NULL
ELSE archived IS FALSE END

View File

@@ -105,8 +105,8 @@ const OverLoggedTasksTable = () => {
{
key: 'overLoggedTime',
title: 'Over Logged Time',
render: (record: IInsightTasks) => (
<Typography.Text>{record.overlogged_time}</Typography.Text>
render: (_, record: IInsightTasks) => (
<Typography.Text>{record.overlogged_time_string}</Typography.Text>
),
},
];

View File

@@ -41,6 +41,7 @@ export interface IInsightTasks {
updated_at?: string;
total_minutes?: string;
overlogged_time?: string;
overlogged_time_string?: string;
days_overdue?: number;
is_overdue?: boolean;
parent_task_id?: string;