iCal-Regelanwendung bei Zeitstempelupdates erlauben und Dialogfehler anzeigen
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m53s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m53s
This commit is contained in:
1 parent
678e15256d
commit
a0497fcccd
5 files changed
+170
-8
No files matched your search
@@ -29,6 +29,7 @@
|
||||
use Filament\Schemas\Schema;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class ChannelRules extends EditRecord
|
||||
{
|
||||
@@ -183,14 +184,26 @@ protected function getHeaderActions(): array
|
||||
}),
|
||||
Action::make('applyRules')->label('Speichern & anwenden')->requiresConfirmation()
|
||||
->modalDescription('Der Regelentwurf wird aktiviert und der vorhandene Kalenderbestand neu klassifiziert. IDs, Termine und persönliche Zuordnungen bleiben erhalten. Bekannte Herkunft beeinflusst den kanalspezifischen Export. Bei Namensfreigabe werden die gewählten Exportinformationen ebenfalls gespeichert.')
|
||||
->action(function (ApplyChannelRules $apply): void {
|
||||
$counts = DB::transaction(function () use ($apply): array {
|
||||
$this->record = $this->handleRecordUpdate($this->record, $this->form->getState());
|
||||
->action(function (ApplyChannelRules $apply, Action $action): void {
|
||||
try {
|
||||
$counts = DB::transaction(function () use ($apply): array {
|
||||
$this->record = $this->handleRecordUpdate($this->record, $this->form->getState());
|
||||
|
||||
return $apply->handle($this->record);
|
||||
});
|
||||
return $apply->handle($this->record);
|
||||
});
|
||||
} catch (ValidationException $exception) {
|
||||
$this->record->refresh();
|
||||
$this->setErrorBag($exception->errors());
|
||||
Notification::make()->title('Regeln wurden nicht angewendet')
|
||||
->body(collect($exception->errors())->flatten()->unique()->implode(' '))
|
||||
->danger()->persistent()->send();
|
||||
$action->cancel();
|
||||
}
|
||||
$this->record->refresh();
|
||||
Notification::make()->title($counts['classified'].' Einträge neu klassifiziert')->body($counts['missing_raw'].' Einträge ohne Originaldaten unverändert.')->success()->send();
|
||||
$this->rememberData();
|
||||
Notification::make()->title($counts['classified'].' Einträge neu klassifiziert')
|
||||
->body($counts['missing_raw'].' Einträge ohne Originaldaten unverändert. Zeitgleiche Einträge anderer Kalender bleiben bis zur ausdrücklichen Zuordnung getrennt.')
|
||||
->success()->send();
|
||||
}),
|
||||
Action::make('configuration')->label('Kalenderverbindung')->url(fn (): string => ChannelResource::getUrl('edit', ['record' => $this->record])),
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user