Prozesskonfigurator: fachliche Prozessblöcke als Hauptansicht, Detailpanel je Block, Entwurf verwerfen

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-05 15:55:04 +01:00
1 parent 4554af8056
commit 664f00e510
8 files changed
+766 -185

No files matched your search

@@ -0,0 +1,80 @@
@php
$muted = 'color:#6b7280;font-size:.8rem';
$card = 'border:1px solid rgba(128,128,128,.3);border-radius:.5rem;padding:.75rem 1rem;margin-bottom:.6rem';
$decision = collect($this->decisions())->first(fn (array $candidate): bool => $block['area'] !== null && $candidate['area'] === $block['area']);
$areaImpacts = $block['area'] === null ? [] : array_values(array_filter($this->templateImpacts(), fn (array $impact): bool => $impact['area'] === $block['area']->label()));
@endphp
<x-filament::section :heading="'Einstellungen: '.$block['label']" :description="'Phase '.$block['phase'].' · Änderungen bleiben ein Entwurf, bis Sie speichern.'" wire:key="block-detail-{{ $this->intake }}-{{ $block['key'] }}">
@foreach ($block['problems'] as $problem)
<p style="color:#b91c1c;font-size:.85rem;margin-bottom:.4rem">{{ $problem }}</p>
@endforeach
@if ($decision)
<h3 style="font-weight:600;margin:.2rem 0 .3rem">{{ $decision['area']->label() }} <span style="{{ $muted }}">– {{ $decision['area']->question() }}</span></h3>
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(16rem,1fr));gap:.6rem" role="radiogroup" aria-label="{{ $decision['area']->label() }}">
@foreach ($decision['options'] as $option)
@php($template = $option['template'])
<div style="{{ $card }};{{ $option['selected'] ? 'border-color:rgb(var(--primary-600));box-shadow:0 0 0 1px rgb(var(--primary-600))' : '' }};{{ $option['admissible'] ? '' : 'opacity:.85;background:rgba(128,128,128,.07)' }}" wire:key="template-{{ $this->intake }}-{{ $option['key'] }}">
<button type="button" role="radio" aria-checked="{{ $option['selected'] ? 'true' : 'false' }}" @disabled(! $option['admissible']) wire:click="chooseTemplate('{{ $decision['area']->value }}', '{{ $option['key'] }}')" style="text-align:left;width:100%">
<strong>{{ $template::label() }}</strong>
<div style="font-size:.85rem;margin-top:.3rem">{{ $template::purpose() }}</div>
</button>
<ul style="{{ $muted }};margin-top:.4rem;list-style:disc;padding-left:1.1rem">
@foreach ($template::dimensions() as $dimension => $statement)<li><strong>{{ $dimension }}:</strong> {{ $statement }}</li>@endforeach
</ul>
@foreach ($option['restrictions'] as $restriction)
<p style="color:#b45309;font-size:.8rem;margin-top:.4rem"><strong>Passt gerade nicht ({{ $restriction->kind }}):</strong> {{ $restriction->reason }}@if ($restriction->alternative) <br>Zulässig ist stattdessen: {{ $restriction->alternative }}.@endif @if ($restriction->change) <br>{{ $restriction->change }}.@endif</p>
@endforeach
@foreach ($option['hints'] as $hint)<p style="{{ $muted }};margin-top:.3rem">{{ $hint }}</p>@endforeach
</div>
@endforeach
</div>
@foreach ($areaImpacts as $impact)
<div style="font-size:.85rem;margin:.4rem 0 .8rem" data-impact="{{ $impact['area'] }}">
<strong>Was der Wechsel bedeutet:</strong> {{ $impact['from'] ?? 'bisher keine Schablone' }} → <strong>{{ $impact['to'] }}</strong>
@if ($impact['responsibility'])<div>Verantwortung: {{ $impact['responsibility']['from'] }} → {{ $impact['responsibility']['to'] }}</div>@endif
@if ($impact['removed'] !== [])<div>Entfällt: {{ implode(', ', $impact['removed']) }}</div>@endif
@if ($impact['added'] !== [])<div>Kommt hinzu: {{ implode(', ', $impact['added']) }}</div>@endif
@if ($impact['kept'] !== [])<div style="{{ $muted }}">Bleibt mit allen Einstellungen: {{ implode(', ', $impact['kept']) }}</div>@endif
@foreach ($impact['switches_lost'] as $lost)<div style="color:#b45309">Ihr gespeicherter Schalter für „{{ $lost }}“ hat dann keinen Bezug mehr.</div>@endforeach
@foreach ($impact['settings_replaced'] as $text)<div style="color:#b45309">{{ $text }}</div>@endforeach
@foreach ($impact['needs'] as $need)<div style="{{ $muted }}">{{ $need }}</div>@endforeach
</div>
@endforeach
@endif
@if ($block['extensions'] !== [])
<p style="{{ $muted }};margin:.4rem 0">Noch nicht vorhanden (hier gibt es dafür keine Einstellung): {{ implode('; ', $block['extensions']) }}.</p>
@endif
<h3 style="font-weight:600;margin:.8rem 0 .2rem">Verbindungen</h3>
<ul style="font-size:.85rem;list-style:disc;padding-left:1.2rem">
@forelse ($block['waits_for'] as $dependency)
<li>Wartet auf <strong>{{ $dependency['label'] }}</strong> ({{ implode(', ', array_unique($dependency['steps'])) }}) – harte Abhängigkeit</li>
@empty
<li>Wartet auf keinen anderen Block – läuft unabhängig.</li>
@endforelse
@foreach ($block['after'] as $dependency)<li>Soll nach <strong>{{ $dependency['label'] }}</strong> ({{ implode(', ', array_unique($dependency['steps'])) }}) – weiche Abhängigkeit, blockiert nicht</li>@endforeach
@if ($block['may_wait'] !== [])<li>Kann warten auf: {{ implode(', ', $block['may_wait']) }}</li>@endif
@if ($block['events'] !== [])<li>Reagiert auf Ereignisse: {{ implode(', ', $block['events']) }}</li>@endif
@if ($block['scheduled'] !== [])<li>Zeitgesteuert: {{ implode(', ', $block['scheduled']) }}</li>@endif
@foreach ($block['conditional'] as $conditional)<li>Bedingt: {{ $conditional['label'] }}@if ($conditional['reason']) – nur wenn {{ $conditional['reason'] }}@endif</li>@endforeach
</ul>
@if ($block['configurable'] !== [])
<h3 style="font-weight:600;margin:.8rem 0 0">Einstellbare Schritte</h3>
@foreach ($block['configurable'] as $step)
@include('filament.resources.channels.channel-process-step', ['step' => $step])
@endforeach
@endif
@if ($block['fixed'] !== [])
<p style="{{ $muted }};margin-top:.6rem">Feste Schritte ohne eigene Einstellung: {{ implode(', ', array_column($block['fixed'], 'label')) }}.</p>
@endif
@if ($block['off'] !== [])
<p style="{{ $muted }};margin-top:.3rem">Entfällt hier: {{ implode('; ', array_map(fn (array $step): string => $step['label'].($step['reason'] ? ' ('.$step['reason'].')' : ''), $block['off'])) }}.</p>
@endif
@if ($block['configurable'] === [] && $block['facts'] === [] && $decision === null)
<p style="{{ $muted }}">Dieser Block hat keine eigenen Einstellungen.</p>
@endif
</x-filament::section>
@@ -0,0 +1,67 @@
@php
$muted = 'color:#6b7280;font-size:.8rem';
$input = 'border:1px solid rgba(128,128,128,.4);border-radius:.375rem;padding:.3rem .45rem;background:transparent';
$performers = ['system' => 'System', 'landlord' => 'Sie', 'guest' => 'Gast', 'portal' => 'Portal', 'service_provider' => 'Dienstleister', 'none' => 'niemand'];
$waitLabels = ['guest' => 'Gast', 'portal' => 'Portal', 'landlord' => 'Sie', 'time' => 'Frist'];
@endphp
<div style="border-top:1px solid rgba(128,128,128,.25);padding:.6rem 0;{{ $step['on'] ? '' : 'opacity:.65' }}" wire:key="step-{{ $this->intake }}-{{ $step['module'] }}">
<div style="display:flex;justify-content:space-between;gap:.5rem;align-items:center">
<strong style="font-size:.9rem">{{ $step['label'] }}
@if ($step['tester_only'])<span style="color:#b45309;font-size:.75rem"> · nur im Prozess-Tester</span>@endif
@if ($step['inserted'])<span style="{{ $muted }}"> · Zusatzschritt der Variante</span>@endif
</strong>
@if ($step['optional'])
<x-filament::button size="xs" :color="($this->drafts[$this->intake]['steps'][$step['module']]['on'] ?? true) === false ? 'gray' : 'success'" wire:click="toggleStep('{{ $step['module'] }}')">
{{ ($this->drafts[$this->intake]['steps'][$step['module']]['on'] ?? true) === false ? 'aus' : 'an' }}
</x-filament::button>
@endif
</div>
<div style="font-size:.85rem;margin-top:.2rem">{{ $step['purpose'] }}</div>
<div style="{{ $muted }};margin-top:.2rem">
@if ($step['needs'] !== []) wartet auf: {{ implode(', ', $step['needs']) }} · @elseif ($step['on']) läuft unabhängig · @endif
@if ($step['after'] !== []) soll nach: {{ implode(', ', $step['after']) }} · @endif
@if ($step['condition']) nur wenn: {{ $step['condition'] }} · @endif
Wer: {{ $performers[$step['performer']] ?? $step['performer'] ?? '–' }}
@if ($step['waits'] !== []) · kann warten auf: {{ implode(', ', array_map(fn ($wait) => $waitLabels[$wait] ?? $wait, $step['waits'])) }}@endif
@if ($step['triggers'] !== [] && $this->expert()) · Auslöser: {{ implode(', ', $step['triggers']) }}@endif
@if (! $step['on'] && $step['reason']) · <em>übersprungen: {{ $step['reason'] }}</em>@endif
@if ($this->expert()) · <code>{{ $step['module'] }}</code> v{{ $step['version'] }}@endif
</div>
@if ($step['mode_setting'] && $step['mode_options'] !== [])
<label style="display:block;font-size:.85rem;margin-top:.4rem">Ausführung
<select wire:model.live="drafts.{{ $this->intake }}.settings.{{ $step['mode_setting']->value }}" style="{{ $input }};margin-left:.4rem">
<option value="">wie Standard</option>
@foreach ($step['mode_options'] as $value => $label)<option value="{{ $value }}">{{ $label }}</option>@endforeach
</select>
<span style="{{ $muted }}">wirksam: {{ $this->setting($step['mode_setting'], $this->profile())['value'] }} ({{ $this->setting($step['mode_setting'], $this->profile())['source'] }})</span>
</label>
@endif
@if ($step['performer_setting'] && count($step['performer_options']) > 1)
<label style="display:block;font-size:.85rem;margin-top:.4rem">Wer sendet
<select wire:model.live="drafts.{{ $this->intake }}.settings.{{ $step['performer_setting']->value }}" style="{{ $input }};margin-left:.4rem">
<option value="">wie Standard</option>
@foreach ($step['performer_options'] as $value => $label)<option value="{{ $value }}">{{ $label }}</option>@endforeach
</select>
<span style="{{ $muted }}">wirksam: {{ $this->setting($step['performer_setting'], $this->profile())['value'] }} ({{ $this->setting($step['performer_setting'], $this->profile())['source'] }})</span>
</label>
@endif
@foreach ($step['parameters'] as $parameter)
<label style="display:block;font-size:.85rem;margin-top:.4rem">{{ $parameter['question'] }}
@if ($parameter['options'])
<select wire:model.live="drafts.{{ $this->intake }}.settings.{{ $parameter['key'] }}" style="{{ $input }};margin-left:.4rem">
<option value="">wie geerbt</option>
@foreach ($parameter['options'] as $value => $label)<option value="{{ $value }}">{{ $label }}</option>@endforeach
</select>
@else
<input type="text" wire:model.live.debounce.600ms="drafts.{{ $this->intake }}.settings.{{ $parameter['key'] }}" placeholder="{{ $parameter['value'] }}" style="{{ $input }};width:8rem;margin-left:.4rem">
@endif
<span style="{{ $muted }}">wirksam: {{ $parameter['value'] }} ({{ $parameter['source'] }})</span>
@if ($parameter['set'])
<button type="button" wire:click="inherit('{{ $parameter['key'] }}')" style="{{ $muted }};text-decoration:underline">auf geerbten Wert zurücksetzen</button>
@endif
</label>
@endforeach
</div>
@@ -52,6 +52,15 @@
</x-filament::section>
@endif
@if ($conflicts = $this->conflicts())
<div style="{{ $card }};margin-bottom:.8rem;border-color:#b45309">
<strong>Bisherige Einstellungen widersprechen dem gewählten Ablauf</strong>
<ul style="font-size:.85rem;list-style:disc;padding-left:1.2rem">@foreach ($conflicts as $conflict)<li>{{ $conflict['text'] }}</li>@endforeach</ul>
<label style="font-size:.85rem"><input type="checkbox" wire:model.live="acknowledge"> Ich bestätige: Diese bisherigen Einstellungen werden beim Speichern entfernt und im Verlauf des Kanals festgehalten.</label>
</div>
@endif
<details @if (! $composable || $draft['derived']) open @endif style="margin-bottom:1rem"><summary style="cursor:pointer;font-weight:600">Basisprozess: {{ $model::label() }}</summary>
<x-filament::section :heading="$this->question()" :description="$draft['derived'] ? 'Noch nicht gewählt: abgeleitet aus Ihren bisherigen Einstellungen. Gespeichert wird erst, wenn Sie speichern.' : null">
@if ($models === [])
<p>Für diese Eingangsart gibt es keine Ablaufmodelle.</p>
@@ -78,11 +87,12 @@
@endforeach
</div>
@if ($conflicts = $this->conflicts())
<div style="{{ $card }};margin-top:.8rem;border-color:#b45309">
<strong>Bisherige Einstellungen widersprechen diesem Modell</strong>
<ul style="font-size:.85rem;list-style:disc;padding-left:1.2rem">@foreach ($conflicts as $conflict)<li>{{ $conflict['text'] }}</li>@endforeach</ul>
<label style="font-size:.85rem"><input type="checkbox" wire:model.live="acknowledge"> Ich bestätige: Diese bisherigen Einstellungen werden beim Speichern entfernt und im Verlauf des Kanals festgehalten.</label>
@if ($composable && ($presets = $this->presets()) !== [])
<div style="color:#6b7280;font-size:.8rem;margin-top:.6rem">Bekannte Kombinationen als Ausgangspunkt:
@foreach ($presets as $archetype => $preset)
<button type="button" wire:click="applyPreset('{{ $archetype }}')" style="text-decoration:underline;margin-left:.4rem">{{ $preset['label'] }}</button>
@endforeach
</div>
@endif
@@ -101,67 +111,66 @@
</div>
@endif
</x-filament::section>
</details>
@if ($composable)
@php($decisions = $this->decisions())
<x-filament::section heading="Geschäftsentscheidungen" description="Wählen Sie je Bereich die passende Funktionsschablone. Die Einzelschritte jeder Schablone bleiben darunter einzeln einstellbar.">
@if (($presets = $this->presets()) !== [])
<div style="{{ $muted }};margin-bottom:.6rem">Bekannte Kombinationen als Ausgangspunkt:
@foreach ($presets as $archetype => $preset)
<button type="button" wire:click="applyPreset('{{ $archetype }}')" style="text-decoration:underline;margin-left:.4rem">{{ $preset['label'] }}</button>
@endforeach
</div>
@endif
@foreach ($decisions as $decision)
<h3 style="font-weight:600;margin:.6rem 0 .3rem">{{ $decision['area']->label() }} <span style="{{ $muted }}">– {{ $decision['area']->question() }}</span></h3>
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(20rem,1fr));gap:.6rem" role="radiogroup" aria-label="{{ $decision['area']->label() }}">
@foreach ($decision['options'] as $option)
@php($template = $option['template'])
<div style="{{ $card }};{{ $option['selected'] ? 'border-color:rgb(var(--primary-600));box-shadow:0 0 0 1px rgb(var(--primary-600))' : '' }};{{ $option['admissible'] ? '' : 'opacity:.85;background:rgba(128,128,128,.07)' }}" wire:key="template-{{ $this->intake }}-{{ $option['key'] }}">
<button type="button" role="radio" aria-checked="{{ $option['selected'] ? 'true' : 'false' }}" @disabled(! $option['admissible']) wire:click="chooseTemplate('{{ $decision['area']->value }}', '{{ $option['key'] }}')" style="text-align:left;width:100%">
<strong>{{ $template::label() }}</strong>
<div style="font-size:.85rem;margin-top:.3rem">{{ $template::purpose() }}</div>
</button>
<ul style="{{ $muted }};margin-top:.4rem;list-style:disc;padding-left:1.1rem">
@foreach ($template::dimensions() as $dimension => $statement)<li><strong>{{ $dimension }}:</strong> {{ $statement }}</li>@endforeach
</ul>
<div style="{{ $muted }};margin-top:.3rem">Schritte: {{ implode(', ', $option['modules']) }}@if ($template::extensions() !== []) · noch nicht vorhanden: {{ implode('; ', $template::extensions()) }}@endif</div>
@foreach ($option['restrictions'] as $restriction)
<p style="color:#b45309;font-size:.8rem;margin-top:.4rem"><strong>Passt gerade nicht ({{ $restriction->kind }}):</strong> {{ $restriction->reason }}@if ($restriction->alternative) <br>Zulässig ist stattdessen: {{ $restriction->alternative }}.@endif @if ($restriction->change) <br>{{ $restriction->change }}.@endif</p>
@endforeach
@foreach ($option['hints'] as $hint)<p style="{{ $muted }};margin-top:.3rem">{{ $hint }}</p>@endforeach
</div>
@endforeach
</div>
@endforeach
</x-filament::section>
@if ($templateImpacts = $this->templateImpacts())
<x-filament::section heading="Was der Wechsel bedeutet" description="Nichts davon wird still geändert – Sie sehen jede Folge, bevor Sie speichern.">
@foreach ($templateImpacts as $impact)
<div style="font-size:.9rem;margin-bottom:.8rem">
<strong>{{ $impact['area'] }}:</strong> {{ $impact['from'] ?? 'bisher keine Schablone' }} → <strong>{{ $impact['to'] }}</strong>
@if ($impact['responsibility'])<div>Verantwortung: {{ $impact['responsibility']['from'] }} → {{ $impact['responsibility']['to'] }}</div>@endif
@if ($impact['removed'] !== [])<div>Entfällt: {{ implode(', ', $impact['removed']) }}</div>@endif
@if ($impact['added'] !== [])<div>Kommt hinzu: {{ implode(', ', $impact['added']) }}</div>@endif
@if ($impact['kept'] !== [])<div style="{{ $muted }}">Bleibt mit allen Einstellungen: {{ implode(', ', $impact['kept']) }}</div>@endif
@foreach ($impact['switches_lost'] as $lost)<div style="color:#b45309">Ihr gespeicherter Schalter für „{{ $lost }}“ hat dann keinen Bezug mehr.</div>@endforeach
@foreach ($impact['settings_replaced'] as $text)<div style="color:#b45309">{{ $text }}</div>@endforeach
@foreach ($impact['needs'] as $need)<div style="{{ $muted }}">{{ $need }}</div>@endforeach
</div>
@endforeach
</x-filament::section>
@endif
@if ($this->dirty())
<div style="{{ $card }};border-color:#b45309;display:flex;justify-content:space-between;align-items:center;gap:.6rem" role="status">
<span style="font-size:.9rem"><strong>Ungespeicherte Änderungen.</strong> Der Prozess unten zeigt Ihren Entwurf; der Tester verwendet ihn ebenfalls. Gespeichert wird erst mit „Speichern“.</span>
<x-filament::button size="xs" color="gray" wire:click="discard">Änderungen verwerfen</x-filament::button>
</div>
@endif
@if ($problems !== [])
@if (($loose = $this->problemsOutsideBlocks()) !== [])
<x-filament::section heading="Nicht zulässig">
<ul style="color:#b91c1c;font-size:.9rem;list-style:disc;padding-left:1.2rem">
@foreach ($problems as $problem)<li>{{ $problem }}</li>@endforeach
@foreach ($loose as $problem)<li>{{ $problem }}</li>@endforeach
</ul>
</x-filament::section>
@endif
@php($blocks = $this->blocks())
<x-filament::section heading="Der Geschäftsprozess" description="Fachliche Blöcke – keine feste Reihenfolge. Was wartet, ergibt sich aus den Abhängigkeiten dieses Ablaufs. Klicken Sie einen Block an, um ihn einzustellen.">
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(17rem,1fr));gap:.7rem">
@foreach ($blocks as $key => $block)
<div style="{{ $card }};margin:0;{{ $this->block === $key ? 'border-color:rgb(var(--primary-600));box-shadow:0 0 0 1px rgb(var(--primary-600))' : '' }};{{ $block['active'] ? '' : 'opacity:.6' }}" wire:key="block-{{ $this->intake }}-{{ $key }}">
<button type="button" wire:click="selectBlock('{{ $key }}')" aria-expanded="{{ $this->block === $key ? 'true' : 'false' }}" aria-controls="block-detail" style="text-align:left;width:100%">
<div style="{{ $muted }}">{{ $block['phase'] }}</div>
<strong>{{ $block['label'] }}</strong>
@if ($block['template'])<div style="font-size:.85rem">{{ $block['template']::label() }}</div>@endif
<ul style="font-size:.82rem;margin-top:.35rem;list-style:none;padding:0">
@foreach ($block['facts'] as $fact)
<li><span style="{{ $muted }}">{{ $fact['question'] }}</span> <strong>{{ $fact['value'] }}</strong> <span style="{{ $muted }}">({{ $fact['source'] }})</span></li>
@endforeach
</ul>
<div style="font-size:.8rem;margin-top:.4rem">
@if (! $block['active'])
<span style="{{ $muted }}">Entfällt in diesem Ablauf.</span>
@else
@forelse ($block['waits_for'] as $dependency)
<div style="color:#b45309">⏳ wartet auf {{ $dependency['label'] }}</div>
@empty
<div style="color:#15803d">⇉ läuft unabhängig</div>
@endforelse
@foreach ($block['after'] as $dependency)<div style="{{ $muted }}">↳ soll nach {{ $dependency['label'] }}</div>@endforeach
@if ($block['events'] !== [])<div style="{{ $muted }}">⚡ ereignisgesteuert: {{ implode(', ', $block['events']) }}</div>@endif
@if ($block['scheduled'] !== [])<div style="{{ $muted }}">⏱ zeitgesteuert: {{ implode(', ', $block['scheduled']) }}</div>@endif
@foreach ($block['conditional'] as $conditional)<div style="{{ $muted }}">? bedingt: {{ $conditional['label'] }}</div>@endforeach
@endif
@if ($block['problems'] !== [] || $block['attention'] > 0)<div style="color:#b91c1c">⚠ Klärung nötig</div>@endif
</div>
</button>
</div>
@endforeach
</div>
<p style="{{ $muted }};margin-top:.5rem">Gilt für neue Vorgänge. Laufende Vorgänge dieses Kanals ({{ $this->runningCases() }}) behalten ihren bisherigen Ablauf.</p>
</x-filament::section>
<div id="block-detail">
@if ($this->block !== '' && isset($blocks[$this->block]))
@include('filament.resources.channels.channel-process-block', ['block' => $blocks[$this->block]])
@endif
</div>
@if ($impacts = $this->impacts())
<x-filament::section heading="Was die Abschaltung bedeutet">
@foreach ($impacts as $impact)
@@ -174,111 +183,19 @@
</x-filament::section>
@endif
@php($lanes = $this->lanes())
<x-filament::section heading="4 · Ablauf im Zusammenhang" description="Aus den tatsächlichen Abhängigkeiten dieses Ablaufs – so führt ihn das System aus.">
@php($laneTitles = ['parallel' => 'Läuft sofort, unabhängig voneinander', 'waiting' => 'Wartet auf andere Schritte', 'event' => 'Ereignisgesteuert (reagiert, wenn etwas eintrifft)', 'later' => 'Zeitgesteuert (zu seiner Zeit)', 'off' => 'Entfällt hier'])
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(16rem,1fr));gap:.6rem">
@foreach ($laneTitles as $lane => $title)
@if ($lanes[$lane] !== [])
<div style="{{ $card }}">
<strong style="font-size:.85rem">{{ $title }}</strong>
<ul style="font-size:.85rem;list-style:disc;padding-left:1.1rem;margin-top:.3rem">
@foreach ($lanes[$lane] as $item)
<li>{{ $item['label'] }}@if (! empty($item['after'])) <span style="{{ $muted }}">– nach: {{ implode(', ', $item['after']) }}</span>@endif @if ($item['note']) <span style="{{ $muted }}">({{ $item['note'] }})</span>@endif</li>
@endforeach
</ul>
</div>
@endif
@endforeach
</div>
<x-filament::section heading="Ablauf prüfen" description="Spielt einen ausgedachten Vorgang mit genau diesem – auch ungespeicherten – Entwurf durch, ohne Wirkung auf echte Daten.">
<x-filament::button color="gray" wire:click="test">Ablauf testen</x-filament::button>
@if ($this->expert())
<details style="margin-top:.8rem"><summary style="cursor:pointer;font-size:.9rem">Alle Schritte dieses Ablaufs ({{ count($steps) }})</summary>
<ul style="font-size:.85rem;list-style:disc;padding-left:1.2rem;margin-top:.4rem">
@foreach ($steps as $step)
<li style="{{ $step['on'] ? '' : 'color:#9ca3af;text-decoration:line-through' }}">
{{ $step['label'] }}
<span style="{{ $muted }}">– {{ $step['on'] ? ($performers[$step['performer']] ?? $step['performer'] ?? '').($step['mode'] ? ', '.(\App\Enums\ProcessingMode::tryFrom($step['mode'])?->getLabel() ?? \App\Enums\DataRequestMode::tryFrom($step['mode'])?->getLabel() ?? $step['mode']) : '') : 'übersprungen: '.$step['reason'] }}</span>
</li>
@endforeach
</ul>
</details>
@endif
</x-filament::section>
<div style="display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:1rem;align-items:start">
<details @if (! $composable) open @endif>
<summary style="cursor:pointer;font-weight:600;margin-bottom:.4rem">Einzelschritte einstellen ({{ count($steps) }} Schritte)</summary>
@foreach (collect($steps)->groupBy('phase') as $phase => $group)
<h3 style="font-weight:600;margin:.6rem 0 .3rem">{{ $phases[$phase] ?? $phase }}</h3>
@foreach ($group as $index => $step)
<div style="{{ $card }};{{ $step['on'] ? '' : 'opacity:.6' }}" wire:key="step-{{ $this->intake }}-{{ $step['module'] }}">
<div style="display:flex;justify-content:space-between;gap:.5rem;align-items:center">
<strong>{{ $step['label'] }}
@if ($step['tester_only'])<span style="color:#b45309;font-size:.75rem"> · nur im Prozess-Tester</span>@endif
@if ($step['inserted'])<span style="{{ $muted }}"> · Zusatzschritt der Variante</span>@endif
@if ($step['template'] ?? null)<span style="{{ $muted }}"> · Schablone: {{ $step['template'] }}</span>@endif
</strong>
@if ($step['optional'])
<x-filament::button size="xs" :color="($draft['steps'][$step['module']]['on'] ?? true) === false ? 'gray' : 'success'" wire:click="toggleStep('{{ $step['module'] }}')">
{{ ($draft['steps'][$step['module']]['on'] ?? true) === false ? 'aus' : 'an' }}
</x-filament::button>
@else
<span style="{{ $muted }}" title="Pflichtschritt – nicht abschaltbar">🔒 Pflicht</span>
@endif
</div>
<div style="font-size:.85rem;margin-top:.25rem">{{ $step['purpose'] }}</div>
<div style="{{ $muted }};margin-top:.25rem">
@if ($step['needs'] !== []) braucht zuerst: {{ implode(', ', $step['needs']) }} · @elseif ($step['on']) läuft unabhängig · @endif
@if ($step['after'] !== []) soll nach: {{ implode(', ', $step['after']) }} · @endif
@if ($step['condition']) nur wenn: {{ $step['condition'] }} · @endif
@if ($step['executions'] !== [] && ! $step['optional']) So darf das erfüllt werden: {{ implode(', ', $step['executions']) }}@if ($step['why']) – {{ $step['why'] }}@endif · @endif
Wer: {{ $performers[$step['performer']] ?? $step['performer'] ?? '–' }}
@if ($step['waits'] !== []) · kann warten auf: {{ implode(', ', array_map(fn ($wait) => ['guest' => 'Gast', 'portal' => 'Portal', 'landlord' => 'Sie', 'time' => 'Frist'][$wait] ?? $wait, $step['waits'])) }}@endif
@if (! $step['on'] && $step['reason']) · <em>übersprungen: {{ $step['reason'] }}</em>@endif
@if ($this->expert()) · <code>{{ $step['module'] }}</code> v{{ $step['version'] }}@endif
</div>
@if ($step['mode_setting'] && $step['mode_options'] !== [])
<label style="display:block;font-size:.85rem;margin-top:.4rem">Ausführung
<select wire:model.live="drafts.{{ $this->intake }}.settings.{{ $step['mode_setting']->value }}" style="{{ $input }};margin-left:.4rem">
<option value="">wie Standard</option>
@foreach ($step['mode_options'] as $value => $label)<option value="{{ $value }}">{{ $label }}</option>@endforeach
</select>
<span style="{{ $muted }}">{{ $this->setting($step['mode_setting'], $this->profile())['source'] }}</span>
</label>
@endif
@if ($step['performer_setting'] && count($step['performer_options']) > 1)
<label style="display:block;font-size:.85rem;margin-top:.4rem">Wer sendet
<select wire:model.live="drafts.{{ $this->intake }}.settings.{{ $step['performer_setting']->value }}" style="{{ $input }};margin-left:.4rem">
<option value="">wie Standard</option>
@foreach ($step['performer_options'] as $value => $label)<option value="{{ $value }}">{{ $label }}</option>@endforeach
</select>
<span style="{{ $muted }}">im Rahmen des Modells wählbar, ohne Modellwechsel</span>
</label>
@endif
@foreach ($step['parameters'] as $parameter)
<label style="display:block;font-size:.85rem;margin-top:.4rem">{{ $parameter['question'] }}
@if ($parameter['options'])
<select wire:model.live="drafts.{{ $this->intake }}.settings.{{ $parameter['key'] }}" style="{{ $input }};margin-left:.4rem">
<option value="">wie geerbt</option>
@foreach ($parameter['options'] as $value => $label)<option value="{{ $value }}">{{ $label }}</option>@endforeach
</select>
@else
<input type="text" wire:model.live.debounce.600ms="drafts.{{ $this->intake }}.settings.{{ $parameter['key'] }}" placeholder="{{ $parameter['value'] }}" style="{{ $input }};width:8rem;margin-left:.4rem">
@endif
<span style="{{ $muted }}">wirksam: {{ $parameter['value'] }} ({{ $parameter['source'] }})</span>
@if ($parameter['set'])
<button type="button" wire:click="inherit('{{ $parameter['key'] }}')" style="{{ $muted }};text-decoration:underline">auf geerbten Wert zurücksetzen</button>
@endif
</label>
@endforeach
</div>
@endforeach
@endforeach
</details>
<x-filament::section heading="Vorschau: ein neuer Vorgang" description="Mit den aktuellen, auch ungespeicherten Einstellungen. Es wird nichts gespeichert und nichts ausgeführt.">
<ul style="font-size:.85rem;list-style:disc;padding-left:1.2rem">
@foreach ($steps as $step)
<li style="{{ $step['on'] ? '' : 'color:#9ca3af;text-decoration:line-through' }}">
{{ $step['label'] }}
<span style="{{ $muted }}">– {{ $step['on'] ? ($performers[$step['performer']] ?? $step['performer'] ?? '').($step['mode'] ? ', '.(\App\Enums\ProcessingMode::tryFrom($step['mode'])?->getLabel() ?? \App\Enums\DataRequestMode::tryFrom($step['mode'])?->getLabel() ?? $step['mode']) : '') : 'übersprungen: '.$step['reason'] }}</span>
</li>
@endforeach
</ul>
<p style="{{ $muted }};margin-top:.6rem">Gilt für neue Vorgänge. Laufende Vorgänge dieses Kanals ({{ $this->runningCases() }}) behalten ihren bisherigen Ablauf.</p>
<x-filament::button color="gray" wire:click="test" style="margin-top:.6rem">Ablauf testen</x-filament::button>
<p style="{{ $muted }}">Spielt einen ausgedachten Vorgang mit genau dieser Einstellung durch – ohne Wirkung auf echte Daten.</p>
</x-filament::section>
</div>
</x-filament-panels::page>