fix(home-page): exclude archived projects from task queries and update project color display
- Added a condition to exclude archived projects from the task retrieval queries in the HomePageController. - Updated the TasksList component to display the project color instead of the phase color for better visual representation.
This commit is contained in:
@@ -137,6 +137,10 @@ export default class HomePageController extends WorklenzControllerBase {
|
||||
WHERE category_id NOT IN (SELECT id
|
||||
FROM sys_task_status_categories
|
||||
WHERE is_done IS FALSE))
|
||||
AND NOT EXISTS(SELECT project_id
|
||||
FROM archived_projects
|
||||
WHERE project_id = p.id
|
||||
AND user_id = $2)
|
||||
${groupByClosure}
|
||||
ORDER BY t.end_date ASC`;
|
||||
|
||||
@@ -158,9 +162,13 @@ export default class HomePageController extends WorklenzControllerBase {
|
||||
WHERE category_id NOT IN (SELECT id
|
||||
FROM sys_task_status_categories
|
||||
WHERE is_done IS FALSE))
|
||||
AND NOT EXISTS(SELECT project_id
|
||||
FROM archived_projects
|
||||
WHERE project_id = p.id
|
||||
AND user_id = $3)
|
||||
${groupByClosure}`;
|
||||
|
||||
const result = await db.query(q, [teamId, userId]);
|
||||
const result = await db.query(q, [teamId, userId, userId]);
|
||||
const [row] = result.rows;
|
||||
return row;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ const TasksList: React.FC = React.memo(() => {
|
||||
style={{ margin: 0, paddingInlineEnd: 6, maxWidth: 120 }}
|
||||
ellipsis={{ tooltip: true }}
|
||||
>
|
||||
<Badge color={record.phase_color || 'blue'} style={{ marginInlineEnd: 4 }} />
|
||||
<Badge color={record.project_color || 'blue'} style={{ marginInlineEnd: 4 }} />
|
||||
{record.project_name}
|
||||
</Typography.Paragraph>
|
||||
</Tooltip>
|
||||
|
||||
Reference in New Issue
Block a user