feat(nav): FAQ shows all 8 sections + drag-drop reorder in Settings

FAQ sections were only 4 (service/crm/depozit/finante) even though
the sidebar has 8. Added the missing 4 to Hints::AREAS with proper
icons + accent colors:
  📊 Analiză (pink)   📣 Marketing (orange)
  🛒 Magazin (cyan)   ⚙️ Admin (slate)

Retagged 15 hints that were shoved into wrong areas as a workaround
(admin.*/marketing.*/shop.*/analytics.* now use the matching bucket).
FAQ blade reads accent color from the AREAS registry instead of a
hardcoded local map.

Also added per-tenant navigation group ordering:
- Settings → new "Ordine meniu lateral" section with a Filament
  Repeater that has reorderable buttons (drag/arrow buttons) but no
  add/delete (fixed list of 8 groups)
- Persisted to settings.nav_group_order as an array of keys
- New ConfigureNavGroups middleware (runs after ResolveTenant on
  the web stack) reads the current tenant's order and calls
  $panel->navigationGroups([...]) so the sidebar renders in that
  order per-request

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-01 11:09:24 +00:00
parent 346fcf968f
commit 2ca6ab58a1
7 changed files with 110 additions and 27 deletions
+26
View File
@@ -60,6 +60,8 @@ class Settings extends Page
'services' => isset($settings['services']) ? implode(', ', (array) $settings['services']) : '',
'cars' => isset($settings['cars']) ? implode(', ', (array) $settings['cars']) : '',
'faq_video_url' => $settings['faq_video_url'] ?? null,
'nav_group_order' => collect($settings['nav_group_order'] ?? \App\Http\Middleware\ConfigureNavGroups::DEFAULT_ORDER)
->map(fn ($k) => ['key' => $k])->all(),
'notify_wo_ready' => $notify['wo_ready'] ?? true,
'notify_payment' => $notify['payment'] ?? true,
'notify_appointment' => $notify['appointment'] ?? true,
@@ -155,6 +157,28 @@ class Settings extends Page
->placeholder('https://www.youtube.com/watch?v=... sau https://vimeo.com/...')
->helperText(__('Afișat în pagina FAQ ca player embedded. Lasă gol pentru a-l ascunde.')),
]),
Schemas\Components\Section::make(__('Ordine meniu lateral'))
->description(__('Trage grupurile pentru a schimba ordinea lor în sidebar-ul stâng.'))
->columns(1)
->schema([
Forms\Components\Repeater::make('nav_group_order')
->label('')
->schema([
Forms\Components\Select::make('key')
->label(__('Grup'))
->options(array_combine(
\App\Http\Middleware\ConfigureNavGroups::DEFAULT_ORDER,
array_map(fn ($k) => __('nav.group.' . $k), \App\Http\Middleware\ConfigureNavGroups::DEFAULT_ORDER),
))
->required()
->distinct(),
])
->reorderable()
->reorderableWithButtons()
->addable(false)
->deletable(false)
->columnSpanFull(),
]),
Schemas\Components\Section::make(__('Logo & favicon'))
->columns(2)
->schema([
@@ -275,6 +299,8 @@ class Settings extends Page
'services' => array_values(array_filter(array_map('trim', explode(',', (string) ($data['services'] ?? ''))))),
'cars' => array_values(array_filter(array_map('trim', explode(',', (string) ($data['cars'] ?? ''))))),
'faq_video_url' => trim((string) ($data['faq_video_url'] ?? '')) ?: null,
'nav_group_order' => collect($data['nav_group_order'] ?? [])
->pluck('key')->filter()->values()->all() ?: null,
'notify' => [
'wo_ready' => (bool) ($data['notify_wo_ready'] ?? true),
'payment' => (bool) ($data['notify_payment'] ?? true),