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,6 +7,7 @@ import { marked } from 'marked';
import { IssueEntity, IssuesStore } from '../../issues/issues.store';
import { handleImagePaste, insertAtSelection } from '../../issues/paste-image.util';
import { MilestoneEntity, MilestonesStore } from '../milestones.store';
import { StatusEntity, StatusesStore } from '../../settings/statuses/statuses.store';
@Component({
selector: 'app-milestone-detail',
@@ -20,6 +21,7 @@ export class MilestoneDetail {
private readonly milestonesStore = inject(MilestonesStore);
private readonly issuesStore = inject(IssuesStore);
private readonly sanitizer = inject(DomSanitizer);
private readonly statusesStore = inject(StatusesStore);
protected readonly isNewRoute = this.route.snapshot.routeConfig?.path === 'milestones/new';
protected milestone: MilestoneEntity = this.buildMilestone();
@@ -179,14 +181,8 @@ export class MilestoneDetail {
setTimeout(() => { this.showIssueSuggestions = false; }, 150);
}
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 } {