Globale Live-Suche, Kontaktkarten-Personensuche, neue Beitragsansicht, Termine mit Seitenleiste, Demo-Inhalte, Plugin-Upload-Fix
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m24s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m26s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m46s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m31s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m18s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m14s
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m24s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m26s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m46s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m31s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m18s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m14s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9b06e65802
commit
b276e1c6d0
211 changed files with 3580 additions and 1072 deletions
|
|
@ -4,6 +4,7 @@ namespace App\Filament\Pages;
|
|||
|
||||
use App\Dashboard\Widgets;
|
||||
use App\Filament\Resources\DashboardTiles\DashboardTileResource;
|
||||
use App\Support\ContactCards;
|
||||
use App\Support\Settings;
|
||||
use BackedEnum;
|
||||
use Filament\Actions\Action;
|
||||
|
|
@ -57,7 +58,10 @@ class DashboardSettings extends Page
|
|||
|
||||
public function mount(Widgets $widgets): void
|
||||
{
|
||||
$this->form->fill(collect(self::AREAS)->mapWithKeys(fn ($info, $area) => [$area => $widgets->forAdmin($area)])->all());
|
||||
$this->form->fill([
|
||||
...collect(self::AREAS)->mapWithKeys(fn ($info, $area) => [$area => $widgets->forAdmin($area)])->all(),
|
||||
'people_fields' => (array) app(Settings::class)->get(ContactCards::PEOPLE_SEARCH_FIELDS, ContactCards::DEFAULT_PEOPLE_SEARCH_FIELDS),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -80,8 +84,8 @@ class DashboardSettings extends Page
|
|||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->statePath('data')->components(
|
||||
collect(self::AREAS)->map(fn ($info, $area) => Section::make($info[0])
|
||||
return $schema->statePath('data')->components([
|
||||
...collect(self::AREAS)->map(fn ($info, $area) => Section::make($info[0])
|
||||
->description($info[1] ?: null)
|
||||
->visible(fn () => app(Widgets::class)->forAdmin($area) !== [])
|
||||
->schema([
|
||||
|
|
@ -104,8 +108,16 @@ class DashboardSettings extends Page
|
|||
->visible(fn (Get $get) => count(self::areasOf($get('key'))) > 1)
|
||||
->helperText('Wird nach dem Speichern in den gewählten Bereich verschoben.'),
|
||||
]),
|
||||
]))->values()->all()
|
||||
);
|
||||
]))->values()->all(),
|
||||
Section::make('Kachel „Kolleg:innen finden“')
|
||||
->description('Welche Angaben auf den Kontaktkarten der Live-Suche erscheinen – in dieser Reihenfolge. Name, Foto, Funktion und Abteilung stehen immer oben.')
|
||||
->schema([
|
||||
Select::make('people_fields')
|
||||
->hiddenLabel()
|
||||
->multiple()
|
||||
->options(fn () => app(ContactCards::class)->options()),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function save(Settings $settings): void
|
||||
|
|
@ -123,6 +135,7 @@ class DashboardSettings extends Page
|
|||
}
|
||||
|
||||
$settings->set('dashboard.layout', $layout);
|
||||
$settings->set(ContactCards::PEOPLE_SEARCH_FIELDS, array_values(array_intersect((array) ($this->data['people_fields'] ?? []), array_keys(app(ContactCards::class)->options()))));
|
||||
|
||||
// Verschobene Kacheln im Formular in ihren neuen Bereich umsortieren
|
||||
$this->mount(app(Widgets::class));
|
||||
|
|
|
|||
114
app/Filament/Pages/DemoContent.php
Normal file
114
app/Filament/Pages/DemoContent.php
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Support\Audit;
|
||||
use App\Support\Demo\DemoContent as Demo;
|
||||
use BackedEnum;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Illuminate\Support\Str;
|
||||
use Throwable;
|
||||
use UnitEnum;
|
||||
|
||||
/**
|
||||
* Demo-Inhalte für Test- und Vorführinstallationen per Klick anlegen und
|
||||
* wieder entfernen – ohne Shell-Zugang auf dem Server.
|
||||
*/
|
||||
class DemoContent extends Page
|
||||
{
|
||||
protected string $view = 'filament.pages.demo-content';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedSparkles;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'System';
|
||||
|
||||
protected static ?int $navigationSort = 90;
|
||||
|
||||
protected static ?string $navigationLabel = 'Demo-Inhalte';
|
||||
|
||||
protected static ?string $title = 'Demo-Inhalte';
|
||||
|
||||
protected static ?string $slug = 'demo-inhalte';
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return auth()->user()?->can('updates.manage') ?? false;
|
||||
}
|
||||
|
||||
public function install(Demo $demo): void
|
||||
{
|
||||
abort_unless(static::canAccess(), 403);
|
||||
@set_time_limit(300);
|
||||
|
||||
try {
|
||||
$result = $demo->install(auth()->user());
|
||||
} catch (Throwable $e) {
|
||||
report($e);
|
||||
Notification::make()->danger()->title('Demo-Inhalte nicht angelegt')->body($e->getMessage())->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Audit::log('demo.installed', ['counts' => $result['counts']]);
|
||||
|
||||
Notification::make()->success()->title('Demo-Inhalte angelegt')
|
||||
->body(collect($result['counts'])->map(fn ($count, $label) => "{$count} {$label}")->implode(', '))
|
||||
->send();
|
||||
|
||||
$this->warn($result['warnings'], 'Einige Bereiche konnten nicht angelegt werden');
|
||||
}
|
||||
|
||||
public function remove(Demo $demo): void
|
||||
{
|
||||
abort_unless(static::canAccess(), 403);
|
||||
@set_time_limit(300);
|
||||
|
||||
try {
|
||||
$result = $demo->remove();
|
||||
} catch (Throwable $e) {
|
||||
report($e);
|
||||
Notification::make()->danger()->title('Demo-Inhalte nicht entfernt')->body($e->getMessage())->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Audit::log('demo.removed', ['records' => $result['records'], 'files' => $result['files']]);
|
||||
|
||||
Notification::make()->success()->title('Demo-Inhalte entfernt')
|
||||
->body("{$result['records']} Einträge und {$result['files']} Dateien gelöscht.")
|
||||
->send();
|
||||
|
||||
$this->warn($result['warnings'], 'Nicht alles konnte entfernt werden');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<string> $warnings
|
||||
*/
|
||||
private function warn(array $warnings, string $title): void
|
||||
{
|
||||
if ($warnings === []) {
|
||||
return;
|
||||
}
|
||||
|
||||
Notification::make()->warning()->title($title)
|
||||
->body(Str::limit(implode("\n", $warnings), 1000))
|
||||
->persistent()
|
||||
->send();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getViewData(): array
|
||||
{
|
||||
$demo = app(Demo::class);
|
||||
|
||||
return [
|
||||
'installed' => $demo->isInstalled(),
|
||||
'installedAt' => $demo->installedAt(),
|
||||
'counts' => $demo->counts(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ class Plugins extends Page
|
|||
$this->run(fn () => $plugins->delete($slug, $removeData), 'Plugin gelöscht', $removeData ? 'Das Plugin und seine Daten wurden entfernt.' : 'Die Daten des Plugins sind noch in der Datenbank.');
|
||||
}
|
||||
|
||||
public function upload(PluginInstaller $installer): void
|
||||
public function installArchive(PluginInstaller $installer): void
|
||||
{
|
||||
$this->validate(['archive' => ['required', 'file', 'mimes:zip', 'max:51200']], attributes: ['archive' => 'ZIP-Archiv']);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue