From b1eaabf6991e073928c313809f5e3dfc85c9b75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montwe=CC=81?= Date: Thu, 15 Jun 2023 11:43:14 +0200 Subject: [PATCH 1/2] Rename autoconfig package to autodiscovery --- .../feature/account/setup/AccountSetupModule.kt | 6 +++--- .../account/setup/ui/AccountSetupScreen.kt | 6 +++--- .../AccountAutoConfigContent.kt | 8 ++++---- .../AccountAutoConfigContract.kt | 2 +- .../AccountAutoConfigScreen.kt | 8 ++++---- .../AccountAutoConfigValidator.kt | 2 +- .../AccountAutoConfigViewModel.kt | 16 ++++++++-------- .../AutoDiscoveryStringMapper.kt | 2 +- .../item/AutoDiscoveryStatusItem.kt | 4 ++-- .../item/ConfigurationApprovalItem.kt | 4 ++-- .../item/ContentItems.kt | 8 ++++---- .../item/EmailAddressItem.kt | 2 +- .../item/PasswordItem.kt | 2 +- .../view/AutoDiscoveryServerSettingsView.kt | 5 +++-- .../view/AutoDiscoveryStatusBodyView.kt | 12 +++++++----- .../view/AutoDiscoveryStatusHeaderState.kt | 2 +- .../view/AutoDiscoveryStatusHeaderView.kt | 2 +- .../view/AutoDiscoveryStatusView.kt | 2 +- .../view/ConfigurationApprovalView.kt | 4 ++-- .../account/setup/AccountSetupModuleKtTest.kt | 2 +- .../account/setup/ui/AccountSetupScreenKtTest.kt | 2 +- .../AccountAutoConfigScreenKtTest.kt | 6 +++--- .../AccountAutoConfigStateTest.kt | 6 +++--- .../AccountAutoConfigViewModelTest.kt | 12 ++++++------ .../FakeAccountAutoConfigValidator.kt | 2 +- .../FakeAccountAutoConfigViewModel.kt | 10 +++++----- 26 files changed, 70 insertions(+), 67 deletions(-) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/AccountAutoConfigContent.kt (90%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/AccountAutoConfigContract.kt (97%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/AccountAutoConfigScreen.kt (88%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/AccountAutoConfigValidator.kt (95%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/AccountAutoConfigViewModel.kt (90%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/AutoDiscoveryStringMapper.kt (96%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/item/AutoDiscoveryStatusItem.kt (81%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/item/ConfigurationApprovalItem.kt (82%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/item/ContentItems.kt (81%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/item/EmailAddressItem.kt (94%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/item/PasswordItem.kt (94%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/view/AutoDiscoveryServerSettingsView.kt (96%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/view/AutoDiscoveryStatusBodyView.kt (91%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/view/AutoDiscoveryStatusHeaderState.kt (95%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/view/AutoDiscoveryStatusHeaderView.kt (98%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/view/AutoDiscoveryStatusView.kt (98%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/view/ConfigurationApprovalView.kt (90%) rename feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/AccountAutoConfigScreenKtTest.kt (84%) rename feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/AccountAutoConfigStateTest.kt (75%) rename feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/AccountAutoConfigViewModelTest.kt (97%) rename feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/FakeAccountAutoConfigValidator.kt (92%) rename feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/{autoconfig => autodiscovery}/FakeAccountAutoConfigViewModel.kt (52%) diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/AccountSetupModule.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/AccountSetupModule.kt index 3f189ffb9..02cef12d6 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/AccountSetupModule.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/AccountSetupModule.kt @@ -5,9 +5,9 @@ import app.k9mail.autodiscovery.service.RealAutoDiscoveryService import app.k9mail.feature.account.setup.domain.DomainContract import app.k9mail.feature.account.setup.domain.usecase.GetAutoDiscovery import app.k9mail.feature.account.setup.ui.AccountSetupViewModel -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigValidator -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigValidator +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigViewModel import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigContract import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigValidator import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigViewModel diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreen.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreen.kt index c1a0284d7..87fb268b6 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreen.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreen.kt @@ -7,9 +7,9 @@ import app.k9mail.feature.account.setup.ui.AccountSetupContract.Effect import app.k9mail.feature.account.setup.ui.AccountSetupContract.Event import app.k9mail.feature.account.setup.ui.AccountSetupContract.SetupStep import app.k9mail.feature.account.setup.ui.AccountSetupContract.ViewModel -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigScreen -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigScreen +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigViewModel import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigContract import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigScreen import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigViewModel diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigContent.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContent.kt similarity index 90% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigContent.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContent.kt index 45589421e..a6746d730 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigContent.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContent.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.PaddingValues @@ -19,9 +19,9 @@ import app.k9mail.core.ui.compose.theme.K9Theme import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.ThunderbirdTheme import app.k9mail.feature.account.setup.R -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.State -import app.k9mail.feature.account.setup.ui.autoconfig.item.contentItems +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.item.contentItems import app.k9mail.feature.account.setup.ui.common.item.ErrorItem import app.k9mail.feature.account.setup.ui.common.item.LoadingItem diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigContract.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContract.kt similarity index 97% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigContract.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContract.kt index 427a2beeb..d20f565f6 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigContract.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContract.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import app.k9mail.autodiscovery.api.AutoDiscoveryResult import app.k9mail.core.common.domain.usecase.validation.ValidationResult diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigScreen.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreen.kt similarity index 88% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigScreen.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreen.kt index de4efc110..45b3faa96 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigScreen.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreen.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -10,9 +10,9 @@ import app.k9mail.core.ui.compose.designsystem.template.Scaffold import app.k9mail.core.ui.compose.theme.K9Theme import app.k9mail.core.ui.compose.theme.ThunderbirdTheme import app.k9mail.feature.account.setup.R -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Effect -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.ViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Effect +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ViewModel import app.k9mail.feature.account.setup.ui.common.AccountSetupBottomBar import app.k9mail.feature.account.setup.ui.common.AccountSetupTopHeader diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigValidator.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigValidator.kt similarity index 95% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigValidator.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigValidator.kt index 5790418c4..63e49d34d 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigValidator.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigValidator.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import app.k9mail.core.common.domain.usecase.validation.ValidationResult import app.k9mail.feature.account.setup.domain.DomainContract.UseCase diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigViewModel.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModel.kt similarity index 90% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigViewModel.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModel.kt index 5b38c6e84..2636422a7 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigViewModel.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModel.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import androidx.lifecycle.viewModelScope import app.k9mail.autodiscovery.api.AutoDiscoveryResult @@ -6,13 +6,13 @@ import app.k9mail.core.common.domain.usecase.validation.ValidationResult import app.k9mail.core.ui.compose.common.mvi.BaseViewModel import app.k9mail.feature.account.setup.domain.DomainContract.UseCase import app.k9mail.feature.account.setup.domain.input.StringInputField -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.ConfigStep -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Effect -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Error -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.State -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Validator -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.ViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ConfigStep +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Effect +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Error +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Validator +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ViewModel import kotlinx.coroutines.launch @Suppress("TooManyFunctions") diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AutoDiscoveryStringMapper.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AutoDiscoveryStringMapper.kt similarity index 96% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AutoDiscoveryStringMapper.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AutoDiscoveryStringMapper.kt index f94e5a5fe..9f49cf6d3 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AutoDiscoveryStringMapper.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AutoDiscoveryStringMapper.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import android.content.res.Resources import app.k9mail.core.common.domain.usecase.validation.ValidationError diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/AutoDiscoveryStatusItem.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/AutoDiscoveryStatusItem.kt similarity index 81% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/AutoDiscoveryStatusItem.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/AutoDiscoveryStatusItem.kt index 53cb85569..f4af10b3b 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/AutoDiscoveryStatusItem.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/AutoDiscoveryStatusItem.kt @@ -1,10 +1,10 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.item +package app.k9mail.feature.account.setup.ui.autodiscovery.item import androidx.compose.foundation.lazy.LazyItemScope import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import app.k9mail.autodiscovery.api.AutoDiscoveryResult -import app.k9mail.feature.account.setup.ui.autoconfig.view.AutoDiscoveryStatusView +import app.k9mail.feature.account.setup.ui.autodiscovery.view.AutoDiscoveryStatusView import app.k9mail.feature.account.setup.ui.common.item.ListItem @Composable diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/ConfigurationApprovalItem.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/ConfigurationApprovalItem.kt similarity index 82% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/ConfigurationApprovalItem.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/ConfigurationApprovalItem.kt index 0a20750cc..c6a8b7e2d 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/ConfigurationApprovalItem.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/ConfigurationApprovalItem.kt @@ -1,10 +1,10 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.item +package app.k9mail.feature.account.setup.ui.autodiscovery.item import androidx.compose.foundation.lazy.LazyItemScope import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import app.k9mail.feature.account.setup.domain.input.BooleanInputField -import app.k9mail.feature.account.setup.ui.autoconfig.view.ConfigurationApprovalView +import app.k9mail.feature.account.setup.ui.autodiscovery.view.ConfigurationApprovalView import app.k9mail.feature.account.setup.ui.common.item.ListItem @Composable diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/ContentItems.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/ContentItems.kt similarity index 81% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/ContentItems.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/ContentItems.kt index 11b85b43b..34c0bf5f3 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/ContentItems.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/ContentItems.kt @@ -1,9 +1,9 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.item +package app.k9mail.feature.account.setup.ui.autodiscovery.item import androidx.compose.foundation.lazy.LazyListScope -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.ConfigStep -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ConfigStep +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State internal fun LazyListScope.contentItems( state: State, diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/EmailAddressItem.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/EmailAddressItem.kt similarity index 94% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/EmailAddressItem.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/EmailAddressItem.kt index a141927d4..4a9eec5ab 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/EmailAddressItem.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/EmailAddressItem.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.item +package app.k9mail.feature.account.setup.ui.autodiscovery.item import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.lazy.LazyItemScope diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/PasswordItem.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/PasswordItem.kt similarity index 94% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/PasswordItem.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/PasswordItem.kt index a78dd7532..1c7dee5be 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/item/PasswordItem.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/PasswordItem.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.item +package app.k9mail.feature.account.setup.ui.autodiscovery.item import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.lazy.LazyItemScope diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryServerSettingsView.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryServerSettingsView.kt similarity index 96% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryServerSettingsView.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryServerSettingsView.kt index 7a9e9b4d6..d20b0748f 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryServerSettingsView.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryServerSettingsView.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.view +package app.k9mail.feature.account.setup.ui.autodiscovery.view import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -26,7 +26,8 @@ import app.k9mail.core.ui.compose.designsystem.atom.text.TextBody2 import app.k9mail.core.ui.compose.theme.Icons import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes -import app.k9mail.feature.account.setup.ui.autoconfig.toResourceString +import app.k9mail.feature.account.setup.ui.autodiscovery.toResourceString +import app.k9mail.feature.account.setup.ui.common.toResourceString @Composable internal fun AutoDiscoveryServerSettingsView( diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusBodyView.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusBodyView.kt similarity index 91% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusBodyView.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusBodyView.kt index 358dfb3ee..e5a0bd120 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusBodyView.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusBodyView.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.view +package app.k9mail.feature.account.setup.ui.autodiscovery.view import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -11,7 +11,9 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview +import app.k9mail.autodiscovery.api.AuthenticationType import app.k9mail.autodiscovery.api.AutoDiscoveryResult +import app.k9mail.autodiscovery.api.ConnectionSecurity import app.k9mail.autodiscovery.api.ImapServerSettings import app.k9mail.autodiscovery.api.SmtpServerSettings import app.k9mail.core.common.net.toHostname @@ -112,15 +114,15 @@ internal fun AutoDiscoveryStatusBodyViewPreview() { incomingServerSettings = ImapServerSettings( hostname = "imap.example.com".toHostname(), port = 993.toPort(), - connectionSecurity = app.k9mail.autodiscovery.api.ConnectionSecurity.TLS, - authenticationType = app.k9mail.autodiscovery.api.AuthenticationType.PasswordEncrypted, + connectionSecurity = ConnectionSecurity.TLS, + authenticationType = AuthenticationType.PasswordEncrypted, username = "", ), outgoingServerSettings = SmtpServerSettings( hostname = "smtp.example.com".toHostname(), port = 465.toPort(), - connectionSecurity = app.k9mail.autodiscovery.api.ConnectionSecurity.TLS, - authenticationType = app.k9mail.autodiscovery.api.AuthenticationType.PasswordEncrypted, + connectionSecurity = ConnectionSecurity.TLS, + authenticationType = AuthenticationType.PasswordEncrypted, username = "", ), isTrusted = true, diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusHeaderState.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusHeaderState.kt similarity index 95% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusHeaderState.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusHeaderState.kt index c8a9eb717..de36f44fc 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusHeaderState.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusHeaderState.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.view +package app.k9mail.feature.account.setup.ui.autodiscovery.view import androidx.annotation.StringRes import androidx.compose.ui.graphics.vector.ImageVector diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusHeaderView.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusHeaderView.kt similarity index 98% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusHeaderView.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusHeaderView.kt index 6f607e153..31c590602 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusHeaderView.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusHeaderView.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.view +package app.k9mail.feature.account.setup.ui.autodiscovery.view import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusView.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusView.kt similarity index 98% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusView.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusView.kt index 276d849f1..8c5cdf6fd 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/AutoDiscoveryStatusView.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/AutoDiscoveryStatusView.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.view +package app.k9mail.feature.account.setup.ui.autodiscovery.view import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.border diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/ConfigurationApprovalView.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/ConfigurationApprovalView.kt similarity index 90% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/ConfigurationApprovalView.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/ConfigurationApprovalView.kt index b4b6d4d04..2bd6c81b2 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/view/ConfigurationApprovalView.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/view/ConfigurationApprovalView.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig.view +package app.k9mail.feature.account.setup.ui.autodiscovery.view import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Spacer @@ -11,7 +11,7 @@ import app.k9mail.core.ui.compose.designsystem.molecule.input.CheckboxInput import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.feature.account.setup.R import app.k9mail.feature.account.setup.domain.input.BooleanInputField -import app.k9mail.feature.account.setup.ui.autoconfig.toResourceString +import app.k9mail.feature.account.setup.ui.autodiscovery.toResourceString @Composable internal fun ConfigurationApprovalView( diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/AccountSetupModuleKtTest.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/AccountSetupModuleKtTest.kt index 5537d9a2e..fdb48ef06 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/AccountSetupModuleKtTest.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/AccountSetupModuleKtTest.kt @@ -1,7 +1,7 @@ package app.k9mail.feature.account.setup import app.k9mail.feature.account.setup.ui.AccountSetupContract -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigContract import app.k9mail.feature.account.setup.ui.options.AccountOptionsContract import app.k9mail.feature.account.setup.ui.outgoing.AccountOutgoingConfigContract diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreenKtTest.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreenKtTest.kt index 4f81355e0..480f4b093 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreenKtTest.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreenKtTest.kt @@ -7,7 +7,7 @@ import app.k9mail.core.ui.compose.theme.ThunderbirdTheme import app.k9mail.feature.account.setup.ui.AccountSetupContract.Effect import app.k9mail.feature.account.setup.ui.AccountSetupContract.SetupStep import app.k9mail.feature.account.setup.ui.AccountSetupContract.State -import app.k9mail.feature.account.setup.ui.autoconfig.FakeAccountAutoConfigViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.FakeAccountAutoConfigViewModel import app.k9mail.feature.account.setup.ui.incoming.FakeAccountIncomingConfigViewModel import app.k9mail.feature.account.setup.ui.options.FakeAccountOptionsViewModel import app.k9mail.feature.account.setup.ui.outgoing.FakeAccountOutgoingConfigViewModel diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigScreenKtTest.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreenKtTest.kt similarity index 84% rename from feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigScreenKtTest.kt rename to feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreenKtTest.kt index d89f64193..91cd1ef80 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigScreenKtTest.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreenKtTest.kt @@ -1,10 +1,10 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import app.k9mail.core.ui.compose.testing.ComposeTest import app.k9mail.core.ui.compose.testing.setContent import app.k9mail.core.ui.compose.theme.ThunderbirdTheme -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Effect -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Effect +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State import assertk.assertThat import assertk.assertions.isEqualTo import kotlinx.coroutines.ExperimentalCoroutinesApi diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigStateTest.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigStateTest.kt similarity index 75% rename from feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigStateTest.kt rename to feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigStateTest.kt index ace6ca0a4..1ec138c52 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigStateTest.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigStateTest.kt @@ -1,9 +1,9 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import app.k9mail.feature.account.setup.domain.input.BooleanInputField import app.k9mail.feature.account.setup.domain.input.StringInputField -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.ConfigStep -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ConfigStep +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State import assertk.assertThat import assertk.assertions.isEqualTo import org.junit.Test diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigViewModelTest.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModelTest.kt similarity index 97% rename from feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigViewModelTest.kt rename to feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModelTest.kt index 649f92d82..1688c35ea 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/AccountAutoConfigViewModelTest.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModelTest.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import app.cash.turbine.testIn import app.k9mail.autodiscovery.api.AutoDiscoveryResult @@ -9,11 +9,11 @@ import app.k9mail.feature.account.setup.domain.entity.AutoDiscoverySettingsFixtu import app.k9mail.feature.account.setup.domain.input.BooleanInputField import app.k9mail.feature.account.setup.domain.input.StringInputField import app.k9mail.feature.account.setup.testing.eventStateTest -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.ConfigStep -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Effect -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Error -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ConfigStep +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Effect +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Error +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State import assertk.assertThat import assertk.assertions.assertThatAndTurbinesConsumed import assertk.assertions.isEqualTo diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/FakeAccountAutoConfigValidator.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigValidator.kt similarity index 92% rename from feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/FakeAccountAutoConfigValidator.kt rename to feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigValidator.kt index a84a95eee..7f39f10bb 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/FakeAccountAutoConfigValidator.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigValidator.kt @@ -1,4 +1,4 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import app.k9mail.core.common.domain.usecase.validation.ValidationResult diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/FakeAccountAutoConfigViewModel.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigViewModel.kt similarity index 52% rename from feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/FakeAccountAutoConfigViewModel.kt rename to feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigViewModel.kt index cd98288a1..6a62912ad 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autoconfig/FakeAccountAutoConfigViewModel.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigViewModel.kt @@ -1,10 +1,10 @@ -package app.k9mail.feature.account.setup.ui.autoconfig +package app.k9mail.feature.account.setup.ui.autodiscovery import app.k9mail.core.ui.compose.common.mvi.BaseViewModel -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Effect -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.State -import app.k9mail.feature.account.setup.ui.autoconfig.AccountAutoConfigContract.ViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Effect +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ViewModel class FakeAccountAutoConfigViewModel( initialState: State = State(), From df604d995595577af2ba9bbca3f814ee78ef03ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montwe=CC=81?= Date: Thu, 15 Jun 2023 11:53:10 +0200 Subject: [PATCH 2/2] Rename AutoConfig to AutoDiscovery in class names and variables --- .../account/setup/AccountSetupModule.kt | 10 +++--- .../account/setup/ui/AccountSetupScreen.kt | 12 +++---- ...tent.kt => AccountAutoDiscoveryContent.kt} | 16 ++++----- ...act.kt => AccountAutoDiscoveryContract.kt} | 2 +- ...creen.kt => AccountAutoDiscoveryScreen.kt} | 26 +++++++------- ...or.kt => AccountAutoDiscoveryValidator.kt} | 4 +-- ...el.kt => AccountAutoDiscoveryViewModel.kt} | 22 ++++++------ .../AutoDiscoveryStringMapper.kt | 6 ++-- .../ui/autodiscovery/item/ContentItems.kt | 6 ++-- .../setup/ui/common/AccountSetupTopHeader.kt | 2 +- .../account/setup/AccountSetupModuleKtTest.kt | 4 +-- .../setup/ui/AccountSetupScreenKtTest.kt | 12 +++---- ...kt => AccountAutoDiscoveryScreenKtTest.kt} | 12 +++---- ...st.kt => AccountAutoDiscoveryStateTest.kt} | 6 ++-- ...t => AccountAutoDiscoveryViewModelTest.kt} | 34 +++++++++---------- ...t => FakeAccountAutoDiscoveryValidator.kt} | 4 +-- ...t => FakeAccountAutoDiscoveryViewModel.kt} | 10 +++--- 17 files changed, 93 insertions(+), 95 deletions(-) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/{AccountAutoConfigContent.kt => AccountAutoDiscoveryContent.kt} (90%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/{AccountAutoConfigContract.kt => AccountAutoDiscoveryContract.kt} (97%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/{AccountAutoConfigScreen.kt => AccountAutoDiscoveryScreen.kt} (79%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/{AccountAutoConfigValidator.kt => AccountAutoDiscoveryValidator.kt} (93%) rename feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/{AccountAutoConfigViewModel.kt => AccountAutoDiscoveryViewModel.kt} (94%) rename feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/{AccountAutoConfigScreenKtTest.kt => AccountAutoDiscoveryScreenKtTest.kt} (80%) rename feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/{AccountAutoConfigStateTest.kt => AccountAutoDiscoveryStateTest.kt} (90%) rename feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/{AccountAutoConfigViewModelTest.kt => AccountAutoDiscoveryViewModelTest.kt} (95%) rename feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/{FakeAccountAutoConfigValidator.kt => FakeAccountAutoDiscoveryValidator.kt} (89%) rename feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/{FakeAccountAutoConfigViewModel.kt => FakeAccountAutoDiscoveryViewModel.kt} (82%) diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/AccountSetupModule.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/AccountSetupModule.kt index 02cef12d6..3081e8c71 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/AccountSetupModule.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/AccountSetupModule.kt @@ -5,9 +5,9 @@ import app.k9mail.autodiscovery.service.RealAutoDiscoveryService import app.k9mail.feature.account.setup.domain.DomainContract import app.k9mail.feature.account.setup.domain.usecase.GetAutoDiscovery import app.k9mail.feature.account.setup.ui.AccountSetupViewModel -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigValidator -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryValidator +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryViewModel import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigContract import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigValidator import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigViewModel @@ -34,14 +34,14 @@ val featureAccountSetupModule: Module = module { ) } - factory { AccountAutoConfigValidator() } + factory { AccountAutoDiscoveryValidator() } factory { AccountIncomingConfigValidator() } factory { AccountOutgoingConfigValidator() } factory { AccountOptionsValidator() } viewModel { AccountSetupViewModel() } viewModel { - AccountAutoConfigViewModel( + AccountAutoDiscoveryViewModel( validator = get(), getAutoDiscovery = get(), ) diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreen.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreen.kt index 87fb268b6..6d3c00457 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreen.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreen.kt @@ -7,9 +7,9 @@ import app.k9mail.feature.account.setup.ui.AccountSetupContract.Effect import app.k9mail.feature.account.setup.ui.AccountSetupContract.Event import app.k9mail.feature.account.setup.ui.AccountSetupContract.SetupStep import app.k9mail.feature.account.setup.ui.AccountSetupContract.ViewModel -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigScreen -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryScreen +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryViewModel import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigContract import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigScreen import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigViewModel @@ -26,7 +26,7 @@ fun AccountSetupScreen( onFinish: () -> Unit, onBack: () -> Unit, viewModel: ViewModel = koinViewModel(), - autoConfigViewModel: AccountAutoConfigContract.ViewModel = koinViewModel(), + autoDiscoveryViewModel: AccountAutoDiscoveryContract.ViewModel = koinViewModel(), incomingViewModel: AccountIncomingConfigContract.ViewModel = koinViewModel(), outgoingViewModel: AccountOutgoingConfigContract.ViewModel = koinViewModel(), optionsViewModel: AccountOptionsContract.ViewModel = koinViewModel(), @@ -40,10 +40,10 @@ fun AccountSetupScreen( when (state.value.setupStep) { SetupStep.AUTO_CONFIG -> { - AccountAutoConfigScreen( + AccountAutoDiscoveryScreen( onNext = { dispatch(Event.OnNext) }, onBack = { dispatch(Event.OnBack) }, - viewModel = autoConfigViewModel, + viewModel = autoDiscoveryViewModel, ) } diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContent.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryContent.kt similarity index 90% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContent.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryContent.kt index a6746d730..62ac6a729 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContent.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryContent.kt @@ -19,14 +19,14 @@ import app.k9mail.core.ui.compose.theme.K9Theme import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.ThunderbirdTheme import app.k9mail.feature.account.setup.R -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.State import app.k9mail.feature.account.setup.ui.autodiscovery.item.contentItems import app.k9mail.feature.account.setup.ui.common.item.ErrorItem import app.k9mail.feature.account.setup.ui.common.item.LoadingItem @Composable -internal fun AccountAutoConfigContent( +internal fun AccountAutoDiscoveryContent( state: State, onEvent: (Event) -> Unit, contentPadding: PaddingValues, @@ -34,7 +34,7 @@ internal fun AccountAutoConfigContent( ) { ResponsiveWidthContainer( modifier = Modifier - .testTag("AccountAutoConfigContent") + .testTag("AccountAutoDiscoveryContent") .padding(contentPadding) .fillMaxWidth() .then(modifier), @@ -73,9 +73,9 @@ internal fun AccountAutoConfigContent( @Composable @DevicePreviews -internal fun AccountAutoConfigContentK9Preview() { +internal fun AccountAutoDiscoveryContentK9Preview() { K9Theme { - AccountAutoConfigContent( + AccountAutoDiscoveryContent( state = State(), onEvent = {}, contentPadding = PaddingValues(), @@ -85,9 +85,9 @@ internal fun AccountAutoConfigContentK9Preview() { @Composable @DevicePreviews -internal fun AccountAutoConfigContentThunderbirdPreview() { +internal fun AccountAutoDiscoveryContentThunderbirdPreview() { ThunderbirdTheme { - AccountAutoConfigContent( + AccountAutoDiscoveryContent( state = State(), onEvent = {}, contentPadding = PaddingValues(), diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContract.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryContract.kt similarity index 97% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContract.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryContract.kt index d20f565f6..44f8ebada 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigContract.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryContract.kt @@ -6,7 +6,7 @@ import app.k9mail.core.ui.compose.common.mvi.UnidirectionalViewModel import app.k9mail.feature.account.setup.domain.input.BooleanInputField import app.k9mail.feature.account.setup.domain.input.StringInputField -interface AccountAutoConfigContract { +interface AccountAutoDiscoveryContract { enum class ConfigStep { EMAIL_ADDRESS, diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreen.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryScreen.kt similarity index 79% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreen.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryScreen.kt index 45b3faa96..6e15f1082 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreen.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryScreen.kt @@ -10,14 +10,14 @@ import app.k9mail.core.ui.compose.designsystem.template.Scaffold import app.k9mail.core.ui.compose.theme.K9Theme import app.k9mail.core.ui.compose.theme.ThunderbirdTheme import app.k9mail.feature.account.setup.R -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Effect -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Effect +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.ViewModel import app.k9mail.feature.account.setup.ui.common.AccountSetupBottomBar import app.k9mail.feature.account.setup.ui.common.AccountSetupTopHeader @Composable -internal fun AccountAutoConfigScreen( +internal fun AccountAutoDiscoveryScreen( onNext: () -> Unit, onBack: () -> Unit, viewModel: ViewModel, @@ -44,7 +44,7 @@ internal fun AccountAutoConfigScreen( }, modifier = modifier, ) { innerPadding -> - AccountAutoConfigContent( + AccountAutoDiscoveryContent( state = state.value, onEvent = { dispatch(it) }, contentPadding = innerPadding, @@ -54,13 +54,13 @@ internal fun AccountAutoConfigScreen( @Composable @DevicePreviews -internal fun AccountAutoConfigScreenK9Preview() { +internal fun AccountAutoDiscoveryScreenK9Preview() { K9Theme { - AccountAutoConfigScreen( + AccountAutoDiscoveryScreen( onNext = {}, onBack = {}, - viewModel = AccountAutoConfigViewModel( - validator = AccountAutoConfigValidator(), + viewModel = AccountAutoDiscoveryViewModel( + validator = AccountAutoDiscoveryValidator(), getAutoDiscovery = { AutoDiscoveryResult.NoUsableSettingsFound }, ), ) @@ -69,13 +69,13 @@ internal fun AccountAutoConfigScreenK9Preview() { @Composable @DevicePreviews -internal fun AccountAutoConfigScreenThunderbirdPreview() { +internal fun AccountAutoDiscoveryScreenThunderbirdPreview() { ThunderbirdTheme { - AccountAutoConfigScreen( + AccountAutoDiscoveryScreen( onNext = {}, onBack = {}, - viewModel = AccountAutoConfigViewModel( - validator = AccountAutoConfigValidator(), + viewModel = AccountAutoDiscoveryViewModel( + validator = AccountAutoDiscoveryValidator(), getAutoDiscovery = { AutoDiscoveryResult.NoUsableSettingsFound }, ), ) diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigValidator.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryValidator.kt similarity index 93% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigValidator.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryValidator.kt index 63e49d34d..2ae80059e 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigValidator.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryValidator.kt @@ -6,11 +6,11 @@ import app.k9mail.feature.account.setup.domain.usecase.ValidateConfigurationAppr import app.k9mail.feature.account.setup.domain.usecase.ValidateEmailAddress import app.k9mail.feature.account.setup.domain.usecase.ValidatePassword -internal class AccountAutoConfigValidator( +internal class AccountAutoDiscoveryValidator( private val emailAddressValidator: UseCase.ValidateEmailAddress = ValidateEmailAddress(), private val passwordValidator: UseCase.ValidatePassword = ValidatePassword(), private val configurationApprovalValidator: UseCase.ValidateConfigurationApproval = ValidateConfigurationApproval(), -) : AccountAutoConfigContract.Validator { +) : AccountAutoDiscoveryContract.Validator { override fun validateEmailAddress(emailAddress: String): ValidationResult { return emailAddressValidator.execute(emailAddress) diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModel.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryViewModel.kt similarity index 94% rename from feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModel.kt rename to feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryViewModel.kt index 2636422a7..4dec1e2cf 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModel.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryViewModel.kt @@ -6,17 +6,17 @@ import app.k9mail.core.common.domain.usecase.validation.ValidationResult import app.k9mail.core.ui.compose.common.mvi.BaseViewModel import app.k9mail.feature.account.setup.domain.DomainContract.UseCase import app.k9mail.feature.account.setup.domain.input.StringInputField -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ConfigStep -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Effect -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Error -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Validator -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.ConfigStep +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Effect +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Error +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Validator +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.ViewModel import kotlinx.coroutines.launch @Suppress("TooManyFunctions") -internal class AccountAutoConfigViewModel( +internal class AccountAutoDiscoveryViewModel( initialState: State = State(), private val validator: Validator, private val getAutoDiscovery: UseCase.GetAutoDiscovery, @@ -88,7 +88,7 @@ internal class AccountAutoConfigViewModel( updateState { it.copy(error = null) } - loadAutoConfig() + loadAutoDiscovery() } private fun submitEmail() { @@ -103,12 +103,12 @@ internal class AccountAutoConfigViewModel( } if (!hasError) { - loadAutoConfig() + loadAutoDiscovery() } } } - private fun loadAutoConfig() { + private fun loadAutoDiscovery() { viewModelScope.launch { updateState { it.copy( diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AutoDiscoveryStringMapper.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AutoDiscoveryStringMapper.kt index 9f49cf6d3..19d8749ce 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AutoDiscoveryStringMapper.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AutoDiscoveryStringMapper.kt @@ -18,10 +18,10 @@ internal fun AutoDiscoveryConnectionSecurity.toResourceString(resources: Resourc } } -internal fun AccountAutoConfigContract.Error.toResourceString(resources: Resources): String { +internal fun AccountAutoDiscoveryContract.Error.toResourceString(resources: Resources): String { return when (this) { - AccountAutoConfigContract.Error.NetworkError -> resources.getString(R.string.account_setup_error_network) - AccountAutoConfigContract.Error.UnknownError -> resources.getString(R.string.account_setup_error_unknown) + AccountAutoDiscoveryContract.Error.NetworkError -> resources.getString(R.string.account_setup_error_network) + AccountAutoDiscoveryContract.Error.UnknownError -> resources.getString(R.string.account_setup_error_unknown) } } diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/ContentItems.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/ContentItems.kt index 34c0bf5f3..29c5f07ae 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/ContentItems.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/item/ContentItems.kt @@ -1,9 +1,9 @@ package app.k9mail.feature.account.setup.ui.autodiscovery.item import androidx.compose.foundation.lazy.LazyListScope -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ConfigStep -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.ConfigStep +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.State internal fun LazyListScope.contentItems( state: State, diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/common/AccountSetupTopHeader.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/common/AccountSetupTopHeader.kt index 4330f060d..bf4bc7bdf 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/common/AccountSetupTopHeader.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/common/AccountSetupTopHeader.kt @@ -63,7 +63,7 @@ internal fun AccountSetupTopHeader( @Preview @Composable -internal fun AccountAutoConfigTopHeaderPreview() { +internal fun AccountSetupTopHeaderPreview() { PreviewWithThemes { AccountSetupTopHeader() } diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/AccountSetupModuleKtTest.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/AccountSetupModuleKtTest.kt index fdb48ef06..1d5ec8898 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/AccountSetupModuleKtTest.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/AccountSetupModuleKtTest.kt @@ -1,7 +1,7 @@ package app.k9mail.feature.account.setup import app.k9mail.feature.account.setup.ui.AccountSetupContract -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract import app.k9mail.feature.account.setup.ui.incoming.AccountIncomingConfigContract import app.k9mail.feature.account.setup.ui.options.AccountOptionsContract import app.k9mail.feature.account.setup.ui.outgoing.AccountOutgoingConfigContract @@ -31,7 +31,7 @@ class AccountSetupModuleKtTest : KoinTest { featureAccountSetupModule.verify( extraTypes = listOf( AccountSetupContract.State::class, - AccountAutoConfigContract.State::class, + AccountAutoDiscoveryContract.State::class, AccountIncomingConfigContract.State::class, AccountOutgoingConfigContract.State::class, AccountOptionsContract.State::class, diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreenKtTest.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreenKtTest.kt index 480f4b093..389db795e 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreenKtTest.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/AccountSetupScreenKtTest.kt @@ -7,7 +7,7 @@ import app.k9mail.core.ui.compose.theme.ThunderbirdTheme import app.k9mail.feature.account.setup.ui.AccountSetupContract.Effect import app.k9mail.feature.account.setup.ui.AccountSetupContract.SetupStep import app.k9mail.feature.account.setup.ui.AccountSetupContract.State -import app.k9mail.feature.account.setup.ui.autodiscovery.FakeAccountAutoConfigViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.FakeAccountAutoDiscoveryViewModel import app.k9mail.feature.account.setup.ui.incoming.FakeAccountIncomingConfigViewModel import app.k9mail.feature.account.setup.ui.options.FakeAccountOptionsViewModel import app.k9mail.feature.account.setup.ui.outgoing.FakeAccountOutgoingConfigViewModel @@ -23,7 +23,7 @@ class AccountSetupScreenKtTest : ComposeTest() { @Test fun `should display correct screen for every setup step`() = runTest { val viewModel = FakeAccountSetupViewModel() - val autoConfigViewModel = FakeAccountAutoConfigViewModel() + val autoDiscoveryViewModel = FakeAccountAutoDiscoveryViewModel() val incomingViewModel = FakeAccountIncomingConfigViewModel() val outgoingViewModel = FakeAccountOutgoingConfigViewModel() val optionsViewModel = FakeAccountOptionsViewModel() @@ -34,7 +34,7 @@ class AccountSetupScreenKtTest : ComposeTest() { onFinish = { }, onBack = { }, viewModel = viewModel, - autoConfigViewModel = autoConfigViewModel, + autoDiscoveryViewModel = autoDiscoveryViewModel, incomingViewModel = incomingViewModel, outgoingViewModel = outgoingViewModel, optionsViewModel = optionsViewModel, @@ -52,7 +52,7 @@ class AccountSetupScreenKtTest : ComposeTest() { fun `should delegate navigation effects`() = runTest { val initialState = State() val viewModel = FakeAccountSetupViewModel(initialState) - val autoConfigViewModel = FakeAccountAutoConfigViewModel() + val autoDiscoveryViewModel = FakeAccountAutoDiscoveryViewModel() val incomingViewModel = FakeAccountIncomingConfigViewModel() val outgoingViewModel = FakeAccountOutgoingConfigViewModel() val optionsViewModel = FakeAccountOptionsViewModel() @@ -65,7 +65,7 @@ class AccountSetupScreenKtTest : ComposeTest() { onFinish = { onFinishCounter++ }, onBack = { onBackCounter++ }, viewModel = viewModel, - autoConfigViewModel = autoConfigViewModel, + autoDiscoveryViewModel = autoDiscoveryViewModel, incomingViewModel = incomingViewModel, outgoingViewModel = outgoingViewModel, optionsViewModel = optionsViewModel, @@ -88,7 +88,7 @@ class AccountSetupScreenKtTest : ComposeTest() { } private fun getTagForStep(step: SetupStep): String = when (step) { - SetupStep.AUTO_CONFIG -> "AccountAutoConfigContent" + SetupStep.AUTO_CONFIG -> "AccountAutoDiscoveryContent" SetupStep.INCOMING_CONFIG -> "AccountIncomingConfigContent" SetupStep.OUTGOING_CONFIG -> "AccountOutgoingConfigContent" SetupStep.OPTIONS -> "AccountOptionsContent" diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreenKtTest.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryScreenKtTest.kt similarity index 80% rename from feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreenKtTest.kt rename to feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryScreenKtTest.kt index 91cd1ef80..2d51edc9f 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigScreenKtTest.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryScreenKtTest.kt @@ -3,27 +3,25 @@ package app.k9mail.feature.account.setup.ui.autodiscovery import app.k9mail.core.ui.compose.testing.ComposeTest import app.k9mail.core.ui.compose.testing.setContent import app.k9mail.core.ui.compose.theme.ThunderbirdTheme -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Effect -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Effect +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.State import assertk.assertThat import assertk.assertions.isEqualTo -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test -@OptIn(ExperimentalCoroutinesApi::class) -class AccountAutoConfigScreenKtTest : ComposeTest() { +class AccountAutoDiscoveryScreenKtTest : ComposeTest() { @Test fun `should delegate navigation effects`() = runTest { val initialState = State() - val viewModel = FakeAccountAutoConfigViewModel(initialState) + val viewModel = FakeAccountAutoDiscoveryViewModel(initialState) var onNextCounter = 0 var onBackCounter = 0 setContent { ThunderbirdTheme { - AccountAutoConfigScreen( + AccountAutoDiscoveryScreen( onNext = { onNextCounter++ }, onBack = { onBackCounter++ }, viewModel = viewModel, diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigStateTest.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryStateTest.kt similarity index 90% rename from feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigStateTest.kt rename to feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryStateTest.kt index 1ec138c52..fee85038c 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigStateTest.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryStateTest.kt @@ -2,13 +2,13 @@ package app.k9mail.feature.account.setup.ui.autodiscovery import app.k9mail.feature.account.setup.domain.input.BooleanInputField import app.k9mail.feature.account.setup.domain.input.StringInputField -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ConfigStep -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.ConfigStep +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.State import assertk.assertThat import assertk.assertions.isEqualTo import org.junit.Test -class AccountAutoConfigStateTest { +class AccountAutoDiscoveryStateTest { @Test fun `should set default values`() { diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModelTest.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryViewModelTest.kt similarity index 95% rename from feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModelTest.kt rename to feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryViewModelTest.kt index 1688c35ea..fc4290b14 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoConfigViewModelTest.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/AccountAutoDiscoveryViewModelTest.kt @@ -9,11 +9,11 @@ import app.k9mail.feature.account.setup.domain.entity.AutoDiscoverySettingsFixtu import app.k9mail.feature.account.setup.domain.input.BooleanInputField import app.k9mail.feature.account.setup.domain.input.StringInputField import app.k9mail.feature.account.setup.testing.eventStateTest -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ConfigStep -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Effect -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Error -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.ConfigStep +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Effect +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Error +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.State import assertk.assertThat import assertk.assertions.assertThatAndTurbinesConsumed import assertk.assertions.isEqualTo @@ -22,13 +22,13 @@ import kotlinx.coroutines.test.runTest import org.junit.Rule import org.junit.Test -class AccountAutoConfigViewModelTest { +class AccountAutoDiscoveryViewModelTest { @get:Rule val mainDispatcherRule = MainDispatcherRule() - private val testSubject = AccountAutoConfigViewModel( - validator = FakeAccountAutoConfigValidator(), + private val testSubject = AccountAutoDiscoveryViewModel( + validator = FakeAccountAutoDiscoveryValidator(), getAutoDiscovery = { delay(50) AutoDiscoveryResult.NoUsableSettingsFound @@ -91,8 +91,8 @@ class AccountAutoConfigViewModelTest { configStep = ConfigStep.EMAIL_ADDRESS, emailAddress = StringInputField(value = "email"), ) - val viewModel = AccountAutoConfigViewModel( - validator = FakeAccountAutoConfigValidator(), + val viewModel = AccountAutoDiscoveryViewModel( + validator = FakeAccountAutoDiscoveryValidator(), getAutoDiscovery = { delay(50) autoDiscoverySettings @@ -147,8 +147,8 @@ class AccountAutoConfigViewModelTest { emailAddress = StringInputField(value = "email"), ) val discoveryError = Exception("discovery error") - val viewModel = AccountAutoConfigViewModel( - validator = FakeAccountAutoConfigValidator(), + val viewModel = AccountAutoDiscoveryViewModel( + validator = FakeAccountAutoDiscoveryValidator(), getAutoDiscovery = { delay(50) AutoDiscoveryResult.UnexpectedException(discoveryError) @@ -184,7 +184,7 @@ class AccountAutoConfigViewModelTest { val failureState = validatedState.copy( isLoading = false, - error = AccountAutoConfigContract.Error.UnknownError, + error = AccountAutoDiscoveryContract.Error.UnknownError, ) assertThatAndTurbinesConsumed( actual = stateTurbine.awaitItem(), @@ -229,8 +229,8 @@ class AccountAutoConfigViewModelTest { configStep = ConfigStep.EMAIL_ADDRESS, emailAddress = StringInputField(value = "invalid email"), ) - val viewModel = AccountAutoConfigViewModel( - validator = FakeAccountAutoConfigValidator( + val viewModel = AccountAutoDiscoveryViewModel( + validator = FakeAccountAutoDiscoveryValidator( emailAddressAnswer = ValidationResult.Failure(TestError), ), getAutoDiscovery = { AutoDiscoveryResult.NoUsableSettingsFound }, @@ -312,8 +312,8 @@ class AccountAutoConfigViewModelTest { emailAddress = StringInputField(value = "email"), password = StringInputField(value = "password"), ) - val viewModel = AccountAutoConfigViewModel( - validator = FakeAccountAutoConfigValidator( + val viewModel = AccountAutoDiscoveryViewModel( + validator = FakeAccountAutoDiscoveryValidator( passwordAnswer = ValidationResult.Failure(TestError), ), getAutoDiscovery = { AutoDiscoveryResult.NoUsableSettingsFound }, diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigValidator.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoDiscoveryValidator.kt similarity index 89% rename from feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigValidator.kt rename to feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoDiscoveryValidator.kt index 7f39f10bb..57237f562 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigValidator.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoDiscoveryValidator.kt @@ -2,11 +2,11 @@ package app.k9mail.feature.account.setup.ui.autodiscovery import app.k9mail.core.common.domain.usecase.validation.ValidationResult -class FakeAccountAutoConfigValidator( +class FakeAccountAutoDiscoveryValidator( private val emailAddressAnswer: ValidationResult = ValidationResult.Success, private val passwordAnswer: ValidationResult = ValidationResult.Success, private val configurationApprovalAnswer: ValidationResult = ValidationResult.Success, -) : AccountAutoConfigContract.Validator { +) : AccountAutoDiscoveryContract.Validator { override fun validateEmailAddress(emailAddress: String): ValidationResult = emailAddressAnswer override fun validatePassword(password: String): ValidationResult = passwordAnswer override fun validateConfigurationApproval( diff --git a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigViewModel.kt b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoDiscoveryViewModel.kt similarity index 82% rename from feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigViewModel.kt rename to feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoDiscoveryViewModel.kt index 6a62912ad..8e4a94f10 100644 --- a/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoConfigViewModel.kt +++ b/feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/autodiscovery/FakeAccountAutoDiscoveryViewModel.kt @@ -1,12 +1,12 @@ package app.k9mail.feature.account.setup.ui.autodiscovery import app.k9mail.core.ui.compose.common.mvi.BaseViewModel -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Effect -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.Event -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.State -import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoConfigContract.ViewModel +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Effect +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Event +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.State +import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.ViewModel -class FakeAccountAutoConfigViewModel( +class FakeAccountAutoDiscoveryViewModel( initialState: State = State(), ) : BaseViewModel(initialState), ViewModel {