chore: integriere Logo-Upload und Vorschau in Veranstalter-Wizard, verbessere Navigationslogik und erweitere Datenmodelle
Signed-off-by: StefanMoCoAt <stefan.mo.co@gmail.com>
This commit is contained in:
+2
@@ -11,6 +11,8 @@ data class Veranstalter(
|
||||
val telefon: String = "",
|
||||
val adresse: String = "",
|
||||
val mitgliedSeit: String = "",
|
||||
val logoUrl: String? = null,
|
||||
val logoBase64: String? = null,
|
||||
)
|
||||
|
||||
/**
|
||||
|
||||
+5
-1
@@ -1,12 +1,12 @@
|
||||
package at.mocode.frontend.features.veranstalter.presentation
|
||||
|
||||
import at.mocode.frontend.features.veranstalter.domain.VeranstalterRepository
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import at.mocode.frontend.features.veranstalter.domain.VeranstalterRepository
|
||||
import at.mocode.frontend.features.veranstalter.domain.Veranstalter as DomainVeranstalter
|
||||
|
||||
// UDF: State beschreibt die gesamte UI in einem Snapshot
|
||||
@@ -34,6 +34,8 @@ data class VeranstalterListItem(
|
||||
val oepsNummer: String,
|
||||
val ort: String,
|
||||
val loginStatus: String,
|
||||
val logoUrl: String? = null,
|
||||
val logoBase64: String? = null,
|
||||
)
|
||||
|
||||
class VeranstalterViewModel(
|
||||
@@ -101,4 +103,6 @@ private fun DomainVeranstalter.toListItem() = VeranstalterListItem(
|
||||
oepsNummer = oepsNummer,
|
||||
ort = ort,
|
||||
loginStatus = loginStatus,
|
||||
logoUrl = logoUrl,
|
||||
logoBase64 = logoBase64,
|
||||
)
|
||||
|
||||
+5
-3
@@ -326,9 +326,11 @@ data class VeranstalterDetailUiModel(
|
||||
val ansprechpartner: String,
|
||||
val email: String,
|
||||
val telefon: String,
|
||||
val adresse: String,
|
||||
val loginStatus: LoginStatus,
|
||||
val mitgliedSeit: String,
|
||||
val adresse: String,
|
||||
val loginStatus: LoginStatus,
|
||||
val mitgliedSeit: String,
|
||||
val logoUrl: String? = null,
|
||||
val logoBase64: String? = null,
|
||||
)
|
||||
|
||||
data class VeranstaltungListUiModel(
|
||||
|
||||
+2
@@ -11,4 +11,6 @@ data class VeranstalterUiModel(
|
||||
val ansprechpartner: String,
|
||||
val email: String,
|
||||
val loginStatus: LoginStatus,
|
||||
val logoUrl: String? = null,
|
||||
val logoBase64: String? = null,
|
||||
)
|
||||
|
||||
+8
@@ -21,6 +21,8 @@ data class VeranstalterWizardState(
|
||||
val email: String = "",
|
||||
val telefon: String = "",
|
||||
val adresse: String = "",
|
||||
val logoUrl: String? = null,
|
||||
val logoBase64: String? = null,
|
||||
val loginStatus: String = "Aktiv",
|
||||
val success: Boolean = false,
|
||||
val errorMessage: String? = null
|
||||
@@ -35,6 +37,7 @@ sealed interface VeranstalterWizardIntent {
|
||||
data class UpdateEmail(val v: String) : VeranstalterWizardIntent
|
||||
data class UpdateTelefon(val v: String) : VeranstalterWizardIntent
|
||||
data class UpdateAdresse(val v: String) : VeranstalterWizardIntent
|
||||
data class UpdateLogo(val base64: String?) : VeranstalterWizardIntent
|
||||
data object Save : VeranstalterWizardIntent
|
||||
}
|
||||
|
||||
@@ -55,6 +58,7 @@ class VeranstalterWizardViewModel(
|
||||
is VeranstalterWizardIntent.UpdateEmail -> _state.value = _state.value.copy(email = intent.v)
|
||||
is VeranstalterWizardIntent.UpdateTelefon -> _state.value = _state.value.copy(telefon = intent.v)
|
||||
is VeranstalterWizardIntent.UpdateAdresse -> _state.value = _state.value.copy(adresse = intent.v)
|
||||
is VeranstalterWizardIntent.UpdateLogo -> _state.value = _state.value.copy(logoBase64 = intent.base64)
|
||||
is VeranstalterWizardIntent.Save -> save()
|
||||
}
|
||||
}
|
||||
@@ -72,6 +76,8 @@ class VeranstalterWizardViewModel(
|
||||
email = v.email,
|
||||
telefon = v.telefon,
|
||||
adresse = v.adresse,
|
||||
logoUrl = v.logoUrl,
|
||||
logoBase64 = v.logoBase64,
|
||||
loginStatus = v.loginStatus
|
||||
)
|
||||
}.onFailure { t ->
|
||||
@@ -93,6 +99,8 @@ class VeranstalterWizardViewModel(
|
||||
email = s.email,
|
||||
telefon = s.telefon,
|
||||
adresse = s.adresse,
|
||||
logoUrl = s.logoUrl,
|
||||
logoBase64 = s.logoBase64,
|
||||
loginStatus = s.loginStatus
|
||||
)
|
||||
val result = if (s.editId != null) {
|
||||
|
||||
Reference in New Issue
Block a user