Ajout issue dans les commentaires

Signed-off-by: Gato <cedric@goutailler-olivier.fr>
This commit is contained in:
2026-05-28 18:50:36 +02:00
parent 081b48841a
commit cd93533b7c
5 changed files with 674 additions and 9 deletions
@@ -31,6 +31,97 @@
</div>
} @else {
<div class="comment-text markdown-body mt-1" [innerHTML]="parseMarkdown(comment.text)"></div>
<!-- Issues liées -->
@if (getLinkedIssues(comment).length > 0) {
<div class="linked-issues mt-2">
@for (linked of getLinkedIssues(comment); track linked.id) {
<div class="linked-issue-chip">
<span
class="linked-issue-type-icon"
[style.background]="typeIcon(linked.type).bg"
[title]="linked.type"
>{{ typeIcon(linked.type).letter }}</span>
<a [routerLink]="['/issues', linked.id]" class="linked-issue-name">{{ linked.name }}</a>
<span
class="linked-issue-status"
[style.background]="statusLabel(linked.status).bg"
[style.color]="statusLabel(linked.status).color"
>{{ statusLabel(linked.status).label }}</span>
<button
type="button"
class="linked-issue-unlink"
title="Délier"
(click)="unlinkIssueFromComment(comment.id, linked.id)"
>×</button>
</div>
}
</div>
}
<!-- Actions : créer tâche / lier issue -->
@if (creatingTaskForCommentId === comment.id) {
<div class="comment-task-form mt-2">
<input
type="text"
class="form-control form-control-sm"
placeholder="Nom de la tâche..."
[(ngModel)]="newTaskName"
(keydown.enter)="createTaskForComment(comment.id)"
(keydown.escape)="cancelCreateTask()"
autofocus
/>
<div class="d-flex gap-2 mt-1">
<button
type="button"
class="btn btn-sm btn-primary"
(click)="createTaskForComment(comment.id)"
[disabled]="!newTaskName.trim()"
>Créer</button>
<button type="button" class="btn btn-sm btn-outline-secondary" (click)="cancelCreateTask()">Annuler</button>
</div>
</div>
} @else if (linkingIssueForCommentId === comment.id) {
<div class="comment-link-form mt-2">
<input
type="text"
class="form-control form-control-sm"
placeholder="Rechercher une issue..."
[(ngModel)]="issueSearchText"
(keydown.escape)="cancelLinkIssue()"
autofocus
/>
<div class="link-issue-list">
@for (candidate of filteredIssuesForLink(comment.id); track candidate.id) {
<button
type="button"
class="link-issue-option"
(click)="linkIssueToComment(comment.id, candidate.id)"
>
<span
class="linked-issue-type-icon"
[style.background]="typeIcon(candidate.type).bg"
>{{ typeIcon(candidate.type).letter }}</span>
<span class="link-issue-option-name">{{ candidate.name }}</span>
<span
class="linked-issue-status"
[style.background]="statusLabel(candidate.status).bg"
[style.color]="statusLabel(candidate.status).color"
>{{ statusLabel(candidate.status).label }}</span>
</button>
}
@if (filteredIssuesForLink(comment.id).length === 0) {
<span class="link-issue-empty">Aucune issue trouvée</span>
}
</div>
<button type="button" class="btn btn-sm btn-outline-secondary mt-1" (click)="cancelLinkIssue()">Annuler</button>
</div>
} @else {
<div class="comment-link-actions mt-2">
<button type="button" class="comment-link-btn" (click)="startCreateTask(comment.id)">+ Créer une tâche</button>
<button type="button" class="comment-link-btn" (click)="startLinkIssue(comment.id)">+ Lier une issue</button>
</div>
}
}
</div>
}