Ajout du type d'issue dans les détails et la liste des issues
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
<div class="header-actions">
|
||||
@if (!isEditing) {
|
||||
<button type="button" class="edit-button" (click)="startEdit()">Editer l'issue</button>
|
||||
}
|
||||
<div class="more-wrapper">
|
||||
<button type="button" class="more-button" (click)="toggleMoreMenu()">More ▾</button>
|
||||
|
||||
@@ -34,6 +33,7 @@
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
@@ -55,6 +55,20 @@
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<td>
|
||||
@if (isEditing) {
|
||||
<select [(ngModel)]="issueTypeValue">
|
||||
@for (type of typeOptions; track type) {
|
||||
<option [value]="type">{{ type }}</option>
|
||||
}
|
||||
</select>
|
||||
} @else {
|
||||
{{ issueTypeValue }}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Epic</th>
|
||||
<td>
|
||||
@@ -135,21 +149,6 @@
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Status</th>
|
||||
<td>
|
||||
@if (isEditing) {
|
||||
<select [(ngModel)]="issue.status">
|
||||
<option value="draft">draft</option>
|
||||
<option value="todo">todo</option>
|
||||
<option value="done">done</option>
|
||||
<option value="in-progress">in-progress</option>
|
||||
</select>
|
||||
} @else {
|
||||
{{ issue.status }}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Progression</th>
|
||||
<td>
|
||||
|
||||
@@ -27,6 +27,13 @@ export class IssueDetail {
|
||||
'done',
|
||||
];
|
||||
|
||||
protected readonly typeOptions: IssueEntity['type'][] = [
|
||||
'Bug',
|
||||
'Study',
|
||||
'Story',
|
||||
'Technical Story',
|
||||
];
|
||||
|
||||
protected get dependencyIds(): number[] {
|
||||
return this.issue.dependsOnIds;
|
||||
}
|
||||
@@ -45,6 +52,14 @@ export class IssueDetail {
|
||||
this.issue.estimatedTime = value === null || value === undefined ? null : Number(value);
|
||||
}
|
||||
|
||||
protected get issueTypeValue(): IssueEntity['type'] {
|
||||
return this.issue.type;
|
||||
}
|
||||
|
||||
protected set issueTypeValue(value: IssueEntity['type']) {
|
||||
this.issue.type = value;
|
||||
}
|
||||
|
||||
constructor() {
|
||||
if (this.isEditing) {
|
||||
this.issueBeforeEdit = this.cloneIssue(this.issue);
|
||||
@@ -54,6 +69,7 @@ export class IssueDetail {
|
||||
protected startEdit(): void {
|
||||
this.issueBeforeEdit = this.cloneIssue(this.issue);
|
||||
this.isEditing = true;
|
||||
this.closeMoreMenu();
|
||||
}
|
||||
|
||||
protected cancelEdit(): void {
|
||||
@@ -119,6 +135,7 @@ export class IssueDetail {
|
||||
if (isNewIssueRoute) {
|
||||
return {
|
||||
id: safeId,
|
||||
type: 'Story',
|
||||
assignee: '',
|
||||
epic: '',
|
||||
name: '',
|
||||
@@ -137,6 +154,7 @@ export class IssueDetail {
|
||||
return (
|
||||
existingIssue ?? {
|
||||
id: safeId,
|
||||
type: 'Story',
|
||||
assignee: '',
|
||||
epic: '',
|
||||
name: '',
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Titre</th>
|
||||
<th>Type</th>
|
||||
<th>Priorite</th>
|
||||
<th>Statut</th>
|
||||
<th>Assignee</th>
|
||||
@@ -27,6 +28,7 @@
|
||||
(keydown.enter)="openIssue(issue.id)"
|
||||
>
|
||||
<td>{{ issue.name }}</td>
|
||||
<td>{{ issue.type }}</td>
|
||||
<td>{{ issue.priority }}</td>
|
||||
<td>{{ issue.status }}</td>
|
||||
<td>{{ issue.assignee }}</td>
|
||||
|
||||
@@ -4,9 +4,11 @@ const ISSUES_STORAGE_KEY = 'bonsai.issues';
|
||||
|
||||
export type IssueStatus = 'draft' | 'todo' | 'done' | 'in-progress';
|
||||
export type IssuePriority = 'Basse' | 'Moyenne' | 'Haute';
|
||||
export type IssueType = 'Bug' | 'Study' | 'Story' | 'Technical Story';
|
||||
|
||||
export type IssueEntity = {
|
||||
id: number;
|
||||
type: IssueType;
|
||||
assignee: string;
|
||||
epic: string;
|
||||
name: string;
|
||||
@@ -22,6 +24,7 @@ export type IssueEntity = {
|
||||
const DEFAULT_ISSUES: IssueEntity[] = [
|
||||
{
|
||||
id: 1,
|
||||
type: 'Bug',
|
||||
assignee: 'Marie',
|
||||
epic: 'EPIC-UI',
|
||||
name: 'Bug affichage menu mobile',
|
||||
@@ -35,6 +38,7 @@ const DEFAULT_ISSUES: IssueEntity[] = [
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
type: 'Study',
|
||||
assignee: 'Nabil',
|
||||
epic: 'EPIC-FORM',
|
||||
name: 'Erreur validation formulaire projet',
|
||||
@@ -48,6 +52,7 @@ const DEFAULT_ISSUES: IssueEntity[] = [
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
type: 'Story',
|
||||
assignee: 'Sonia',
|
||||
epic: 'EPIC-CONTENT',
|
||||
name: 'Mise a jour message de bienvenue',
|
||||
@@ -86,6 +91,7 @@ export class IssuesStore {
|
||||
createDraftIssue(): IssueEntity {
|
||||
const draftIssue: IssueEntity = this.normalizeIssue({
|
||||
id: this.getNextId(),
|
||||
type: 'Story',
|
||||
assignee: '',
|
||||
epic: '',
|
||||
name: '',
|
||||
@@ -145,6 +151,7 @@ export class IssuesStore {
|
||||
|
||||
return {
|
||||
...issue,
|
||||
type: issue.type ?? 'Story',
|
||||
estimatedTime: issue.estimatedTime ?? null,
|
||||
dependsOnIds: normalizedDependencies,
|
||||
} as IssueEntity;
|
||||
|
||||
Reference in New Issue
Block a user