Add desk-style task workflow on Activities and Project boards.
Managers can switch my desk vs team, reassign activities, and filter project cards to their work; assignees can see and move cards.
This commit is contained in:
@@ -128,6 +128,7 @@ export class ActivitiesService {
|
||||
from?: string;
|
||||
to?: string;
|
||||
},
|
||||
desk?: 'mine' | 'team',
|
||||
): Promise<PaginatedResponse<ActivityDto>> {
|
||||
const where = this.buildWhere(
|
||||
organizationId,
|
||||
@@ -136,6 +137,7 @@ export class ActivitiesService {
|
||||
q,
|
||||
entity,
|
||||
range,
|
||||
desk,
|
||||
);
|
||||
const take = Math.min(Math.max(limit, 1), 200);
|
||||
const [rows, total] = await this.prisma.$transaction([
|
||||
@@ -324,11 +326,14 @@ export class ActivitiesService {
|
||||
from?: string;
|
||||
to?: string;
|
||||
},
|
||||
desk?: 'mine' | 'team',
|
||||
): Prisma.ActivityWhereInput {
|
||||
const { start, end } = dayBounds();
|
||||
const scope =
|
||||
desk === 'mine' ? { assigneeId: actor.userId } : assigneeWhere(actor);
|
||||
const base: Prisma.ActivityWhereInput = {
|
||||
organizationId,
|
||||
...assigneeWhere(actor),
|
||||
...scope,
|
||||
...(entity?.personId ? { personId: entity.personId } : {}),
|
||||
...(entity?.companyId ? { companyId: entity.companyId } : {}),
|
||||
...(entity?.dealId ? { dealId: entity.dealId } : {}),
|
||||
|
||||
Reference in New Issue
Block a user