Correction navigation après enregistrement issue

This commit is contained in:
Cédric OLIVIER
2026-05-22 18:18:19 +02:00
parent e51a898686
commit 6cb8197f0c
3 changed files with 54 additions and 8 deletions
+23 -3
View File
@@ -16,15 +16,35 @@ export class IssueDetail {
protected issue: IssueEntity = this.buildIssue();
protected isEditing = this.route.snapshot.queryParamMap.get('mode') === 'edit';
private issueBeforeEdit: IssueEntity | null = null;
protected toggleEdit(): void {
this.isEditing = !this.isEditing;
constructor() {
if (this.isEditing) {
this.issueBeforeEdit = this.cloneIssue(this.issue);
}
}
protected startEdit(): void {
this.issueBeforeEdit = this.cloneIssue(this.issue);
this.isEditing = true;
}
protected cancelEdit(): void {
if (this.issueBeforeEdit) {
this.issue = this.cloneIssue(this.issueBeforeEdit);
}
this.isEditing = false;
}
protected saveIssue(): void {
this.issuesStore.upsert(this.issue);
this.issueBeforeEdit = this.cloneIssue(this.issue);
this.isEditing = false;
this.router.navigate(['/issues']);
this.router.navigate(['/issues', this.issue.id]);
}
private cloneIssue(issue: IssueEntity): IssueEntity {
return { ...issue };
}
private buildIssue(): IssueEntity {