feat: epics, subtasks and checklists

Tickets can hang from another one of the same project, three levels deep
at most (epic → ticket → subtask). The ticket page lists its subtasks with
their progress, creates new ones and moves the ticket under an epic; a new
Épicas tab shows every epic and how far it has got. Each ticket also gets a
checklist for the small steps that don't deserve a ticket.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 13:52:43 +02:00
parent 75323115fb
commit d4da33d4e8
84 changed files with 4719 additions and 79 deletions

View File

@@ -23,10 +23,12 @@ import {
StatusCategory,
} from '@task-stream/api/tracker/domain';
import {
AddChecklistItemInput,
ChangeIssueStatusInput,
CreateIssueInput,
IssueFilterInput,
LinkIssuesInput,
UpdateChecklistItemInput,
UpdateIssueInput,
} from './inputs';
import { withoutNulls } from '../common/issue-input';
@@ -35,6 +37,7 @@ import {
ActivityGql,
CommandResultGql,
CommentPageGql,
EpicGql,
IssueGql,
IssuePageGql,
} from './types';
@@ -72,6 +75,18 @@ export class IssueResolver {
});
}
@OptionalAuth()
@Query(() => [EpicGql], {
description:
"A project's epics: top-level tickets that group others, with the progress of those",
})
epics(
@CurrentUser() me: User | undefined,
@Args('projectId', { type: () => ID }) projectId: string,
) {
return this.issuesService.epics(viewerOf(me), projectId);
}
@Query(() => IssuePageGql, {
description:
'Tickets across all my projects: assigned to me (default) or any (e.g. categories [QA])',
@@ -238,6 +253,56 @@ export class IssueResolver {
return this.issuesService.unlink(me.id, input);
}
@Mutation(() => CommandResultGql, {
description:
'Place a ticket under an epic or another ticket of the same project (null: back to the top). Three levels at most: epic → ticket → subtask.',
})
setIssueParent(
@CurrentUser() me: User,
@Args('issueId', { type: () => ID }) issueId: string,
@Args('parentId', { type: () => ID, nullable: true })
parentId: string | null,
) {
return this.issuesService.setParent(me.id, issueId, parentId ?? null);
}
@Mutation(() => CommandResultGql, {
description: "Add a step to a ticket's checklist",
})
addChecklistItem(
@CurrentUser() me: User,
@Args('input') input: AddChecklistItemInput,
) {
return this.issuesService.addChecklistItem(
me.id,
input.issueId,
input.text,
);
}
@Mutation(() => CommandResultGql, {
description: 'Reword, tick or untick a checklist step',
})
updateChecklistItem(
@CurrentUser() me: User,
@Args('input') input: UpdateChecklistItemInput,
) {
const { issueId, itemId, text, done } = input;
return this.issuesService.updateChecklistItem(me.id, issueId, itemId, {
...(text != null && { text }),
...(done != null && { done }),
});
}
@Mutation(() => CommandResultGql)
removeChecklistItem(
@CurrentUser() me: User,
@Args('issueId', { type: () => ID }) issueId: string,
@Args('itemId', { type: () => ID }) itemId: string,
) {
return this.issuesService.removeChecklistItem(me.id, issueId, itemId);
}
@Mutation(() => CommandResultGql, {
description: 'Put a ticket in a release (null removes it)',
})