Modification visuel status et type issue
This commit is contained in:
@@ -23,6 +23,7 @@ export class IssueDetail {
|
||||
protected issue: IssueEntity = this.buildIssue();
|
||||
protected readonly issues = this.issuesStore.issues;
|
||||
protected moreMenuOpen = false;
|
||||
protected statusMenuOpen = false;
|
||||
|
||||
constructor() {
|
||||
const idParam = this.route.snapshot.paramMap.get('id');
|
||||
@@ -209,8 +210,26 @@ export class IssueDetail {
|
||||
return this.sanitizer.bypassSecurityTrustHtml(html);
|
||||
}
|
||||
|
||||
protected get typeBadgeClass(): string {
|
||||
return this.getBadgeClass(this.issueTypeValue);
|
||||
protected typeIcon(type: IssueEntity['type']): { letter: string; bg: string } {
|
||||
const map: Record<IssueEntity['type'], { letter: string; bg: string }> = {
|
||||
Epic: { letter: 'E', bg: '#7c3aed' },
|
||||
Bug: { letter: 'B', bg: '#dc2626' },
|
||||
Story: { letter: 'S', bg: '#16a34a' },
|
||||
Task: { letter: 'T', bg: '#2563eb' },
|
||||
Study: { letter: 'St', bg: '#6b7280' },
|
||||
'Technical Story':{ letter: 'TS', bg: '#d97706' },
|
||||
};
|
||||
return map[type] ?? { letter: '?', bg: '#6b7280' };
|
||||
}
|
||||
|
||||
protected statusBadge(status: IssueEntity['status']): { label: string; bg: string; color: string } {
|
||||
const map: Record<IssueEntity['status'], { label: string; bg: string; color: string }> = {
|
||||
draft: { label: 'BROUILLON', bg: '#e2e8f0', color: '#475569' },
|
||||
todo: { label: 'À FAIRE', bg: '#dbeafe', color: '#1d4ed8' },
|
||||
'in-progress': { label: 'EN COURS', bg: '#ffedd5', color: '#9a3412' },
|
||||
done: { label: 'TERMINÉ', bg: '#dcfce7', color: '#166534' },
|
||||
};
|
||||
return map[status] ?? { label: status, bg: '#e2e8f0', color: '#475569' };
|
||||
}
|
||||
|
||||
protected priorityDisplay(priority: IssueEntity['priority']): { symbol: string; color: string; label: string } {
|
||||
@@ -284,6 +303,19 @@ export class IssueDetail {
|
||||
this.moreMenuOpen = false;
|
||||
}
|
||||
|
||||
protected toggleStatusMenu(): void {
|
||||
this.statusMenuOpen = !this.statusMenuOpen;
|
||||
}
|
||||
|
||||
protected closeStatusMenu(): void {
|
||||
this.statusMenuOpen = false;
|
||||
}
|
||||
|
||||
protected async selectStatus(status: IssueEntity['status']): Promise<void> {
|
||||
this.statusMenuOpen = false;
|
||||
await this.updateStatus(status);
|
||||
}
|
||||
|
||||
private buildIssue(): IssueEntity {
|
||||
const idParam = this.route.snapshot.paramMap.get('id');
|
||||
const isNewIssueRoute = this.route.snapshot.routeConfig?.path === 'issues/new';
|
||||
|
||||
Reference in New Issue
Block a user