### feat: erweitere Wizard- und UI-Logik

- Füge automatische Re-Evaluierung im `EventWizardViewModel` nach Import hinzu.
- Aktualisiere `StammdatenImportScreen` mit `onBack`-Callback für Status-Prüfung.
- Erweitere `PingScreen` im `ConnectivityCheck`-Screen um Navigation zum Login.
- Präzisiere `hasZns`-Guard mit Prüfung auf Import-Datum.
This commit is contained in:
2026-04-21 20:43:09 +02:00
parent bdb45eefe4
commit 92028d9e02
5 changed files with 62 additions and 5 deletions
@@ -282,7 +282,7 @@ private fun ZnsCheckStep(viewModel: EventWizardViewModel) {
.heightIn(max = 500.dp)
.padding(vertical = 8.dp)
) {
StammdatenImportScreen(onBack = {})
StammdatenImportScreen(onBack = { viewModel.checkStammdatenStatus() })
}
Button(
@@ -150,6 +150,22 @@ class EventWizardViewModel(
try {
val stats = masterdataRepository.getStats()
state = state.copy(stammdatenStats = stats, isZnsAvailable = stats.vereinCount > 0, isCheckingStats = false)
// Falls WizardRuntime aktiv ist, re-evaluieren wir den aktuellen Step,
// falls wir noch im ZNS_CHECK hängen
if (WizardFeatureFlags.WizardRuntimeEnabled && state.currentStep == WizardStep.ZNS_CHECK) {
val ctx = buildWizardContext()
val current = ensureWizardStateInitialized()
// Wir versuchen ein "next" ohne explizite User-Aktion, um den Guard zu prüfen
val next = DemoEventFlow.next(ctx, current)
if (next != current) {
wizardState = next
mapToWizardStep(next.current)?.let {
state = state.copy(currentStep = it)
saveDraftInternal(it)
}
}
}
} catch (e: Exception) {
state = state.copy(isCheckingStats = false, error = "Fehler beim Laden der Stammdaten-Stats: ${e.message}")
}