Führe Abschnitte mit Raster, gemeinsames Designsystem und globales Website-Gerüst ein.
CI Feature / test (push) Failing after 20s
CI Feature / test (push) Failing after 20s
- Seite → Abschnitte → Plätze → Widgets: sechs Raster mit höchstens vier Einheiten, Hintergrund, Breite, Abstand und Trenner als Aufzählungswerte; je Platz ein Widget aus dem bestehenden Register. Neue Spalte page_revisions.sections (ergänzend); blocks erhält weiterhin alle Widgets in Lesereihenfolge als Rollback-Fassung. - Widgets erhalten Mindest- und Vorzugsbreite; Darstellung über Container-Abfragen. - Editor: Abschnitts-Repeater mit grafischer Rasterauswahl, Plätzen im Rasterverhältnis, breiter Arbeitsfläche, kompakten Vorschauen ohne Bildlaufleiste, Meldungen mit Abschnitt und Platz; Rasterwechsel entfernt nie ein Widget. Seite duplizieren. - Designsystem: Marken- und Bedeutungs-Tokens (vorläufig), gemeinsame Grundkomponenten, Nunito/Source Sans 3 lokal; Mitgliederbereich nutzt dieselben Tokens und die Wortmarke. - Kopfzeile, mobile Navigation, Untermenü (parent_id, ergänzend), Fußbereichsgruppen, vorbereiteter Warenkorbzugang (abgeschaltet). Öffentliche Seiten gleich für alle Besucher. - cms:revert-published als Wiederherstellungsweg vor einem Code-Rollback. Die Editor-Tests der ersten Iteration sind bewusst auf den neuen Formularzustand (sections statt blocks) umgestellt; ihre Prüfungen gelten unverändert für die Widgets. Der Vorschautest erwartet keine anmeldeabhängige Kopfzeile mehr (ADR-32). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
db4bd30319
commit
480d55989b
57 files changed
+4730
-818
No files matched your search
@@ -25,6 +25,23 @@ public function description(): string
|
||||
return 'Hervorgehobene Fläche mit Überschrift, Text und einer Schaltfläche.';
|
||||
}
|
||||
|
||||
public function minUnits(): int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function preferredUnits(): int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function stages(): array
|
||||
{
|
||||
return [
|
||||
'fluid' => 'Text und Schaltfläche untereinander, Schaltfläche volle Breite unter 20rem',
|
||||
];
|
||||
}
|
||||
|
||||
public function icon(): string
|
||||
{
|
||||
return 'heroicon-o-megaphone';
|
||||
|
||||
@@ -35,6 +35,24 @@ public function description(): string
|
||||
return 'Mehrere Karten mit Titel, Text, Linkziel und optionalem Bild. Als Raster oder kompakte Liste.';
|
||||
}
|
||||
|
||||
public function minUnits(): int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function preferredUnits(): int
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public function stages(): array
|
||||
{
|
||||
return [
|
||||
'narrow' => 'eine Karte je Zeile',
|
||||
'wide' => 'so viele Karten nebeneinander, wie bei mindestens 14rem Kartenbreite passen',
|
||||
];
|
||||
}
|
||||
|
||||
public function icon(): string
|
||||
{
|
||||
return 'heroicon-o-squares-2x2';
|
||||
|
||||
@@ -37,6 +37,24 @@ public function description(): string
|
||||
return 'Ausgewählte Programme und Module; Titel und Beschreibung kommen automatisch aus den Fachdaten.';
|
||||
}
|
||||
|
||||
public function minUnits(): int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function preferredUnits(): int
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public function stages(): array
|
||||
{
|
||||
return [
|
||||
'narrow' => 'eine Karte je Zeile, Symbolfläche über dem Text',
|
||||
'wide' => 'mehrere Karten nebeneinander ab 16rem Kartenbreite',
|
||||
];
|
||||
}
|
||||
|
||||
public function icon(): string
|
||||
{
|
||||
return 'heroicon-o-rectangle-stack';
|
||||
|
||||
@@ -24,6 +24,23 @@ public function description(): string
|
||||
return 'Häufige Fragen mit Antworten.';
|
||||
}
|
||||
|
||||
public function minUnits(): int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function preferredUnits(): int
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public function stages(): array
|
||||
{
|
||||
return [
|
||||
'fluid' => 'Fragen untereinander; Antwortlänge auf Lesebreite begrenzt',
|
||||
];
|
||||
}
|
||||
|
||||
public function icon(): string
|
||||
{
|
||||
return 'heroicon-o-question-mark-circle';
|
||||
|
||||
@@ -23,6 +23,23 @@ public function description(): string
|
||||
return 'Abschnittsüberschrift mit kurzem Einleitungstext.';
|
||||
}
|
||||
|
||||
public function minUnits(): int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function preferredUnits(): int
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public function stages(): array
|
||||
{
|
||||
return [
|
||||
'fluid' => 'Überschriftgröße folgt der Slotbreite',
|
||||
];
|
||||
}
|
||||
|
||||
public function icon(): string
|
||||
{
|
||||
return 'heroicon-o-h1';
|
||||
|
||||
@@ -30,6 +30,24 @@ public function description(): string
|
||||
return 'Großer Seiteneinstieg mit Überschrift, Beschreibung, optionalem Bild und optionaler Schaltfläche.';
|
||||
}
|
||||
|
||||
public function minUnits(): int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function preferredUnits(): int
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public function stages(): array
|
||||
{
|
||||
return [
|
||||
'narrow' => 'unter 48rem Slotbreite: Bild unter dem Text',
|
||||
'wide' => 'ab 48rem: Bild neben dem Text, größere Überschrift',
|
||||
];
|
||||
}
|
||||
|
||||
public function icon(): string
|
||||
{
|
||||
return 'heroicon-o-sparkles';
|
||||
|
||||
@@ -35,6 +35,24 @@ public function description(): string
|
||||
return 'Bild neben formatiertem Text; Bild links oder rechts, auf dem Smartphone untereinander.';
|
||||
}
|
||||
|
||||
public function minUnits(): int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function preferredUnits(): int
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public function stages(): array
|
||||
{
|
||||
return [
|
||||
'narrow' => 'unter 36rem Slotbreite: Bild über dem Text',
|
||||
'wide' => 'ab 36rem: Bild links oder rechts neben dem Text',
|
||||
];
|
||||
}
|
||||
|
||||
public function version(): int
|
||||
{
|
||||
return 2;
|
||||
|
||||
@@ -23,6 +23,23 @@ public function description(): string
|
||||
return 'Längerer Text in Absätzen. Eine Leerzeile beginnt einen neuen Absatz.';
|
||||
}
|
||||
|
||||
public function minUnits(): int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function preferredUnits(): int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function stages(): array
|
||||
{
|
||||
return [
|
||||
'fluid' => 'Zeilenlänge höchstens etwa 70 Zeichen',
|
||||
];
|
||||
}
|
||||
|
||||
public function icon(): string
|
||||
{
|
||||
return 'heroicon-o-bars-3-bottom-left';
|
||||
|
||||
@@ -45,6 +45,10 @@ public function register(WidgetType $type): void
|
||||
throw new InvalidArgumentException("Widget „{$key}“ braucht eine Schemaversion ab 1.");
|
||||
}
|
||||
|
||||
if ($type->minUnits() < 1 || $type->minUnits() > 4 || $type->preferredUnits() < $type->minUnits() || $type->preferredUnits() > 4) {
|
||||
throw new InvalidArgumentException("Widget „{$key}“ braucht eine Mindest- und Vorzugsbreite zwischen 1 und 4 Rastereinheiten.");
|
||||
}
|
||||
|
||||
if ($type->variants() === []) {
|
||||
throw new InvalidArgumentException("Widget „{$key}“ braucht mindestens eine Darstellungsvariante.");
|
||||
}
|
||||
@@ -137,7 +141,7 @@ public function upcast(array $block): ?array
|
||||
}
|
||||
|
||||
/**
|
||||
* Prüft und bereinigt Bausteine für eine neue Revision.
|
||||
* Prüft und bereinigt eine flache Bausteinliste (Fehlerschlüssel "blocks.N…").
|
||||
*
|
||||
* @param array<int|string, mixed> $blocks
|
||||
* @return list<array{id: string, type: string, v: int, variant: string, settings: array<string, mixed>, data: array<string, mixed>, refs: array<string, mixed>}>
|
||||
@@ -148,42 +152,53 @@ public function normalize(array $blocks): array
|
||||
$seenIds = [];
|
||||
|
||||
foreach (array_values($blocks) as $index => $block) {
|
||||
if (! is_array($block)) {
|
||||
throw ValidationException::withMessages([
|
||||
"blocks.$index" => 'Ein Baustein ist unvollständig.',
|
||||
]);
|
||||
}
|
||||
|
||||
if (! $this->has($block['type'] ?? null)) {
|
||||
throw ValidationException::withMessages([
|
||||
"blocks.$index.type" => 'Dieser Bausteintyp ist nicht freigegeben.',
|
||||
]);
|
||||
}
|
||||
|
||||
$type = $this->get($block['type']);
|
||||
|
||||
if (array_key_exists('v', $block) && (int) $block['v'] > $type->version()) {
|
||||
throw ValidationException::withMessages([
|
||||
"blocks.$index.v" => 'Dieser Baustein stammt aus einer neueren Programmfassung und kann hier nicht gespeichert werden.',
|
||||
]);
|
||||
}
|
||||
|
||||
$requested = $block['variant'] ?? null;
|
||||
$isCurrent = array_key_exists('v', $block) && (int) $block['v'] === $type->version();
|
||||
|
||||
if ($isCurrent && is_string($requested) && $requested !== '' && ! array_key_exists($requested, $type->variants())) {
|
||||
throw ValidationException::withMessages([
|
||||
"blocks.$index.variant" => 'Diese Darstellungsvariante ist für den Baustein nicht freigegeben.',
|
||||
]);
|
||||
}
|
||||
|
||||
$widget = $this->upcast($block);
|
||||
$normalized[] = $this->validateOne($type, $widget, $index, $seenIds);
|
||||
$normalized[] = $this->normalizeWidget($block, "blocks.$index", $seenIds);
|
||||
}
|
||||
|
||||
return $normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prüft und bereinigt einen einzelnen Baustein für eine neue Revision. Der Aufrufer führt die Menge
|
||||
* bereits vergebener Kennungen über die ganze Seite, damit kopierte Widgets neue Kennungen erhalten.
|
||||
*
|
||||
* @param array<string, true> $seenIds
|
||||
* @return array{id: string, type: string, v: int, variant: string, settings: array<string, mixed>, data: array<string, mixed>, refs: array<string, mixed>}
|
||||
*/
|
||||
public function normalizeWidget(mixed $block, string $errorPrefix, array &$seenIds): array
|
||||
{
|
||||
if (! is_array($block)) {
|
||||
throw ValidationException::withMessages([
|
||||
$errorPrefix => 'Ein Baustein ist unvollständig.',
|
||||
]);
|
||||
}
|
||||
|
||||
if (! $this->has($block['type'] ?? null)) {
|
||||
throw ValidationException::withMessages([
|
||||
"$errorPrefix.type" => 'Dieser Bausteintyp ist nicht freigegeben.',
|
||||
]);
|
||||
}
|
||||
|
||||
$type = $this->get($block['type']);
|
||||
|
||||
if (array_key_exists('v', $block) && (int) $block['v'] > $type->version()) {
|
||||
throw ValidationException::withMessages([
|
||||
"$errorPrefix.v" => 'Dieser Baustein stammt aus einer neueren Programmfassung und kann hier nicht gespeichert werden.',
|
||||
]);
|
||||
}
|
||||
|
||||
$requested = $block['variant'] ?? null;
|
||||
$isCurrent = array_key_exists('v', $block) && (int) $block['v'] === $type->version();
|
||||
|
||||
if ($isCurrent && is_string($requested) && $requested !== '' && ! array_key_exists($requested, $type->variants())) {
|
||||
throw ValidationException::withMessages([
|
||||
"$errorPrefix.variant" => 'Diese Darstellungsvariante ist für den Baustein nicht freigegeben.',
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->validateOne($type, $this->upcast($block), $errorPrefix, $seenIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gespeicherte Bausteine einer Revision als aktuelle Hüllen; unbekannte Arten entfallen.
|
||||
*
|
||||
@@ -241,7 +256,7 @@ public function mediaPaths(?array $blocks): array
|
||||
* @param array<string, true> $seenIds
|
||||
* @return array{id: string, type: string, v: int, variant: string, settings: array<string, mixed>, data: array<string, mixed>, refs: array<string, mixed>}
|
||||
*/
|
||||
private function validateOne(WidgetType $type, array $widget, int $index, array &$seenIds): array
|
||||
private function validateOne(WidgetType $type, array $widget, string $errorPrefix, array &$seenIds): array
|
||||
{
|
||||
$errors = new WidgetErrors;
|
||||
|
||||
@@ -292,7 +307,7 @@ private function validateOne(WidgetType $type, array $widget, int $index, array
|
||||
if (! $errors->isEmpty()) {
|
||||
$messages = [];
|
||||
foreach ($errors->all() as $key => $list) {
|
||||
$messages["blocks.$index.$key"] = $list;
|
||||
$messages["$errorPrefix.$key"] = $list;
|
||||
}
|
||||
|
||||
throw ValidationException::withMessages($messages);
|
||||
|
||||
@@ -34,6 +34,32 @@ public function version(): int
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kleinste Slotbreite in logischen Rastereinheiten (1 bis 4), in der das Widget auf dem Desktop lesbar bleibt.
|
||||
* Ein schmalerer Slot wird beim Speichern abgewiesen. Auf Tablet und Smartphone stapeln die Slots ohnehin.
|
||||
*/
|
||||
public function minUnits(): int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Empfohlene Slotbreite in Rastereinheiten; Hinweis in der Widget-Auswahl. */
|
||||
public function preferredUnits(): int
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Darstellungsstufen nach verfügbarer Breite (Container-Abfragen in der Widget-Ansicht): Kennung => Beschreibung.
|
||||
* Dokumentiert, wie sich das Widget an schmale und breite Slots anpasst.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function stages(): array
|
||||
{
|
||||
return ['fluid' => 'passt sich fließend an jede Slotbreite an'];
|
||||
}
|
||||
|
||||
/** Heroicon-Name für Auswahl und Liste im Editor. */
|
||||
public function icon(): string
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user