Stack qualité CI (MegaLinter, Trivy, ESLint) et purge du backlog lint web
Qualité & Sécurité / MegaLinter (PMD · Ruff · Bandit · gitleaks · hadolint) (push) Successful in 1m9s
Build & Push Images / build (brain) (push) Successful in 1m10s
Qualité & Sécurité / Trivy (CVE dépendances Maven / pip / npm) (push) Failing after 2m36s
Build & Push Images / build (web) (push) Successful in 1m48s
Build & Push Images / build-switcher (push) Successful in 20s
Build & Push Images / build (core) (push) Successful in 3m9s
Qualité & Sécurité / Web (ESLint · angular-eslint + sonarjs) (push) Successful in 38s

CI (Gitea Actions) :
- Nouveau workflow quality.yml (séparé de ci.yml, non bloquant pour la release) :
  MegaLinter v9 (PMD, Ruff, Bandit, gitleaks, hadolint), ng lint (web) et
  Trivy (CVE des dépendances Maven/pip/npm), sur main + beta + PR
- Trivy : préchargement du cache Maven avant le scan — sans ça Maven Central
  rate-limite l'IP du runner (429) en résolvant les BOMs du parent Spring Boot
- upload-artifact v4 → v3 : l'API artifacts v4 n'est pas supportée par Gitea
  (corrige aussi l'upload du rapport Playwright de e2e.yml, cassé depuis toujours)
- Ruleset PMD projet (java-pmd-ruleset.xml, auto-détecté par MegaLinter) orienté
  bugs réels, sans le style Lombok-hostile du défaut : 11 337 → 65 findings ;
  PMD en mode rapport (JAVA_PMD_DISABLE_ERRORS) le temps de purger ce backlog

Web :
- angular-eslint 21 + eslint-plugin-sonarjs : les règles Sonar vivent désormais
  dans ESLint (config web/eslint.config.js, réglages justifiés en commentaire)
- tsconfig : skipLibCheck + types:[] + node_modules ré-exclu — répare les builds
  desktop Windows/Linux cassés par le conflit @types/eslint-scope vs ESLint 9
- Purge du backlog lint : 114 erreurs → 0 sur 66 fichiers (ngOnDestroy vides
  supprimés, any typés avec les vrais DTOs, outputs (close) → (closed), regex
  super-linéaires désamorcées, ternaires/fonctions imbriqués dépliés, intention
  documentée sur les catch/error volontairement vides)
- Bug latent corrigé au passage : license.service.disconnect() émettait
  undefined au lieu de true en cas de succès (masqué par un double cast)
This commit is contained in:
2026-07-07 01:05:00 +02:00
parent 3e9e828225
commit 42c4b53ced
71 changed files with 353 additions and 276 deletions
@@ -154,10 +154,14 @@ export class BlockGridBuilderComponent implements OnDestroy {
addLabel(block: TemplateField): void { block.labels = [...(block.labels ?? []), '']; this.emit(); }
updateLabel(block: TemplateField, i: number, value: string): void {
if (!block.labels) return; block.labels[i] = value; this.emit();
if (!block.labels) return;
block.labels[i] = value;
this.emit();
}
removeLabel(block: TemplateField, i: number): void {
if (!block.labels) return; block.labels = block.labels.filter((_, k) => k !== i); this.emit();
if (!block.labels) return;
block.labels = block.labels.filter((_, k) => k !== i);
this.emit();
}
// --- Glisser : création / déplacement / redimensionnement ---------------
@@ -1,4 +1,4 @@
import { Component, OnDestroy, OnInit, DestroyRef } from '@angular/core';
import { Component, OnInit, DestroyRef } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { forkJoin } from 'rxjs';
@@ -33,7 +33,7 @@ import { ConfirmDialogService } from '../../shared/confirm-dialog/confirm-dialog
templateUrl: './folder-view.component.html',
styleUrls: ['./folder-view.component.scss']
})
export class FolderViewComponent implements OnInit, OnDestroy {
export class FolderViewComponent implements OnInit {
readonly Folder = Folder;
readonly FileText = FileText;
readonly Pencil = Pencil;
@@ -237,11 +237,4 @@ export class FolderViewComponent implements OnInit, OnDestroy {
error: () => console.error('Impossible de récupérer les dépendances du dossier')
});
}
ngOnDestroy(): void {
// Volontairement vide : la sidebar reste prise en charge par le composant
// suivant (autre sous-route ou le composant detail parent) qui appellera
// show(). Eviter d'appeler hide() ici previent le clignotement / la
// disparition de la sidebar lors des navigations internes a la section.
}
}
@@ -11,7 +11,7 @@ import { TranslatePipe } from '@ngx-translate/core';
styleUrls: ['./lore-create.component.scss']
})
export class LoreCreateComponent {
@Output() close = new EventEmitter<void>();
@Output() closed = new EventEmitter<void>();
@Output() created = new EventEmitter<{ name: string; description: string }>();
readonly BookCopy = BookCopy;
@@ -32,6 +32,6 @@ export class LoreCreateComponent {
}
onCancel(): void {
this.close.emit();
this.closed.emit();
}
}
@@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { ReactiveFormsModule, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
@@ -11,7 +11,7 @@ import { LayoutService } from '../../services/layout.service';
import { LoreNode } from '../../services/lore.model';
import { loadLoreSidebarData, buildLoreSidebarConfig } from '../lore-sidebar.helper';
import { popReturnTo } from '../return-stack.helper';
import { LORE_ICON_OPTIONS, IconOption, resolveIcon } from '../lore-icons';
import { LORE_ICON_OPTIONS, IconOption } from '../lore-icons';
@Component({
selector: 'app-lore-node-create',
@@ -19,7 +19,7 @@ import { LORE_ICON_OPTIONS, IconOption, resolveIcon } from '../lore-icons';
templateUrl: './lore-node-create.component.html',
styleUrls: ['./lore-node-create.component.scss']
})
export class LoreNodeCreateComponent implements OnInit, OnDestroy {
export class LoreNodeCreateComponent implements OnInit {
readonly iconOptions: IconOption[] = LORE_ICON_OPTIONS;
@@ -109,11 +109,4 @@ export class LoreNodeCreateComponent implements OnInit, OnDestroy {
}
this.router.navigate(['/lore', this.loreId]);
}
ngOnDestroy(): void {
// Volontairement vide : la sidebar reste prise en charge par le composant
// suivant (autre sous-route ou le composant detail parent) qui appellera
// show(). Eviter d'appeler hide() ici previent le clignotement / la
// disparition de la sidebar lors des navigations internes a la section.
}
}
@@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy, DestroyRef } from '@angular/core';
import { Component, OnInit, DestroyRef } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ReactiveFormsModule, FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -38,7 +38,7 @@ import { LORE_ICON_OPTIONS, IconOption } from '../lore-icons';
templateUrl: './lore-node-edit.component.html',
styleUrls: ['./lore-node-edit.component.scss']
})
export class LoreNodeEditComponent implements OnInit, OnDestroy {
export class LoreNodeEditComponent implements OnInit {
readonly iconOptions: IconOption[] = LORE_ICON_OPTIONS;
@@ -147,11 +147,4 @@ export class LoreNodeEditComponent implements OnInit, OnDestroy {
if (!key) return null;
return this.iconOptions.find(o => o.key === key)?.icon ?? null;
}
ngOnDestroy(): void {
// Volontairement vide : la sidebar reste prise en charge par le composant
// suivant (autre sous-route ou le composant detail parent) qui appellera
// show(). Eviter d'appeler hide() ici previent le clignotement / la
// disparition de la sidebar lors des navigations internes a la section.
}
}
+1 -1
View File
@@ -39,7 +39,7 @@
@if (showCreateModal) {
<app-lore-create
(close)="onModalClose()"
(closed)="onModalClose()"
(created)="onLoreCreated($event)">
</app-lore-create>
}
@@ -111,7 +111,7 @@
[systemPromptAddon]="wizardSystemPrompt"
[quickSuggestions]="wizardSuggestions"
[primaryAction]="wizardPrimaryAction"
(close)="closeWizard()"
(closed)="closeWizard()"
(assistantReply)="onWizardReply($event)"
(primaryActionClick)="applyWizardAndCreate()">
</app-ai-chat-drawer>
@@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy, DestroyRef } from '@angular/core';
import { Component, OnInit, DestroyRef } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ReactiveFormsModule, FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -32,7 +32,7 @@ import { AiChatDrawerComponent, ChatPrimaryAction } from '../../shared/ai-chat-d
templateUrl: './page-create.component.html',
styleUrls: ['./page-create.component.scss']
})
export class PageCreateComponent implements OnInit, OnDestroy {
export class PageCreateComponent implements OnInit {
readonly FileText = FileText;
readonly Sparkles = Sparkles;
readonly Plus = Plus;
@@ -165,7 +165,7 @@ export class PageCreateComponent implements OnInit, OnDestroy {
}
private restoreDraft(): void {
let raw: string | null = null;
let raw: string | null;
try { raw = sessionStorage.getItem(this.draftKey); } catch { return; }
if (!raw) return;
sessionStorage.removeItem(this.draftKey);
@@ -328,7 +328,9 @@ Les clés du JSON doivent correspondre EXACTEMENT aux noms de champs indiqués.
* Retourne null si absent ou JSON invalide.
*/
private extractValuesBlock(reply: string): Record<string, string> | null {
const match = reply.match(/<values>\s*([\s\S]*?)\s*<\/values>/i);
// Pas de \s* autour de la capture (backtracking quadratique) :
// JSON.parse tolère nativement les blancs en tête/queue.
const match = reply.match(/<values>([\s\S]*?)<\/values>/i);
if (!match) return null;
try {
const parsed = JSON.parse(match[1]) as Record<string, unknown>;
@@ -342,11 +344,4 @@ Les clés du JSON doivent correspondre EXACTEMENT aux noms de champs indiqués.
return null;
}
}
ngOnDestroy(): void {
// Volontairement vide : la sidebar reste prise en charge par le composant
// suivant (autre sous-route ou le composant detail parent) qui appellera
// show(). Eviter d'appeler hide() ici previent le clignotement / la
// disparition de la sidebar lors des navigations internes a la section.
}
}
@@ -195,6 +195,6 @@
[isOpen]="chatOpen"
[quickSuggestions]="chatQuickSuggestions"
[primaryAction]="chatPrimaryAction"
(close)="chatOpen = false"
(closed)="chatOpen = false"
(primaryActionClick)="onChatFillRequested()">
</app-ai-chat-drawer>
@@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy, DestroyRef } from '@angular/core';
import { Component, OnInit, DestroyRef } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormsModule } from '@angular/forms';
@@ -44,7 +44,7 @@ import { ConfirmDialogService } from '../../shared/confirm-dialog/confirm-dialog
templateUrl: './page-edit.component.html',
styleUrls: ['./page-edit.component.scss']
})
export class PageEditComponent implements OnInit, OnDestroy {
export class PageEditComponent implements OnInit {
readonly Sparkles = Sparkles;
readonly Plus = Plus;
readonly Trash2 = Trash2;
@@ -84,7 +84,7 @@ export class PageEditComponent implements OnInit, OnDestroy {
/** Valeurs des champs KEY_VALUE_LIST (liste clé/valeur) : fieldName → (label → valeur). */
keyValueValues: Record<string, Record<string, string>> = {};
/** Valeurs des champs TABLE : fieldName → lignes (colonne → cellule). */
tableValues: Record<string, Array<Record<string, string>>> = {};
tableValues: Record<string, Record<string, string>[]> = {};
/** Étiquettes libres (Phase 5B). */
tags: string[] = [];
/** IDs des pages liées (Phase 5B). */
@@ -200,7 +200,7 @@ export class PageEditComponent implements OnInit, OnDestroy {
const imageBase: Record<string, string[]> = {};
const framingBase: Record<string, Record<string, ImageFraming>> = {};
const kvBase: Record<string, Record<string, string>> = {};
const tableBase: Record<string, Array<Record<string, string>>> = {};
const tableBase: Record<string, Record<string, string>[]> = {};
// Les valeurs sont rangées par clé STABLE (id) ; on relit d'abord par clé,
// puis par nom (pages dont les valeurs étaient encore rangées par nom — elles
// sont ainsi migrées vers la clé id à la prochaine sauvegarde).
@@ -259,7 +259,9 @@ export class PageEditComponent implements OnInit, OnDestroy {
addTableRow(fieldName: string, columns: string[] | null | undefined): void {
const row: Record<string, string> = {};
for (const col of columns ?? []) row[col] = '';
(this.tableValues[fieldName] ??= []).push(row);
const rows = this.tableValues[fieldName] ?? [];
rows.push(row);
this.tableValues[fieldName] = rows;
}
removeTableRow(fieldName: string, rowIndex: number): void {
@@ -267,7 +269,7 @@ export class PageEditComponent implements OnInit, OnDestroy {
}
/** Lignes du tableau d'un champ — toujours un tableau (jamais undefined) pour le `@for`. */
tableRows(fieldName: string): Array<Record<string, string>> {
tableRows(fieldName: string): Record<string, string>[] {
return this.tableValues[fieldName] ?? [];
}
@@ -343,11 +345,4 @@ export class PageEditComponent implements OnInit, OnDestroy {
});
});
}
ngOnDestroy(): void {
// Volontairement vide : la sidebar reste prise en charge par le composant
// suivant (autre sous-route ou le composant detail parent) qui appellera
// show(). Eviter d'appeler hide() ici previent le clignotement / la
// disparition de la sidebar lors des navigations internes a la section.
}
}
@@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy, DestroyRef } from '@angular/core';
import { Component, OnInit, DestroyRef } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
@@ -36,7 +36,7 @@ import { ConfirmDialogService } from '../../shared/confirm-dialog/confirm-dialog
templateUrl: './page-view.component.html',
styleUrls: ['./page-view.component.scss']
})
export class PageViewComponent implements OnInit, OnDestroy {
export class PageViewComponent implements OnInit {
readonly Pencil = Pencil;
readonly Trash2 = Trash2;
@@ -155,7 +155,7 @@ export class PageViewComponent implements OnInit, OnDestroy {
}
/** Lignes d'un champ TABLE (liste vide si jamais rempli). */
tableRowsOf(field: TemplateField): Array<Record<string, string>> {
tableRowsOf(field: TemplateField): Record<string, string>[] {
const v = this.page?.tableValues;
return v?.[blockKey(field)] ?? v?.[field.name] ?? [];
}
@@ -196,11 +196,4 @@ export class PageViewComponent implements OnInit, OnDestroy {
});
});
}
ngOnDestroy(): void {
// Volontairement vide : la sidebar reste prise en charge par le composant
// suivant (autre sous-route ou le composant detail parent) qui appellera
// show(). Eviter d'appeler hide() ici previent le clignotement / la
// disparition de la sidebar lors des navigations internes a la section.
}
}
@@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { ReactiveFormsModule, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
@@ -24,7 +24,7 @@ import { popReturnTo } from '../return-stack.helper';
templateUrl: './template-create.component.html',
styleUrls: ['./template-create.component.scss']
})
export class TemplateCreateComponent implements OnInit, OnDestroy {
export class TemplateCreateComponent implements OnInit {
form: FormGroup;
loreId = '';
nodes: LoreNode[] = [];
@@ -85,7 +85,7 @@ export class TemplateCreateComponent implements OnInit, OnDestroy {
}
private restoreDraft(): void {
let raw: string | null = null;
let raw: string | null;
try { raw = sessionStorage.getItem(this.draftKey); } catch { return; }
if (!raw) return;
sessionStorage.removeItem(this.draftKey);
@@ -146,11 +146,4 @@ export class TemplateCreateComponent implements OnInit, OnDestroy {
}
this.router.navigate(['/lore', this.loreId]);
}
ngOnDestroy(): void {
// Volontairement vide : la sidebar reste prise en charge par le composant
// suivant (autre sous-route ou le composant detail parent) qui appellera
// show(). Eviter d'appeler hide() ici previent le clignotement / la
// disparition de la sidebar lors des navigations internes a la section.
}
}