Wissen, Service, Gremien-Baustein und Menü-Vorschlag (0.56.0)
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 9m9s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Failing after 9m19s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 10m30s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 11m5s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 13m15s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 13m54s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m57s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 45s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 11m44s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m20s

Übersichtsseiten /wissen und /service (Hubs, im Admin pflegbar), Baustein
„Mitglieder mit Rolle“, Menü-Vorschlag für die Mitarbeiter-App.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-30 16:03:08 +00:00
parent 68f90c2c68
commit 4d0a2984ec
156 changed files with 1021 additions and 363 deletions

View file

@ -197,6 +197,50 @@ class MenuSettings extends Page
return $items;
}
/**
* Menü der Mitarbeiter-App: Start · Menschen · Wissen · Qualität · Service · Termine, dann der Rest.
*
* @return list<array<string, mixed>>
*/
private function appSuggestion(Navigation $navigation): array
{
$modules = $navigation->modules();
$used = [];
$item = fn (array $fields) => ['id' => (string) Str::uuid(), 'label' => null, 'icon' => null, 'roles' => [], 'children' => [], ...$fields];
$module = function (string $key, ?string $label = null) use ($modules, &$used, $item, $navigation) {
if (! isset($modules[$key])) {
return null;
}
$used[] = $key;
return $item(['type' => 'module', 'module' => $key, 'label' => $label, 'icon' => $navigation->iconFor($key)]);
};
$link = fn (string $label, string $url, string $icon) => $item(['type' => 'link', 'url' => $url, 'label' => $label, 'icon' => $icon]);
$people = array_values(array_filter([
$module('people', 'Telefonbuch'),
$module('gruppen'),
]));
$items = array_values(array_filter([
$module('home', 'Start'),
$people !== [] ? $item(['type' => 'group', 'label' => 'Menschen', 'icon' => 'users-round', 'children' => $people]) : null,
$link('Wissen', '/wissen', 'book-open'),
$module('qm', 'Qualität'),
$link('Service', '/service', 'life-buoy'),
$module('events'),
]));
// Alles Übrige dahinter – die Kopfzeile schiebt es unter „Mehr“
foreach (array_keys($modules) as $key) {
if (! in_array($key, $used, true) && ! in_array($key, ['editorial'], true)) {
$items[] = $item(['type' => 'module', 'module' => $key, 'icon' => $navigation->iconFor($key)]);
}
}
return $items;
}
public function save(Settings $settings): void
{
$items = $this->form->getState()['items'] ?? [];
@ -237,6 +281,10 @@ class MenuSettings extends Page
$this->form->fill(['items' => $this->fromAutomatic($navigation)]);
Notification::make()->success()->title('Automatisches Menü aktiv')->send();
}),
Action::make('suggestApp')->label('Vorschlag für die Mitarbeiter-App')->icon(Heroicon::OutlinedSparkles)->color('gray')
->requiresConfirmation()
->modalDescription('Ersetzt das Menü im Formular durch: Start · Menschen (Telefonbuch, Gruppen, Gremien …) · Wissen · Qualität · Service · Termine – der Rest steht dahinter unter „Mehr“. Gespeichert wird erst mit „Speichern“.')
->action(fn (Navigation $navigation) => $this->form->fill(['items' => $this->appSuggestion($navigation)])),
Action::make('preview')->label('Portal ansehen')->icon(Heroicon::OutlinedEye)->color('gray')
->url('/')->openUrlInNewTab(),
];