Benenne den Feldkatalog, zeige Schrittnamen in Regeln und gliedere die Antworten im Posteingang
CI Feature / test (push) Successful in 4m9s
CI Feature / test (push) Successful in 4m9s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
22f8afdcd6
commit
a495b0d740
3 files changed
+9
-5
No files matched your search
@@ -35,7 +35,7 @@ class InquiryFieldResource extends CommunicationResource
|
||||
|
||||
protected static ?string $modelLabel = 'Feld';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Felder';
|
||||
protected static ?string $pluralModelLabel = 'Feldkatalog';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user