chore(turnier-feature): remove unused ViewModels and UI components

- Removed `AbteilungViewModel`, `BewerbAnlegenViewModel`, `BewerbViewModel`, and `CreateBewerbWizardScreen`.
- Cleaned up related imports and unused domain models.
This commit is contained in:
2026-04-13 14:38:12 +02:00
parent 5c7ba28b1e
commit f719764914
65 changed files with 989 additions and 157 deletions
+15 -7
View File
@@ -1,3 +1,7 @@
@file:OptIn(ExperimentalWasmDsl::class)
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.kotlinSerialization)
@@ -5,13 +9,11 @@ plugins {
kotlin {
jvm()
js {
binaries.library()
browser {
testTask {
enabled = false
}
}
js(IR) {
browser()
}
wasmJs {
browser()
}
sourceSets {
@@ -38,6 +40,12 @@ kotlin {
implementation(libs.jmdns)
}
wasmJsMain.dependencies {
implementation(libs.kotlin.stdlib.wasm.js)
implementation(libs.ktor.client.js)
implementation(libs.kotlinx.coroutines.core)
}
jsMain.dependencies {
implementation(libs.ktor.client.js)
}
@@ -1,6 +1,8 @@
package at.mocode.frontend.core.network
import kotlinx.browser.window
// Import explicitly from the wasm package if it exists, or use external declarations
// Kotlin 2.3.20 might have moved things or the compiler needs hints.
// We'll use external declarations for maximum compatibility.
@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
actual object PlatformConfig {
@@ -18,10 +20,8 @@ actual object PlatformConfig {
if (fromGlobal.isNotEmpty()) return fromGlobal.removeSuffix("/")
// 2) Try window location origin (same origin gateway/proxy setup)
// In Wasm, we can access a window directly if we are in the browser main thread.
// However, we need to be careful about exceptions.
val origin = try {
window.location.origin
getOrigin()
} catch (e: Throwable) {
null
}
@@ -33,9 +33,11 @@ actual object PlatformConfig {
}
}
@OptIn(ExperimentalWasmJsInterop::class)
private fun getOrigin(): String = js("window.location.origin")
// Helper function for JS interop in Wasm
// Kotlin/Wasm does not support 'dynamic' type or complex js() blocks inside functions.
// We must use top-level external functions or simple js() expressions.
@OptIn(ExperimentalWasmJsInterop::class)
private fun getGlobalApiBaseUrl(): String = js(
"""
(function() {
@@ -45,6 +47,7 @@ private fun getGlobalApiBaseUrl(): String = js(
"""
)
@OptIn(ExperimentalWasmJsInterop::class)
private fun getGlobalKeycloakUrl(): String = js(
"""
(function() {
@@ -54,6 +57,7 @@ private fun getGlobalKeycloakUrl(): String = js(
"""
)
@OptIn(ExperimentalWasmJsInterop::class)
private fun getWindowHostname(): String = js(
"""
(function() {
@@ -0,0 +1,18 @@
package at.mocode.frontend.core.network.discovery
import org.koin.core.module.Module
import org.koin.dsl.module
/**
* Wasm-spezifische Implementierung (vorerst No-op).
*/
actual val discoveryModule: Module = module {
single<NetworkDiscoveryService> { NoOpDiscoveryService() }
}
class NoOpDiscoveryService : NetworkDiscoveryService {
override fun startDiscovery() {}
override fun stopDiscovery() {}
override fun registerService(port: Int) {}
override fun getDiscoveredServices(): List<DiscoveredService> = emptyList()
}
@@ -0,0 +1,23 @@
package at.mocode.frontend.core.network.sync
import org.koin.core.module.Module
import org.koin.dsl.module
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow
/**
* Wasm-spezifische Implementierung (vorerst No-op).
*/
actual val syncModule: Module = module {
single<P2pSyncService> { NoOpP2pSyncService() }
single { SyncManager(get(), get()) }
}
class NoOpP2pSyncService : P2pSyncService {
override fun startServer(port: Int) {}
override fun stopServer() {}
override suspend fun connectToPeer(host: String, port: Int) {}
override suspend fun broadcastEvent(event: SyncEvent) {}
override val incomingEvents: Flow<SyncEvent> = emptyFlow()
override val connectedPeers: Flow<List<String>> = emptyFlow()
}