Correction du worflow release : on ne fait plus les tests (évite le doublons de test avec le ci.yml).
Some checks failed
Tests unitaires / Brain (Python · pytest + couverture) (push) Successful in 21s
Tests unitaires / Web (Angular · vitest + couverture) (push) Successful in 30s
Tests unitaires / Core (Java · mvn test + JaCoCo) (push) Successful in 2m22s
Build & Push Images / build (brain) (push) Successful in 1m16s
E2E Tests / e2e (push) Failing after 5m24s
Build & Push Images / build (core) (push) Successful in 3m5s
Build & Push Images / build-switcher (push) Successful in 50s
Build & Push Images / build (web) (push) Successful in 1m56s

Correction de tests coté java + config
Suppression de classes inutilisées coté Angular
This commit is contained in:
2026-06-19 00:36:30 +02:00
parent 13f4b994ab
commit 5aa08a3a27
41 changed files with 155 additions and 259 deletions

View File

@@ -52,7 +52,8 @@
"development": {
"optimization": false,
"sourceMap": true,
"namedChunks": true
"namedChunks": true,
"outputHashing": "none"
}
},
"defaultConfiguration": "production"

View File

@@ -35,7 +35,7 @@ test.describe('NPC edit', () => {
await page.getByLabel(/Nom du PNJ/i).fill(newName);
await page.getByRole('button', { name: /^Enregistrer$/i }).click();
await page.getByRole('button', { name: /^Sauvegarder$/i }).click();
// Retour à la campagne après save
await expect(page).toHaveURL(new RegExp(`/campaigns/${campaign.id}$`));
@@ -48,7 +48,7 @@ test.describe('NPC edit', () => {
await page.goto(`/campaigns/${campaign.id}/npcs/${npc.id}/edit`);
const nameField = page.getByLabel(/Nom du PNJ/i);
const saveBtn = page.getByRole('button', { name: /^Enregistrer$/i });
const saveBtn = page.getByRole('button', { name: /^Sauvegarder$/i });
await expect(saveBtn).toBeEnabled();
await nameField.fill('');

View File

@@ -42,7 +42,7 @@ test.describe('GameSystem edit', () => {
await page.getByLabel(/^Nom/i).fill(newName);
await page.getByLabel(/Description courte/i).fill(newDescription);
await page.getByRole('button', { name: /^Enregistrer$/i }).click();
await page.getByRole('button', { name: /^Sauvegarder$/i }).click();
// Retour a la liste apres save.
await expect(page).toHaveURL(/\/game-systems$/);
@@ -57,7 +57,7 @@ test.describe('GameSystem edit', () => {
await expect(page.getByLabel(/^Nom/i)).toHaveValue(gs.name);
const nameField = page.getByLabel(/^Nom/i);
const saveBtn = page.getByRole('button', { name: /^Enregistrer$/i });
const saveBtn = page.getByRole('button', { name: /^Sauvegarder$/i });
await expect(saveBtn).toBeEnabled();
await nameField.fill('');

View File

@@ -38,7 +38,7 @@ test.describe('GameSystem rule sections editor', () => {
await card.locator('.section-content').fill(sectionContent);
// Save + retour a la liste.
await page.getByRole('button', { name: /^Enregistrer$/i }).click();
await page.getByRole('button', { name: /^Sauvegarder$/i }).click();
await expect(page).toHaveURL(/\/game-systems$/);
// Verification cote API : le markdown contient bien la section + son contenu.

View File

@@ -44,7 +44,7 @@ test.describe('GameSystem template fields editor (PJ / PNJ)', () => {
await expect(row.locator('.tfe-name')).toHaveValue('Histoire');
// Save → retour a la liste.
await page.getByRole('button', { name: /^Enregistrer$/i }).click();
await page.getByRole('button', { name: /^Sauvegarder$/i }).click();
await expect(page).toHaveURL(/\/game-systems$/);
// Verification API : le champ est bien dans characterTemplate.
@@ -88,7 +88,7 @@ test.describe('GameSystem template fields editor (PJ / PNJ)', () => {
await expect(tfe(page, 'PJ').locator('.tfe-item').first().locator('.tfe-name')).toHaveValue('Histoire');
await expect(tfe(page, 'PNJ').locator('.tfe-item').first().locator('.tfe-name')).toHaveValue('Motivation');
await page.getByRole('button', { name: /^Enregistrer$/i }).click();
await page.getByRole('button', { name: /^Sauvegarder$/i }).click();
await expect(page).toHaveURL(/\/game-systems$/);
const persisted = await request.get(`/api/game-systems/${gs.id}`).then((r) => r.json());

4
web/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "loremind-web",
"version": "0.16.2",
"version": "0.16.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "loremind-web",
"version": "0.16.2",
"version": "0.16.3",
"dependencies": {
"@angular/animations": "^21.2.16",
"@angular/common": "^21.2.16",

View File

@@ -1,6 +1,6 @@
{
"name": "loremind-web",
"version": "0.16.2",
"version": "0.16.3",
"description": "LoreMind Frontend - Angular",
"scripts": {
"ng": "ng",

View File

@@ -17,6 +17,12 @@ export default defineConfig({
reporter: process.env['CI'] ? [['html', { open: 'never' }], ['list']] : 'html',
use: {
baseURL,
// Locale FR épinglée : l'app résout sa langue via celle du navigateur
// (LanguageService.resolveInitialLang → getBrowserLang()). Sans ça, le
// Chromium de Playwright démarre en en-US → l'UI passe en anglais → tous les
// tests, écrits pour les libellés français, échouent (vert sur une machine en
// locale FR, rouge en CI Linux en-US). On fixe donc le français, déterministe.
locale: 'fr-FR',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',

View File

@@ -108,7 +108,7 @@
</tr>
</thead>
<tbody>
@for (row of tableValues[field.name] ?? []; track $index; let ri = $index) {
@for (row of tableRows(field.name); track $index; let ri = $index) {
<tr>
@for (col of field.labels; track $index) {
<td>

View File

@@ -240,6 +240,11 @@ export class PageEditComponent implements OnInit, OnDestroy {
this.tableValues[fieldName]?.splice(rowIndex, 1);
}
/** Lignes du tableau d'un champ — toujours un tableau (jamais undefined) pour le `@for`. */
tableRows(fieldName: string): Array<Record<string, string>> {
return this.tableValues[fieldName] ?? [];
}
// --- Chat IA conversationnel (Phase b5) --------------------------------
toggleChat(): void {

View File

@@ -1,28 +0,0 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { ProgressionStatus } from './campaign.model';
/**
* Endpoints de progression des quêtes pour un Playthrough.
* Modèle "absence = NOT_STARTED" — envoyer NOT_STARTED supprime la ligne côté backend.
*/
@Injectable({ providedIn: 'root' })
export class QuestProgressionService {
constructor(private http: HttpClient) {}
/** Map chapterId -> ProgressionStatus pour le Playthrough donné. */
list(playthroughId: string): Observable<Record<string, ProgressionStatus>> {
return this.http.get<Record<string, ProgressionStatus>>(
`/api/playthroughs/${playthroughId}/quest-progressions`
);
}
setStatus(playthroughId: string, chapterId: string, status: ProgressionStatus): Observable<void> {
return this.http.put<void>(
`/api/playthroughs/${playthroughId}/quest-progressions/${chapterId}`,
{ status }
);
}
}

View File

@@ -1,4 +1,4 @@
@if (fields?.length) {
@if (fields.length) {
<div class="dff">
@for (f of fields; track trackByName($index, f)) {
<div class="dff-field">

View File

@@ -1,6 +0,0 @@
<span [class]="cssClass" [attr.aria-label]="label" [title]="label">
<lucide-icon [img]="icon" [size]="14"></lucide-icon>
@if (!compact) {
<span class="status-label">{{ label }}</span>
}
</span>

View File

@@ -1,43 +0,0 @@
.status-badge {
display: inline-flex;
align-items: center;
gap: 0.35rem;
padding: 0.2rem 0.55rem;
border-radius: 999px;
font-size: 0.78rem;
font-weight: 500;
line-height: 1;
border: 1px solid transparent;
}
.status-label {
white-space: nowrap;
}
// Verrouillée — gris discret
.status-locked {
background: rgba(128, 128, 128, 0.12);
color: #6b6b6b;
border-color: rgba(128, 128, 128, 0.25);
}
// Disponible — vert calme (prête à être lancée)
.status-available {
background: rgba(52, 168, 83, 0.12);
color: #2f7a47;
border-color: rgba(52, 168, 83, 0.3);
}
// En cours — bleu actif
.status-in_progress {
background: rgba(66, 133, 244, 0.14);
color: #2c6cd6;
border-color: rgba(66, 133, 244, 0.35);
}
// Terminée — violet doux (clos, pas neutre)
.status-completed {
background: rgba(120, 80, 200, 0.12);
color: #6d4fb5;
border-color: rgba(120, 80, 200, 0.3);
}

View File

@@ -1,48 +0,0 @@
import { Component, Input } from '@angular/core';
import { LucideAngularModule, Lock, Circle, Play, CheckCircle2, LucideIconData } from 'lucide-angular';
import { TranslateService } from '@ngx-translate/core';
import { QuestStatus } from '../../services/campaign.model';
/**
* Badge visuel pour un QuestStatus (vue Hub).
* Composant standalone, sans dépendance métier.
*/
@Component({
selector: 'app-quest-status-badge',
imports: [LucideAngularModule],
templateUrl: './quest-status-badge.component.html',
styleUrls: ['./quest-status-badge.component.scss']
})
export class QuestStatusBadgeComponent {
@Input() status: QuestStatus | undefined | null = 'AVAILABLE';
/** Variante visuelle compacte (sans label) — utile pour les listes denses. */
@Input() compact = false;
constructor(private translate: TranslateService) {}
get icon(): LucideIconData {
switch (this.status) {
case 'LOCKED': return Lock;
case 'IN_PROGRESS': return Play;
case 'COMPLETED': return CheckCircle2;
case 'AVAILABLE':
default: return Circle;
}
}
get label(): string {
switch (this.status) {
case 'LOCKED': return this.translate.instant('questStatusBadge.locked');
case 'IN_PROGRESS': return this.translate.instant('questStatusBadge.inProgress');
case 'COMPLETED': return this.translate.instant('questStatusBadge.completed');
case 'AVAILABLE':
default: return this.translate.instant('questStatusBadge.available');
}
}
get cssClass(): string {
return `status-badge status-${(this.status ?? 'AVAILABLE').toLowerCase()}`;
}
}