init page projet

This commit is contained in:
Cédric OLIVIER
2026-05-22 17:48:06 +02:00
parent 286a0eca2e
commit c6cd273632
12 changed files with 360 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
import { Component, signal } from '@angular/core';
type Project = {
id: number;
name: string;
owner: string;
status: 'Actif' | 'En attente' | 'Nouveau';
progress: number;
};
@Component({
selector: 'app-projects',
imports: [],
templateUrl: './projects.html',
styleUrl: './projects.css',
})
export class Projects {
protected readonly projects = signal<Project[]>([
{ id: 1, name: 'Refonte Interface', owner: 'Marie', status: 'Actif', progress: 70 },
{ id: 2, name: 'API Inventaire', owner: 'Nabil', status: 'En attente', progress: 45 },
{ id: 3, name: 'Pipeline CI', owner: 'Sonia', status: 'Actif', progress: 90 },
]);
private nextId = 4;
protected createProject(): void {
const newProject: Project = {
id: this.nextId,
name: `Nouveau projet ${this.nextId}`,
owner: 'A definir',
status: 'Nouveau',
progress: 0,
};
this.projects.update((currentProjects) => [...currentProjects, newProject]);
this.nextId += 1;
}
}