V2.1: nichtlineare Prozessansicht, Begründung der Pflichtschritte, Bedienelemente der neuen Einstellungen

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-05 08:07:10 +01:00
1 parent f8561fe0e5
commit fdf226535b
8 files changed
+77 -8

No files matched your search

@@ -4,6 +4,7 @@
use App\Actions\ConfigureChannelProcess;
use App\Enums\AdminMode;
use App\Enums\Execution;
use App\Enums\IntakeKind;
use App\Enums\ProcessSetting;
use App\Filament\Resources\Channels\ChannelResource;
@@ -175,13 +176,26 @@ public function steps(): array
$profile = $this->profile();
$draft = $this->drafts[$this->intake];
return array_map(function (array $row) use ($configuration, $catalogue, $model, $profile): array {
$rows = $configuration->preview($this->record, IntakeKind::from($this->intake), $this->draft());
$labels = collect($rows)->mapWithKeys(fn (array $row): array => [$row['module'] => $row['label']]);
$active = collect($rows)->where('on', true)->pluck('module')->all();
return array_map(function (array $row) use ($configuration, $catalogue, $model, $profile, $labels, $active): array {
$definition = $catalogue->modules()[$row['module']]::definition();
// The view of the order is derived from the same definitions the runner uses: only dependencies present in the plan count.
$needs = collect($definition->requires)->filter(fn ($dependency): bool => $dependency->hard && in_array($dependency->module, $active, true))->map(fn ($dependency): string => $labels[$dependency->module])->values()->all();
$after = collect($definition->requires)->filter(fn ($dependency): bool => ! $dependency->hard && in_array($dependency->module, $active, true))->map(fn ($dependency): string => $labels[$dependency->module])->values()->all();
$controls = ChannelProcessConfiguration::STEP_CONTROLS[$row['module']] ?? [];
$parameters = array_values(array_filter($controls['parameters'] ?? [], fn (ProcessSetting $setting): bool => in_array(IntakeKind::from($this->intake), $setting->channelIntakes(), true) && ! $model::fixesSetting($setting) && ($this->expert() || in_array($setting, [ProcessSetting::HoldHours, ProcessSetting::DataRequestReminderHours, ProcessSetting::ArrivalInfoDaysBefore, ProcessSetting::ClarificationHoldAutoMinutes], true))));
$parameters = array_values(array_filter($controls['parameters'] ?? [], fn (ProcessSetting $setting): bool => in_array(IntakeKind::from($this->intake), $setting->channelIntakes(), true) && ! $model::fixesSetting($setting) && ($this->expert() || in_array($setting, [ProcessSetting::HoldHours, ProcessSetting::DataRequestReminderHours, ProcessSetting::ArrivalInfoDaysBefore, ProcessSetting::ClarificationHoldAutoMinutes, ProcessSetting::ContractDelivery, ProcessSetting::BookingNotice, ProcessSetting::AwaitPortalConfirmation, ProcessSetting::PortalConfirmationWaitHours], true))));
return [...$row,
'purpose' => $definition->purpose,
'needs' => $needs,
'after' => $after,
'condition' => $definition->condition,
'why' => $definition->why,
'executions' => array_map(fn (Execution $execution): string => $execution->getLabel(), $definition->executions),
'triggers' => $definition->triggers,
'waits' => $definition->waits,
'optional' => $definition->isOptional(),
'version' => $catalogue->modules()[$row['module']]::version(),
@@ -189,9 +203,9 @@ public function steps(): array
'mode_options' => $configuration->modeOptions($row['module']),
'performer_setting' => isset($controls['performer']) ? $controls['performer']['setting'] : null,
'performer_options' => $configuration->performerOptions($model, $row['module']),
'parameters' => array_map(fn (ProcessSetting $setting): array => $this->setting($setting, $profile), $parameters),
'parameters' => array_map(fn (ProcessSetting $setting): array => [...$this->setting($setting, $profile), 'options' => $configuration->settingOptions($setting)], $parameters),
];
}, $configuration->preview($this->record, IntakeKind::from($this->intake), $this->draft()));
}, $rows);
}
/**