Ajouter issue depuis milestone

This commit is contained in:
2026-05-28 05:39:52 +02:00
parent ef48bf4b73
commit e65571051c
4 changed files with 125 additions and 7 deletions
@@ -172,7 +172,22 @@
}
<div class="card-body" [class.pt-0]="linkedIssues.length > 0">
@if (showAddIssue) {
@if (showCreateIssue) {
<div class="d-flex gap-2 flex-wrap">
<input
aria-label="Titre de la nouvelle issue"
class="form-control form-control-sm"
type="text"
placeholder="Titre de l'issue..."
[(ngModel)]="newIssueName"
(keydown.enter)="confirmCreateIssue()"
(keydown.escape)="cancelCreateIssue()"
autofocus
/>
<button type="button" class="btn btn-sm btn-primary text-nowrap" (click)="confirmCreateIssue()" [disabled]="!newIssueName.trim()">Créer</button>
<button type="button" class="btn btn-sm btn-outline-secondary text-nowrap" (click)="cancelCreateIssue()">Annuler</button>
</div>
} @else if (showAddIssue) {
<div class="issue-search-wrapper">
<div class="input-group input-group-sm">
<input
@@ -209,12 +224,15 @@
}
</div>
} @else {
<button
type="button"
class="btn btn-sm btn-outline-secondary"
[disabled]="availableIssues.length === 0"
(click)="openAddIssue()"
>+ Ajouter une issue</button>
<div class="d-flex gap-2">
<button type="button" class="btn btn-sm btn-primary" (click)="openCreateIssue()">+ Créer une issue</button>
<button
type="button"
class="btn btn-sm btn-outline-secondary"
[disabled]="availableIssues.length === 0"
(click)="openAddIssue()"
>Ajouter une existante</button>
</div>
}
</div>
</div>
@@ -27,6 +27,8 @@ export class MilestoneDetail {
protected editingDescription = false;
protected showAddIssue = false;
protected showCreateIssue = false;
protected newIssueName = '';
protected issueSearchQuery = '';
protected showIssueSuggestions = false;
protected moreMenuOpen = false;
@@ -49,6 +51,8 @@ export class MilestoneDetail {
this.milestone = { ...found };
this.editingDescription = false;
this.showAddIssue = false;
this.showCreateIssue = false;
this.newIssueName = '';
}
});
}
@@ -100,10 +104,46 @@ export class MilestoneDetail {
).slice(0, 8);
}
protected openCreateIssue(): void {
this.newIssueName = '';
this.showCreateIssue = true;
this.showAddIssue = false;
}
protected cancelCreateIssue(): void {
this.showCreateIssue = false;
this.newIssueName = '';
}
protected async confirmCreateIssue(): Promise<void> {
const name = this.newIssueName.trim();
if (!name) return;
const created = await this.issuesStore.upsert({
id: 0,
type: 'Story',
assignee: '',
epic: '',
name,
dueDate: '',
description: '',
estimatedTime: null,
dependsOnIds: [],
comments: [],
priority: 'MOYENNE',
status: 'draft',
progress: 0,
});
this.milestone.issueIds = [...this.milestone.issueIds, created.id];
await this.saveMilestone();
this.showCreateIssue = false;
this.newIssueName = '';
}
protected openAddIssue(): void {
this.issueSearchQuery = '';
this.showIssueSuggestions = false;
this.showAddIssue = true;
this.showCreateIssue = false;
}
protected cancelAddIssue(): void {