Gestion des status

Signed-off-by: Gato <cedric@goutailler-olivier.fr>
This commit is contained in:
2026-05-28 20:15:55 +02:00
parent 5d8ea2bed7
commit 90880daa3a
23 changed files with 775 additions and 55 deletions
+7 -14
View File
@@ -8,6 +8,7 @@ import { IssueEntity, IssuesStore } from '../issues.store';
import { IssueComments } from '../issue-comments/issue-comments';
import { handleImagePaste, insertAtSelection } from '../paste-image.util';
import { MilestoneEntity, MilestonesStore } from '../../milestones/milestones.store';
import { StatusEntity, StatusesStore } from '../../settings/statuses/statuses.store';
@Component({
selector: 'app-issue-detail',
@@ -21,6 +22,7 @@ export class IssueDetail {
private readonly issuesStore = inject(IssuesStore);
private readonly milestonesStore = inject(MilestonesStore);
private readonly sanitizer = inject(DomSanitizer);
protected readonly statusesStore = inject(StatusesStore);
protected readonly isNewIssueRoute = this.route.snapshot.routeConfig?.path === 'issues/new';
protected issue: IssueEntity = this.buildIssue();
@@ -64,12 +66,9 @@ export class IssueDetail {
protected showCreateInEpic = false;
protected newIssueName = '';
protected readonly statusOptions: IssueEntity['status'][] = [
'draft',
'todo',
'in-progress',
'done',
];
protected get statusOptions(): StatusEntity[] {
return [...this.statusesStore.statuses()].sort((a, b) => a.order - b.order);
}
protected readonly typeOptions: IssueEntity['type'][] = [
'Epic',
@@ -279,14 +278,8 @@ export class IssueDetail {
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 statusBadge(status: IssueEntity['status']): StatusEntity {
return this.statusesStore.getById(status) ?? { id: status, label: status, bg: '#e2e8f0', color: '#475569', order: 99 };
}
protected priorityDisplay(priority: IssueEntity['priority']): { symbol: string; color: string; label: string } {