Changement des couleurs des badges story, bug, study, etc.
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
(keydown.enter)="openIssue(issue.id)"
|
(keydown.enter)="openIssue(issue.id)"
|
||||||
>
|
>
|
||||||
<td>{{ issue.name }}</td>
|
<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.priority }}</td>
|
||||||
<td>{{ issue.status }}</td>
|
<td>{{ issue.status }}</td>
|
||||||
<td>{{ issue.assignee }}</td>
|
<td>{{ issue.assignee }}</td>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, inject } from '@angular/core';
|
import { Component, inject } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { IssuesStore } from './issues.store';
|
import { IssueEntity, IssuesStore } from './issues.store';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-issues',
|
selector: 'app-issues',
|
||||||
@@ -24,4 +24,16 @@ export class Issues {
|
|||||||
protected openIssue(issueId: number): void {
|
protected openIssue(issueId: number): void {
|
||||||
this.router.navigate(['/issues', issueId]);
|
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';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user