From 222a29686806ff2a004b2f59c338c622500eaa51 Mon Sep 17 00:00:00 2001 From: Nebojsa Vuksic Date: Thu, 7 Aug 2025 17:48:35 +0200 Subject: [PATCH] Move WeatherAppViewModel to ui package --- .../template/toolWindow/ComposeSamplesToolWindowFactory.kt | 2 +- .../weatherApp/{services => ui}/WeatherAppViewModel.kt | 3 ++- .../template/weatherApp/ui/components/WeatherDetailsCard.kt | 2 +- .../org/jetbrains/plugins/template/MyLocationListTest.kt | 4 ++-- .../template/weatherApp/services/LocationsUIStateTest.kt | 1 + 5 files changed, 7 insertions(+), 5 deletions(-) rename src/main/kotlin/org/jetbrains/plugins/template/weatherApp/{services => ui}/WeatherAppViewModel.kt (98%) diff --git a/src/main/kotlin/org/jetbrains/plugins/template/toolWindow/ComposeSamplesToolWindowFactory.kt b/src/main/kotlin/org/jetbrains/plugins/template/toolWindow/ComposeSamplesToolWindowFactory.kt index 00c97ac..8de6428 100644 --- a/src/main/kotlin/org/jetbrains/plugins/template/toolWindow/ComposeSamplesToolWindowFactory.kt +++ b/src/main/kotlin/org/jetbrains/plugins/template/toolWindow/ComposeSamplesToolWindowFactory.kt @@ -13,7 +13,7 @@ import org.jetbrains.plugins.template.CoroutineScopeHolder import org.jetbrains.plugins.template.ui.ChatAppSample import org.jetbrains.plugins.template.weatherApp.model.Location import org.jetbrains.plugins.template.weatherApp.services.LocationsProvider -import org.jetbrains.plugins.template.weatherApp.services.WeatherAppViewModel +import org.jetbrains.plugins.template.weatherApp.ui.WeatherAppViewModel import org.jetbrains.plugins.template.weatherApp.services.WeatherForecastService import org.jetbrains.plugins.template.weatherApp.ui.WeatherAppSample diff --git a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/services/WeatherAppViewModel.kt b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/WeatherAppViewModel.kt similarity index 98% rename from src/main/kotlin/org/jetbrains/plugins/template/weatherApp/services/WeatherAppViewModel.kt rename to src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/WeatherAppViewModel.kt index 4cc145e..8f49818 100644 --- a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/services/WeatherAppViewModel.kt +++ b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/WeatherAppViewModel.kt @@ -1,4 +1,4 @@ -package org.jetbrains.plugins.template.weatherApp.services +package org.jetbrains.plugins.template.weatherApp.ui import com.intellij.openapi.Disposable import kotlinx.coroutines.* @@ -8,6 +8,7 @@ import kotlinx.coroutines.flow.asStateFlow import org.jetbrains.plugins.template.weatherApp.model.Location import org.jetbrains.plugins.template.weatherApp.model.SelectableLocation import org.jetbrains.plugins.template.weatherApp.model.WeatherForecastData +import org.jetbrains.plugins.template.weatherApp.services.WeatherForecastServiceApi /** diff --git a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt index e40f81d..e790892 100644 --- a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt +++ b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt @@ -28,7 +28,7 @@ import org.jetbrains.plugins.template.weatherApp.WeatherAppColors import org.jetbrains.plugins.template.weatherApp.model.DailyForecast import org.jetbrains.plugins.template.weatherApp.model.Location import org.jetbrains.plugins.template.weatherApp.model.WeatherForecastData -import org.jetbrains.plugins.template.weatherApp.services.WeatherForecastUIState +import org.jetbrains.plugins.template.weatherApp.ui.WeatherForecastUIState import org.jetbrains.plugins.template.weatherApp.ui.WeatherIcons import java.time.LocalDateTime import java.time.format.DateTimeFormatter diff --git a/src/test/kotlin/org/jetbrains/plugins/template/MyLocationListTest.kt b/src/test/kotlin/org/jetbrains/plugins/template/MyLocationListTest.kt index 3b89223..097cd11 100644 --- a/src/test/kotlin/org/jetbrains/plugins/template/MyLocationListTest.kt +++ b/src/test/kotlin/org/jetbrains/plugins/template/MyLocationListTest.kt @@ -12,8 +12,8 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import org.jetbrains.plugins.template.weatherApp.model.Location -import org.jetbrains.plugins.template.weatherApp.services.LocationsUIState -import org.jetbrains.plugins.template.weatherApp.services.MyLocationsViewModelApi +import org.jetbrains.plugins.template.weatherApp.ui.LocationsUIState +import org.jetbrains.plugins.template.weatherApp.ui.MyLocationsViewModelApi import org.jetbrains.plugins.template.weatherApp.ui.MyLocationsListWithEmptyListPlaceholder import org.junit.Test diff --git a/src/test/kotlin/org/jetbrains/plugins/template/weatherApp/services/LocationsUIStateTest.kt b/src/test/kotlin/org/jetbrains/plugins/template/weatherApp/services/LocationsUIStateTest.kt index c3b5a3e..f4a76cd 100644 --- a/src/test/kotlin/org/jetbrains/plugins/template/weatherApp/services/LocationsUIStateTest.kt +++ b/src/test/kotlin/org/jetbrains/plugins/template/weatherApp/services/LocationsUIStateTest.kt @@ -1,6 +1,7 @@ package org.jetbrains.plugins.template.weatherApp.services import org.jetbrains.plugins.template.weatherApp.model.Location +import org.jetbrains.plugins.template.weatherApp.ui.LocationsUIState import org.junit.Assert.* import org.junit.Test