Backend-WIP: Kontakt-Queue, Page-Cache, Validierungs-Feedback, i18n
Gebuendelt, da ueber gemeinsame lang-/Service-Dateien verschraenkt: - Kontakt-Nachrichten: contact_messages-Tabelle + Model/Enums/Factory, Admin-Queue (livewire/admin/contact-messages), ContactController persistiert das Anliegen zusaetzlich zur Brand-Mail - Page-Data-Cache (Services/Web/*PageData) + web-archive-Indizes auf press_releases - Validierungs-Feedback + Company-Portal-Restriction (Feature-Tests) - i18n-Auslagerung lang/de|en (auth, passwords, validation, static) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c6b5ec8479
commit
fd8e050cb7
60 changed files with 3963 additions and 327 deletions
|
|
@ -124,22 +124,32 @@ trait InteractsWithPressReleaseScheduling
|
|||
}
|
||||
|
||||
/**
|
||||
* Toast mit Sammelhinweis nach fehlgeschlagener Validierung. Die einzelnen
|
||||
* Feld-Errors werden weiterhin direkt am Input angezeigt.
|
||||
* Toast mit Sammelhinweis nach fehlgeschlagener Validierung. Nennt die
|
||||
* betroffenen Felder beim Namen (aus validation.attributes), damit der
|
||||
* User nicht raten muss, wo es hakt. Die einzelnen Feld-Errors werden
|
||||
* weiterhin direkt am Input angezeigt, zusätzlich rendert
|
||||
* [[x-portal.pr-error-summary]] eine persistente Übersicht im Formular.
|
||||
*/
|
||||
protected function notifyValidationError(?ValidationException $exception = null): void
|
||||
{
|
||||
$count = $exception
|
||||
? array_sum(array_map('count', $exception->errors()))
|
||||
: count($this->getErrorBag()->all());
|
||||
$fieldKeys = $exception
|
||||
? array_keys($exception->errors())
|
||||
: $this->getErrorBag()->keys();
|
||||
|
||||
$fieldLabels = collect($fieldKeys)
|
||||
->map(fn (string $key): string => trans()->has('validation.attributes.'.$key)
|
||||
? __('validation.attributes.'.$key)
|
||||
: $key)
|
||||
->unique()
|
||||
->values();
|
||||
|
||||
Flux::toast(
|
||||
heading: __('Bitte Eingaben prüfen'),
|
||||
text: $count > 1
|
||||
? __(':count Felder benötigen deine Aufmerksamkeit.', ['count' => $count])
|
||||
text: $fieldLabels->isNotEmpty()
|
||||
? __('Bitte prüfe: :fields', ['fields' => $fieldLabels->join(', ')])
|
||||
: __('Ein Feld benötigt deine Aufmerksamkeit.'),
|
||||
variant: 'danger',
|
||||
duration: 6000,
|
||||
duration: 8000,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue