feat: archive a project instead of deleting it
The owner archives a finished project (archiveProject, POST
/projects/{project}/archive) and brings it back (unarchive). While
archived it stays readable, managers still read its rules and webhooks,
but no command changes it: contributing and managing checks refuse with
422, votes and public proposals too, and automations do not run. The web
shows a read-only notice on every page of it (with «Desarchivar» for the
owner), hides what edits, marks it on the home page and lists it last.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,8 @@ import {
|
||||
ChangeProjectMemberRoleDocument,
|
||||
CreateProjectDocument,
|
||||
DeleteProjectDocument,
|
||||
ArchiveProjectDocument,
|
||||
UnarchiveProjectDocument,
|
||||
MyProjectsDocument,
|
||||
ProjectAnalyticsDocument,
|
||||
ProjectInsightsDocument,
|
||||
@@ -102,6 +104,16 @@ export class GraphqlProjectsGateway extends ProjectsGateway {
|
||||
.pipe(map((d) => toCommandResult(d.updateProject)));
|
||||
}
|
||||
|
||||
setArchived(projectId: string, archived: boolean): Observable<CommandResult> {
|
||||
return archived
|
||||
? this.gql
|
||||
.mutate(ArchiveProjectDocument, { projectId })
|
||||
.pipe(map((d) => toCommandResult(d.archiveProject)))
|
||||
: this.gql
|
||||
.mutate(UnarchiveProjectDocument, { projectId })
|
||||
.pipe(map((d) => toCommandResult(d.unarchiveProject)));
|
||||
}
|
||||
|
||||
delete(projectId: string, confirmKey: string): Observable<CommandResult> {
|
||||
return this.gql
|
||||
.mutate(DeleteProjectDocument, { projectId, confirmKey })
|
||||
|
||||
Reference in New Issue
Block a user