feat: закрытые задачи в глобальном поиске зачёркнуты + бейдж статуса
searchTasksByKeyword теперь возвращает isCompleted и через leftJoin formStatuses — statusName/statusColor/statusIsFinal. В HomeGlobalSearch закрытые задачи (isCompleted || statusIsFinal) зачёркнуты и приглушены, у каждой задачи цветной бейдж текущего статуса.
This commit is contained in:
@@ -347,7 +347,7 @@ export class TasksCoreStorage extends FormsStorage {
|
||||
organizationId: number,
|
||||
query: string,
|
||||
limit: number = 10
|
||||
): Promise<Pick<Task, 'id' | 'title' | 'description' | 'formId' | 'currentStatusId'>[]> {
|
||||
): Promise<(Pick<Task, 'id' | 'title' | 'description' | 'formId' | 'currentStatusId' | 'isCompleted'> & { statusName: string | null; statusColor: string | null; statusIsFinal: boolean | null })[]> {
|
||||
const pattern = `%${query}%`;
|
||||
const results = await db
|
||||
.select({
|
||||
@@ -356,9 +356,14 @@ export class TasksCoreStorage extends FormsStorage {
|
||||
description: tasks.description,
|
||||
formId: tasks.formId,
|
||||
currentStatusId: tasks.currentStatusId,
|
||||
isCompleted: tasks.isCompleted,
|
||||
statusName: formStatuses.name,
|
||||
statusColor: formStatuses.color,
|
||||
statusIsFinal: formStatuses.isFinal,
|
||||
})
|
||||
.from(tasks)
|
||||
.innerJoin(forms, eq(tasks.formId, forms.id))
|
||||
.leftJoin(formStatuses, eq(tasks.currentStatusId, formStatuses.id))
|
||||
.where(
|
||||
and(
|
||||
eq(forms.organizationId, organizationId),
|
||||
|
||||
Reference in New Issue
Block a user