Changement des couleurs des badges story, bug, study, etc.

This commit is contained in:
2026-05-23 08:58:06 +02:00
parent b3f25369be
commit 4960292ecf
2 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -27,7 +27,7 @@
(keydown.enter)="openIssue(issue.id)"
>
<td>{{ issue.name }}</td>
<td><span class="badge text-bg-secondary">{{ issue.type }}</span></td>
<td><span [class]="'badge ' + typeBadgeClass(issue.type)">{{ issue.type }}</span></td>
<td>{{ issue.priority }}</td>
<td>{{ issue.status }}</td>
<td>{{ issue.assignee }}</td>
+13 -1
View File
@@ -1,6 +1,6 @@
import { Component, inject } from '@angular/core';
import { Router } from '@angular/router';
import { IssuesStore } from './issues.store';
import { IssueEntity, IssuesStore } from './issues.store';
@Component({
selector: 'app-issues',
@@ -24,4 +24,16 @@ export class Issues {
protected openIssue(issueId: number): void {
this.router.navigate(['/issues', issueId]);
}
protected typeBadgeClass(type: IssueEntity['type']): string {
const map: Record<IssueEntity['type'], string> = {
Bug: 'text-bg-danger',
Study: 'text-bg-secondary',
Story: 'text-bg-success',
Task: 'text-bg-primary',
'Technical Story': 'text-bg-warning',
Epic: 'text-bg-info',
};
return map[type] ?? 'text-bg-secondary';
}
}