@@ -5,6 +5,7 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||
import { marked } from 'marked';
|
||||
import { handleImagePaste, insertAtSelection } from '../paste-image.util';
|
||||
import { IssueComment, IssueEntity, IssuesStore } from '../issues.store';
|
||||
import { StatusEntity, StatusesStore } from '../../settings/statuses/statuses.store';
|
||||
|
||||
@Component({
|
||||
selector: 'app-issue-comments',
|
||||
@@ -15,6 +16,7 @@ import { IssueComment, IssueEntity, IssuesStore } from '../issues.store';
|
||||
export class IssueComments {
|
||||
private readonly issuesStore = inject(IssuesStore);
|
||||
private readonly sanitizer = inject(DomSanitizer);
|
||||
private readonly statusesStore = inject(StatusesStore);
|
||||
|
||||
readonly issueId = input.required<number>();
|
||||
|
||||
@@ -140,14 +142,8 @@ export class IssueComments {
|
||||
return map[type] ?? { letter: '?', bg: '#6b7280' };
|
||||
}
|
||||
|
||||
protected statusLabel(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 statusLabel(status: IssueEntity['status']): StatusEntity {
|
||||
return this.statusesStore.getById(status) ?? { id: status, label: status, bg: '#e2e8f0', color: '#475569', order: 99 };
|
||||
}
|
||||
|
||||
protected startCreateTask(commentId: number): void {
|
||||
|
||||
Reference in New Issue
Block a user