Ajout commentaire des issues
This commit is contained in:
@@ -180,3 +180,4 @@
|
|||||||
.markdown-body > *:last-child {
|
.markdown-body > *:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -247,6 +247,11 @@
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<!-- Commentaires -->
|
||||||
|
@if (!isNewIssueRoute) {
|
||||||
|
<app-issue-comments [issueId]="issue.id" />
|
||||||
|
}
|
||||||
|
|
||||||
@if (isNewIssueRoute) {
|
@if (isNewIssueRoute) {
|
||||||
<div class="d-flex justify-content-end gap-2 mt-4">
|
<div class="d-flex justify-content-end gap-2 mt-4">
|
||||||
<button type="button" class="btn btn-outline-secondary" (click)="cancelCreation()">Annuler</button>
|
<button type="button" class="btn btn-outline-secondary" (click)="cancelCreation()">Annuler</button>
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
import { IssueEntity, IssuesStore } from '../issues.store';
|
import { IssueEntity, IssuesStore } from '../issues.store';
|
||||||
|
import { IssueComments } from '../issue-comments/issue-comments';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-issue-detail',
|
selector: 'app-issue-detail',
|
||||||
imports: [FormsModule],
|
imports: [FormsModule, IssueComments],
|
||||||
templateUrl: './issue-detail.html',
|
templateUrl: './issue-detail.html',
|
||||||
styleUrl: './issue-detail.css',
|
styleUrl: './issue-detail.css',
|
||||||
})
|
})
|
||||||
@@ -16,7 +17,7 @@ export class IssueDetail {
|
|||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
private readonly issuesStore = inject(IssuesStore);
|
private readonly issuesStore = inject(IssuesStore);
|
||||||
private readonly sanitizer = inject(DomSanitizer);
|
protected readonly sanitizer = inject(DomSanitizer);
|
||||||
protected readonly isNewIssueRoute = this.route.snapshot.routeConfig?.path === 'issues/new';
|
protected readonly isNewIssueRoute = this.route.snapshot.routeConfig?.path === 'issues/new';
|
||||||
|
|
||||||
protected issue: IssueEntity = this.buildIssue();
|
protected issue: IssueEntity = this.buildIssue();
|
||||||
@@ -158,6 +159,7 @@ export class IssueDetail {
|
|||||||
description: '',
|
description: '',
|
||||||
estimatedTime: null,
|
estimatedTime: null,
|
||||||
dependsOnIds: [],
|
dependsOnIds: [],
|
||||||
|
comments: [],
|
||||||
priority: 'Moyenne',
|
priority: 'Moyenne',
|
||||||
status: 'draft',
|
status: 'draft',
|
||||||
progress: 0,
|
progress: 0,
|
||||||
@@ -196,6 +198,7 @@ export class IssueDetail {
|
|||||||
return this.sanitizer.bypassSecurityTrustHtml(html);
|
return this.sanitizer.bypassSecurityTrustHtml(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected get typeBadgeClass(): string {
|
protected get typeBadgeClass(): string {
|
||||||
return this.getBadgeClass(this.issueTypeValue);
|
return this.getBadgeClass(this.issueTypeValue);
|
||||||
}
|
}
|
||||||
@@ -266,40 +269,24 @@ export class IssueDetail {
|
|||||||
const resolvedId = Number(idParam ?? draftId ?? 0);
|
const resolvedId = Number(idParam ?? draftId ?? 0);
|
||||||
const safeId = Number.isNaN(resolvedId) ? 0 : resolvedId;
|
const safeId = Number.isNaN(resolvedId) ? 0 : resolvedId;
|
||||||
|
|
||||||
if (isNewIssueRoute) {
|
const blank: IssueEntity = {
|
||||||
return {
|
id: safeId,
|
||||||
id: safeId,
|
type: 'Story',
|
||||||
type: 'Story',
|
assignee: '',
|
||||||
assignee: '',
|
epic: '',
|
||||||
epic: '',
|
name: '',
|
||||||
name: '',
|
dueDate: '',
|
||||||
dueDate: '',
|
description: '',
|
||||||
description: '',
|
estimatedTime: null,
|
||||||
estimatedTime: null,
|
dependsOnIds: [],
|
||||||
dependsOnIds: [],
|
comments: [],
|
||||||
priority: 'Moyenne',
|
priority: 'Moyenne',
|
||||||
status: 'draft',
|
status: 'draft',
|
||||||
progress: 0,
|
progress: 0,
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
const existingIssue = this.issuesStore.getById(safeId);
|
if (isNewIssueRoute) return blank;
|
||||||
|
|
||||||
return (
|
return this.issuesStore.getById(safeId) ?? blank;
|
||||||
existingIssue ?? {
|
|
||||||
id: safeId,
|
|
||||||
type: 'Story',
|
|
||||||
assignee: '',
|
|
||||||
epic: '',
|
|
||||||
name: '',
|
|
||||||
dueDate: '',
|
|
||||||
description: '',
|
|
||||||
estimatedTime: null,
|
|
||||||
dependsOnIds: [],
|
|
||||||
priority: 'Moyenne',
|
|
||||||
status: 'draft',
|
|
||||||
progress: 0,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,13 @@ export type IssueStatus = 'draft' | 'todo' | 'done' | 'in-progress';
|
|||||||
export type IssuePriority = 'Basse' | 'Moyenne' | 'Haute';
|
export type IssuePriority = 'Basse' | 'Moyenne' | 'Haute';
|
||||||
export type IssueType = 'Epic' | 'Bug' | 'Study' | 'Story' | 'Task' | 'Technical Story';
|
export type IssueType = 'Epic' | 'Bug' | 'Study' | 'Story' | 'Task' | 'Technical Story';
|
||||||
|
|
||||||
|
export type IssueComment = {
|
||||||
|
id: number;
|
||||||
|
text: string;
|
||||||
|
createdAt: string;
|
||||||
|
updatedAt: string | null;
|
||||||
|
};
|
||||||
|
|
||||||
export type IssueEntity = {
|
export type IssueEntity = {
|
||||||
id: number;
|
id: number;
|
||||||
type: IssueType;
|
type: IssueType;
|
||||||
@@ -16,6 +23,7 @@ export type IssueEntity = {
|
|||||||
description: string;
|
description: string;
|
||||||
estimatedTime: number | null;
|
estimatedTime: number | null;
|
||||||
dependsOnIds: number[];
|
dependsOnIds: number[];
|
||||||
|
comments: IssueComment[];
|
||||||
priority: IssuePriority;
|
priority: IssuePriority;
|
||||||
status: IssueStatus;
|
status: IssueStatus;
|
||||||
progress: number;
|
progress: number;
|
||||||
@@ -32,6 +40,7 @@ const DEFAULT_ISSUES: IssueEntity[] = [
|
|||||||
description: 'Corriger le comportement du menu sur petits ecrans.',
|
description: 'Corriger le comportement du menu sur petits ecrans.',
|
||||||
estimatedTime: 8,
|
estimatedTime: 8,
|
||||||
dependsOnIds: [],
|
dependsOnIds: [],
|
||||||
|
comments: [],
|
||||||
priority: 'Haute',
|
priority: 'Haute',
|
||||||
status: 'in-progress',
|
status: 'in-progress',
|
||||||
progress: 35,
|
progress: 35,
|
||||||
@@ -46,6 +55,7 @@ const DEFAULT_ISSUES: IssueEntity[] = [
|
|||||||
description: 'Fiabiliser les regles de validation du formulaire projet.',
|
description: 'Fiabiliser les regles de validation du formulaire projet.',
|
||||||
estimatedTime: 16,
|
estimatedTime: 16,
|
||||||
dependsOnIds: [],
|
dependsOnIds: [],
|
||||||
|
comments: [],
|
||||||
priority: 'Moyenne',
|
priority: 'Moyenne',
|
||||||
status: 'todo',
|
status: 'todo',
|
||||||
progress: 20,
|
progress: 20,
|
||||||
@@ -60,6 +70,7 @@ const DEFAULT_ISSUES: IssueEntity[] = [
|
|||||||
description: 'Mettre a jour le wording d accueil selon la charte produit.',
|
description: 'Mettre a jour le wording d accueil selon la charte produit.',
|
||||||
estimatedTime: 4,
|
estimatedTime: 4,
|
||||||
dependsOnIds: [],
|
dependsOnIds: [],
|
||||||
|
comments: [],
|
||||||
priority: 'Basse',
|
priority: 'Basse',
|
||||||
status: 'done',
|
status: 'done',
|
||||||
progress: 100,
|
progress: 100,
|
||||||
@@ -135,6 +146,7 @@ export class IssuesStore {
|
|||||||
type: issue.type ?? 'Story',
|
type: issue.type ?? 'Story',
|
||||||
estimatedTime: issue.estimatedTime ?? null,
|
estimatedTime: issue.estimatedTime ?? null,
|
||||||
dependsOnIds: normalizedDependencies,
|
dependsOnIds: normalizedDependencies,
|
||||||
|
comments: Array.isArray(issue.comments) ? issue.comments : [],
|
||||||
} as IssueEntity;
|
} as IssueEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user