Benenne den Feldkatalog, zeige Schrittnamen in Regeln und gliedere die Antworten im Posteingang
CI Feature / test (push) Successful in 4m9s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-27 18:03:45 +01:00
1 parent 22f8afdcd6
commit a495b0d740
3 files changed
+9 -5

No files matched your search

+6 -2
View File
@@ -126,7 +126,7 @@ private static function rules(): array
])
->collapsible()
->addActionLabel('Regel hinzufügen')
->itemLabel(fn (array $state): string => (TemplateCompiler::EFFECTS[$state['effect'] ?? ''] ?? 'Neue Regel').($state['target'] ?? null ? ' → '.self::targetName((string) $state['target']) : '')),
->itemLabel(fn (array $state, $livewire): string => (TemplateCompiler::EFFECTS[$state['effect'] ?? ''] ?? 'Neue Regel').(($state['target'] ?? null) ? ' → '.self::targetName((string) $state['target'], (array) ($livewire->data['draft'] ?? [])) : '')),
]),
];
}
@@ -224,11 +224,15 @@ private static function targets(array $draft, string $effect): array
};
}
private static function targetName(string $target): string
/**
* @param array<string, mixed> $draft
*/
private static function targetName(string $target, array $draft = []): string
{
[$kind, $key] = array_pad(explode(':', $target, 2), 2, '');
return match ($kind) {
'step' => (string) (self::inventory($draft)['steps'][$key] ?? $key),
'field' => (string) (InquiryField::query()->where('key', $key)->value('name') ?? $key),
'group' => (string) (InquiryFieldGroup::query()->where('key', $key)->value('name') ?? $key),
default => $key,