Ajoute projet et migration milestone

Signed-off-by: Gato <cedric@goutailler-olivier.fr>
This commit is contained in:
2026-05-31 10:00:36 +02:00
parent 401da09f8f
commit 54d1534d4d
39 changed files with 1565 additions and 288 deletions
+6 -3
View File
@@ -37,6 +37,7 @@ export type IssueEntity = {
export class IssuesStore {
private readonly api = inject(IssuesApiService);
private readonly data = signal<IssueEntity[]>([]);
private currentProjectId: number | null = null;
readonly loading = signal(false);
readonly loaded = signal(false);
@@ -51,11 +52,13 @@ export class IssuesStore {
return ids.length === 0 ? 1 : Math.max(...ids) + 1;
}
async load(): Promise<void> {
if (this.loaded()) return;
async load(projectId: number): Promise<void> {
if (this.loaded() && this.currentProjectId === projectId) return;
this.currentProjectId = projectId;
this.loaded.set(false);
this.loading.set(true);
try {
const issues = await firstValueFrom(this.api.getAll());
const issues = await firstValueFrom(this.api.getAll(projectId));
this.data.set(issues.map((i) => this.normalizeIssue(i)));
this.loaded.set(true);
} finally {