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
|
WHERE category_id NOT IN (SELECT id
|
||||||
FROM sys_task_status_categories
|
FROM sys_task_status_categories
|
||||||
WHERE is_done IS FALSE))
|
WHERE is_done IS FALSE))
|
||||||
|
AND NOT EXISTS(SELECT project_id
|
||||||
|
FROM archived_projects
|
||||||
|
WHERE project_id = p.id
|
||||||
|
AND user_id = $2)
|
||||||
${groupByClosure}
|
${groupByClosure}
|
||||||
ORDER BY t.end_date ASC`;
|
ORDER BY t.end_date ASC`;
|
||||||
|
|
||||||
@@ -158,9 +162,13 @@ export default class HomePageController extends WorklenzControllerBase {
|
|||||||
WHERE category_id NOT IN (SELECT id
|
WHERE category_id NOT IN (SELECT id
|
||||||
FROM sys_task_status_categories
|
FROM sys_task_status_categories
|
||||||
WHERE is_done IS FALSE))
|
WHERE is_done IS FALSE))
|
||||||
|
AND NOT EXISTS(SELECT project_id
|
||||||
|
FROM archived_projects
|
||||||
|
WHERE project_id = p.id
|
||||||
|
AND user_id = $3)
|
||||||
${groupByClosure}`;
|
${groupByClosure}`;
|
||||||
|
|
||||||
const result = await db.query(q, [teamId, userId]);
|
const result = await db.query(q, [teamId, userId, userId]);
|
||||||
const [row] = result.rows;
|
const [row] = result.rows;
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ const TasksList: React.FC = React.memo(() => {
|
|||||||
style={{ margin: 0, paddingInlineEnd: 6, maxWidth: 120 }}
|
style={{ margin: 0, paddingInlineEnd: 6, maxWidth: 120 }}
|
||||||
ellipsis={{ tooltip: true }}
|
ellipsis={{ tooltip: true }}
|
||||||
>
|
>
|
||||||
<Badge color={record.phase_color || 'blue'} style={{ marginInlineEnd: 4 }} />
|
<Badge color={record.project_color || 'blue'} style={{ marginInlineEnd: 4 }} />
|
||||||
{record.project_name}
|
{record.project_name}
|
||||||
</Typography.Paragraph>
|
</Typography.Paragraph>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
Reference in New Issue
Block a user