feat(tickets): affiche le créateur d'un ticket et filtre la liste par créateur
createdBy était déjà présent dans le frontmatter des tickets mais ni exposé ni exploitable côté UI. Ajout du DTO (domain/ports/mock), affichage dans TicketDetail, colonne/filtre créateur dans TicketsPanel, et persistance du filtre. ticketActor.ts introduit pour porter la logique de filtrage côté frontend, sans changement backend nécessaire (lot frontend pur). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -168,6 +168,17 @@ function sortTickets(
|
||||
});
|
||||
}
|
||||
|
||||
function sameTicketCreator(
|
||||
actor: Ticket["createdBy"],
|
||||
filter: NonNullable<TicketListQuery["createdBy"]>,
|
||||
): boolean {
|
||||
if (actor.kind !== filter.kind) return false;
|
||||
if (actor.kind === "agent" && filter.kind === "agent") {
|
||||
return actor.agentId === filter.agentId;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export class MockSystemGateway implements SystemGateway {
|
||||
private listeners = new Set<(e: DomainEvent) => void>();
|
||||
|
||||
@ -2840,6 +2851,7 @@ export class MockTicketGateway implements TicketGateway {
|
||||
(t) =>
|
||||
!q.assignedAgentId || t.assignedAgentIds.includes(q.assignedAgentId),
|
||||
)
|
||||
.filter((t) => !q.createdBy || sameTicketCreator(t.createdBy, q.createdBy))
|
||||
.filter(
|
||||
(t) =>
|
||||
!text ||
|
||||
@ -2861,6 +2873,7 @@ export class MockTicketGateway implements TicketGateway {
|
||||
priority: t.priority,
|
||||
sprintId: t.sprintId ?? null,
|
||||
assignedAgentIds: [...t.assignedAgentIds],
|
||||
createdBy: structuredClone(t.createdBy),
|
||||
updatedAt: t.updatedAt,
|
||||
})),
|
||||
...(end < rows.length ? { nextCursor: String(end) } : {}),
|
||||
|
||||
@ -39,4 +39,19 @@ describe("TauriTicketGateway invoke payloads", () => {
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("passes createdBy through the ticket list request DTO", async () => {
|
||||
await new TauriTicketGateway().list("proj-1", {
|
||||
createdBy: { kind: "agent", agentId: "agent-1" },
|
||||
});
|
||||
|
||||
expect(invoke).toHaveBeenCalledWith("ticket_list", {
|
||||
request: {
|
||||
projectId: "proj-1",
|
||||
statuses: [],
|
||||
priorities: [],
|
||||
createdBy: { kind: "agent", agentId: "agent-1" },
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user