feat: a trash for tickets

Deleting a ticket now sends it to the trash, for whoever opened it or an
admin: it disappears from boards, searches and statistics, cannot change,
and comes back from the ticket page or the trash page for 30 days. After
that it is deleted for good with the usual cascade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 18:47:30 +02:00
parent 71b807b94b
commit bec39da46d
49 changed files with 1671 additions and 9 deletions

View File

@@ -32,6 +32,9 @@ import {
MyIssuesDocument,
RankIssueDocument,
RemoveChecklistItemDocument,
RestoreIssueDocument,
TrashDocument,
TrashIssueDocument,
SearchIssuesDocument,
SetIssueParentDocument,
SetIssueReleaseDocument,
@@ -180,6 +183,24 @@ export class GraphqlIssuesGateway extends IssuesGateway {
);
}
trash(issueId: string): Observable<CommandResult> {
return this.gql
.mutate(TrashIssueDocument, { issueId })
.pipe(map((d) => toCommandResult(d.trashIssue)));
}
restore(issueId: string): Observable<CommandResult> {
return this.gql
.mutate(RestoreIssueDocument, { issueId })
.pipe(map((d) => toCommandResult(d.restoreIssue)));
}
trashed(projectId: string): Observable<IssueSummary[]> {
return this.gql
.query(TrashDocument, { projectId })
.pipe(map((d) => d.trash.map(toIssueSummary)));
}
bulkUpdate(issueIds: string[], change: BulkChange): Observable<BulkResult> {
return this.gql
.mutate(BulkUpdateIssuesDocument, {