Rename module from config to settings for consistency

This commit is contained in:
Wolf-Martell Montwé 2023-09-13 13:07:56 +02:00
parent 49bde4fab7
commit 009f235fe7
No known key found for this signature in database
GPG key ID: 6D45B21512ACBF72
62 changed files with 304 additions and 301 deletions

View file

@ -1,29 +0,0 @@
package app.k9mail.feature.account.server.config.ui.common.mapper
import android.content.res.Resources
import app.k9mail.feature.account.common.domain.entity.AuthenticationType
import app.k9mail.feature.account.server.config.R
internal fun AuthenticationType.toResourceString(resources: Resources): String {
return when (this) {
AuthenticationType.None -> {
resources.getString(R.string.account_server_config_authentication_none)
}
AuthenticationType.PasswordCleartext -> {
resources.getString(R.string.account_server_config_authentication_password_cleartext)
}
AuthenticationType.PasswordEncrypted -> {
resources.getString(R.string.account_server_config_authentication_password_encrypted)
}
AuthenticationType.ClientCertificate -> {
resources.getString(R.string.account_server_config_authentication_client_certificate)
}
AuthenticationType.OAuth2 -> {
resources.getString(R.string.account_server_config_authentication_client_oauth)
}
}
}

View file

@ -1,13 +0,0 @@
package app.k9mail.feature.account.server.config.ui.common.mapper
import android.content.res.Resources
import app.k9mail.feature.account.common.domain.entity.ConnectionSecurity
import app.k9mail.feature.account.server.config.R
internal fun ConnectionSecurity.toResourceString(resources: Resources): String {
return when (this) {
ConnectionSecurity.None -> resources.getString(R.string.account_server_config_connection_security_none)
ConnectionSecurity.StartTLS -> resources.getString(R.string.account_server_config_connection_security_start_tls)
ConnectionSecurity.TLS -> resources.getString(R.string.account_server_config_connection_security_ssl)
}
}

View file

@ -1,22 +0,0 @@
package app.k9mail.feature.account.server.config.ui.incoming.fake
import app.k9mail.core.ui.compose.common.mvi.BaseViewModel
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Effect
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Event
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.ViewModel
class FakeAccountIncomingConfigViewModel(
initialState: State = State(),
) : BaseViewModel<State, Event, Effect>(initialState), ViewModel {
val events = mutableListOf<Event>()
override fun event(event: Event) {
events.add(event)
}
fun effect(effect: Effect) {
emitEffect(effect)
}
}

View file

@ -1,22 +0,0 @@
package app.k9mail.feature.account.server.config.ui.outgoing.fake
import app.k9mail.core.ui.compose.common.mvi.BaseViewModel
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Effect
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Event
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.ViewModel
class FakeAccountOutgoingConfigViewModel(
initialState: State = State(),
) : BaseViewModel<State, Event, Effect>(initialState), ViewModel {
val events = mutableListOf<Event>()
override fun event(event: Event) {
events.add(event)
}
fun effect(effect: Effect) {
emitEffect(effect)
}
}

View file

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="account_server_config_protocol_type_label">Protocol</string>
<string name="account_server_config_server_label">Server</string>
<string name="account_server_config_security_label">Security</string>
<string name="account_server_config_port_label">Port</string>
<string name="account_server_config_authentication_label">Authentication</string>
<string name="account_server_config_username_label">Username</string>
<string name="account_server_config_connection_security_none">None</string>
<string name="account_server_config_connection_security_start_tls">StartTLS</string>
<string name="account_server_config_connection_security_ssl">SSL/TLS</string>
<string name="account_server_config_authentication_none">None</string>
<string name="account_server_config_authentication_password_cleartext">Normal password</string>
<string name="account_server_config_authentication_password_encrypted">Encrypted password</string>
<string name="account_server_config_authentication_client_certificate">Client certificate</string>
<string name="account_server_config_authentication_client_oauth">OAuth 2.0</string>
<string name="account_server_config_client_certificate_none_selected">None</string>
<string name="account_server_config_client_certificate_label">Client certificate</string>
<string name="account_server_config_incoming_top_bar_title">Incoming server settings</string>
<string name="account_server_config_incoming_imap_namespace_label">Auto-detect IMAP namespace</string>
<string name="account_server_config_incoming_imap_prefix_label">IMAP path prefix</string>
<string name="account_server_config_incoming_imap_compression_label">Use compression</string>
<string name="account_server_config_incoming_imap_send_client_id_label">Send client ID</string>
<string name="account_server_config_outgoing_top_bar_title">Outgoing server settings</string>
<string name="account_server_config_validation_error_email_address_required">Email address is required.</string>
<string name="account_server_config_validation_error_email_address_invalid">Email address is invalid.</string>
<string name="account_server_config_validation_error_server_required">Server name is required.</string>
<string name="account_server_config_validation_error_port_required">Port is required.</string>
<string name="account_server_config_validation_error_port_invalid">Port is invalid (must be 165535).</string>
<string name="account_server_config_validation_error_username_required">Username is required.</string>
<string name="account_server_config_validation_error_password_required">Password is required.</string>
<string name="account_server_config_validation_error_imap_prefix_blank">Imap prefix can\'t be blank.</string>
</resources>

View file

@ -3,8 +3,8 @@ plugins {
}
android {
namespace = "app.k9mail.feature.account.server.config"
resourcePrefix = "account_server_config_"
namespace = "app.k9mail.feature.account.server.settings"
resourcePrefix = "account_server_settings_"
buildTypes {
debug {

View file

@ -1,11 +1,11 @@
package app.k9mail.feature.account.server.config
package app.k9mail.feature.account.server.settings
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigValidator
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigViewModel
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigValidator
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigViewModel
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigValidator
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigViewModel
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigValidator
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigViewModel
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.core.module.Module
import org.koin.dsl.module

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.domain
package app.k9mail.feature.account.server.settings.domain
import app.k9mail.core.common.domain.usecase.validation.ValidationResult

View file

@ -1,8 +1,8 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.ServerConfigDomainContract.UseCase
import app.k9mail.feature.account.server.settings.domain.ServerConfigDomainContract.UseCase
class ValidateEmailAddress : UseCase.ValidateEmailAddress {

View file

@ -1,8 +1,8 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.ServerConfigDomainContract.UseCase
import app.k9mail.feature.account.server.settings.domain.ServerConfigDomainContract.UseCase
internal class ValidateImapPrefix : UseCase.ValidateImapPrefix {

View file

@ -1,8 +1,8 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.ServerConfigDomainContract.UseCase
import app.k9mail.feature.account.server.settings.domain.ServerConfigDomainContract.UseCase
class ValidatePassword : UseCase.ValidatePassword {

View file

@ -1,8 +1,8 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.ServerConfigDomainContract.UseCase
import app.k9mail.feature.account.server.settings.domain.ServerConfigDomainContract.UseCase
internal class ValidatePort : UseCase.ValidatePort {

View file

@ -1,8 +1,8 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.ServerConfigDomainContract.UseCase
import app.k9mail.feature.account.server.settings.domain.ServerConfigDomainContract.UseCase
internal class ValidateServer : UseCase.ValidateServer {

View file

@ -1,8 +1,8 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.ServerConfigDomainContract.UseCase
import app.k9mail.feature.account.server.settings.domain.ServerConfigDomainContract.UseCase
internal class ValidateUsername : UseCase.ValidateUsername {

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.common
package app.k9mail.feature.account.server.settings.ui.common
import android.security.KeyChain
import androidx.compose.foundation.layout.Column
@ -11,7 +11,7 @@ import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.common.activity.LocalActivity
import app.k9mail.core.ui.compose.designsystem.atom.textfield.TextFieldOutlinedFakeSelect
import app.k9mail.core.ui.compose.designsystem.molecule.input.inputContentPadding
import app.k9mail.feature.account.server.config.R
import app.k9mail.feature.account.server.settings.R
@Composable
fun ClientCertificateInput(
@ -29,7 +29,7 @@ fun ClientCertificateInput(
) {
val activity = LocalActivity.current
TextFieldOutlinedFakeSelect(
text = alias ?: stringResource(R.string.account_server_config_client_certificate_none_selected),
text = alias ?: stringResource(R.string.account_server_settings_client_certificate_none_selected),
onClick = {
KeyChain.choosePrivateKeyAlias(activity, onValueChange, null, null, null, -1, alias)
},

View file

@ -0,0 +1,29 @@
package app.k9mail.feature.account.server.settings.ui.common.mapper
import android.content.res.Resources
import app.k9mail.feature.account.common.domain.entity.AuthenticationType
import app.k9mail.feature.account.server.settings.R
internal fun AuthenticationType.toResourceString(resources: Resources): String {
return when (this) {
AuthenticationType.None -> {
resources.getString(R.string.account_server_settings_authentication_none)
}
AuthenticationType.PasswordCleartext -> {
resources.getString(R.string.account_server_settings_authentication_password_cleartext)
}
AuthenticationType.PasswordEncrypted -> {
resources.getString(R.string.account_server_settings_authentication_password_encrypted)
}
AuthenticationType.ClientCertificate -> {
resources.getString(R.string.account_server_settings_authentication_client_certificate)
}
AuthenticationType.OAuth2 -> {
resources.getString(R.string.account_server_settings_authentication_client_oauth)
}
}
}

View file

@ -0,0 +1,15 @@
package app.k9mail.feature.account.server.settings.ui.common.mapper
import android.content.res.Resources
import app.k9mail.feature.account.common.domain.entity.ConnectionSecurity
import app.k9mail.feature.account.server.settings.R
internal fun ConnectionSecurity.toResourceString(resources: Resources): String {
return when (this) {
ConnectionSecurity.None -> resources.getString(R.string.account_server_settings_connection_security_none)
ConnectionSecurity.StartTLS -> resources.getString(
R.string.account_server_settings_connection_security_start_tls,
)
ConnectionSecurity.TLS -> resources.getString(R.string.account_server_settings_connection_security_ssl)
}
}

View file

@ -1,14 +1,14 @@
package app.k9mail.feature.account.server.config.ui.common.mapper
package app.k9mail.feature.account.server.settings.ui.common.mapper
import android.content.res.Resources
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.feature.account.server.config.R
import app.k9mail.feature.account.server.config.domain.usecase.ValidateEmailAddress.ValidateEmailAddressError
import app.k9mail.feature.account.server.config.domain.usecase.ValidateImapPrefix.ValidateImapPrefixError
import app.k9mail.feature.account.server.config.domain.usecase.ValidatePassword.ValidatePasswordError
import app.k9mail.feature.account.server.config.domain.usecase.ValidatePort.ValidatePortError
import app.k9mail.feature.account.server.config.domain.usecase.ValidateServer.ValidateServerError
import app.k9mail.feature.account.server.config.domain.usecase.ValidateUsername.ValidateUsernameError
import app.k9mail.feature.account.server.settings.R
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateEmailAddress.ValidateEmailAddressError
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateImapPrefix.ValidateImapPrefixError
import app.k9mail.feature.account.server.settings.domain.usecase.ValidatePassword.ValidatePasswordError
import app.k9mail.feature.account.server.settings.domain.usecase.ValidatePort.ValidatePortError
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateServer.ValidateServerError
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateUsername.ValidateUsernameError
fun ValidationError.toResourceString(resources: Resources): String {
return when (this) {
@ -25,11 +25,11 @@ fun ValidationError.toResourceString(resources: Resources): String {
private fun ValidateEmailAddressError.toEmailAddressErrorString(resources: Resources): String {
return when (this) {
is ValidateEmailAddressError.EmptyEmailAddress -> resources.getString(
R.string.account_server_config_validation_error_email_address_required,
R.string.account_server_settings_validation_error_email_address_required,
)
is ValidateEmailAddressError.InvalidEmailAddress -> resources.getString(
R.string.account_server_config_validation_error_email_address_invalid,
R.string.account_server_settings_validation_error_email_address_invalid,
)
}
}
@ -37,7 +37,7 @@ private fun ValidateEmailAddressError.toEmailAddressErrorString(resources: Resou
private fun ValidateServerError.toServerErrorString(resources: Resources): String {
return when (this) {
is ValidateServerError.EmptyServer -> resources.getString(
R.string.account_server_config_validation_error_server_required,
R.string.account_server_settings_validation_error_server_required,
)
}
}
@ -45,11 +45,11 @@ private fun ValidateServerError.toServerErrorString(resources: Resources): Strin
private fun ValidatePortError.toPortErrorString(resources: Resources): String {
return when (this) {
is ValidatePortError.EmptyPort -> resources.getString(
R.string.account_server_config_validation_error_port_required,
R.string.account_server_settings_validation_error_port_required,
)
is ValidatePortError.InvalidPort -> resources.getString(
R.string.account_server_config_validation_error_port_invalid,
R.string.account_server_settings_validation_error_port_invalid,
)
}
}
@ -57,7 +57,7 @@ private fun ValidatePortError.toPortErrorString(resources: Resources): String {
private fun ValidateUsernameError.toUsernameErrorString(resources: Resources): String {
return when (this) {
ValidateUsernameError.EmptyUsername -> resources.getString(
R.string.account_server_config_validation_error_username_required,
R.string.account_server_settings_validation_error_username_required,
)
}
}
@ -65,7 +65,7 @@ private fun ValidateUsernameError.toUsernameErrorString(resources: Resources): S
private fun ValidatePasswordError.toPasswordErrorString(resources: Resources): String {
return when (this) {
ValidatePasswordError.EmptyPassword -> resources.getString(
R.string.account_server_config_validation_error_password_required,
R.string.account_server_settings_validation_error_password_required,
)
}
}
@ -73,7 +73,7 @@ private fun ValidatePasswordError.toPasswordErrorString(resources: Resources): S
private fun ValidateImapPrefixError.toImapPrefixErrorString(resources: Resources): String {
return when (this) {
ValidateImapPrefixError.BlankImapPrefix -> resources.getString(
R.string.account_server_config_validation_error_imap_prefix_blank,
R.string.account_server_settings_validation_error_imap_prefix_blank,
)
}
}

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
@ -28,11 +28,11 @@ import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.feature.account.common.domain.entity.ConnectionSecurity
import app.k9mail.feature.account.common.domain.entity.IncomingProtocolType
import app.k9mail.feature.account.common.ui.item.defaultItemPadding
import app.k9mail.feature.account.server.config.R
import app.k9mail.feature.account.server.config.ui.common.ClientCertificateInput
import app.k9mail.feature.account.server.config.ui.common.mapper.toResourceString
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Event
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.settings.R
import app.k9mail.feature.account.server.settings.ui.common.ClientCertificateInput
import app.k9mail.feature.account.server.settings.ui.common.mapper.toResourceString
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Event
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.State
@Suppress("LongMethod")
@Composable
@ -67,7 +67,7 @@ internal fun AccountIncomingConfigContent(
options = IncomingProtocolType.all(),
selectedOption = state.protocolType,
onOptionChange = { onEvent(Event.ProtocolTypeChanged(it)) },
label = stringResource(id = R.string.account_server_config_protocol_type_label),
label = stringResource(id = R.string.account_server_settings_protocol_type_label),
contentPadding = defaultItemPadding(),
)
}
@ -77,7 +77,7 @@ internal fun AccountIncomingConfigContent(
text = state.server.value,
errorMessage = state.server.error?.toResourceString(resources),
onTextChange = { onEvent(Event.ServerChanged(it)) },
label = stringResource(id = R.string.account_server_config_server_label),
label = stringResource(id = R.string.account_server_settings_server_label),
contentPadding = defaultItemPadding(),
)
}
@ -88,7 +88,7 @@ internal fun AccountIncomingConfigContent(
optionToStringTransformation = { it.toResourceString(resources) },
selectedOption = state.security,
onOptionChange = { onEvent(Event.SecurityChanged(it)) },
label = stringResource(id = R.string.account_server_config_security_label),
label = stringResource(id = R.string.account_server_settings_security_label),
contentPadding = defaultItemPadding(),
)
}
@ -98,7 +98,7 @@ internal fun AccountIncomingConfigContent(
value = state.port.value,
errorMessage = state.port.error?.toResourceString(resources),
onValueChange = { onEvent(Event.PortChanged(it)) },
label = stringResource(id = R.string.account_server_config_port_label),
label = stringResource(id = R.string.account_server_settings_port_label),
contentPadding = defaultItemPadding(),
)
}
@ -109,7 +109,7 @@ internal fun AccountIncomingConfigContent(
optionToStringTransformation = { it.toResourceString(resources) },
selectedOption = state.authenticationType,
onOptionChange = { onEvent(Event.AuthenticationTypeChanged(it)) },
label = stringResource(id = R.string.account_server_config_authentication_label),
label = stringResource(id = R.string.account_server_settings_authentication_label),
contentPadding = defaultItemPadding(),
)
}
@ -119,7 +119,7 @@ internal fun AccountIncomingConfigContent(
text = state.username.value,
errorMessage = state.username.error?.toResourceString(resources),
onTextChange = { onEvent(Event.UsernameChanged(it)) },
label = stringResource(id = R.string.account_server_config_username_label),
label = stringResource(id = R.string.account_server_settings_username_label),
contentPadding = defaultItemPadding(),
)
}
@ -139,7 +139,7 @@ internal fun AccountIncomingConfigContent(
ClientCertificateInput(
alias = state.clientCertificateAlias,
onValueChange = { onEvent(Event.ClientCertificateChanged(it)) },
label = stringResource(id = R.string.account_server_config_client_certificate_label),
label = stringResource(id = R.string.account_server_settings_client_certificate_label),
contentPadding = defaultItemPadding(),
)
}
@ -147,7 +147,7 @@ internal fun AccountIncomingConfigContent(
if (state.protocolType == IncomingProtocolType.IMAP) {
item {
CheckboxInput(
text = stringResource(id = R.string.account_server_config_incoming_imap_namespace_label),
text = stringResource(id = R.string.account_server_settings_incoming_imap_namespace_label),
checked = state.imapAutodetectNamespaceEnabled,
onCheckedChange = { onEvent(Event.ImapAutoDetectNamespaceChanged(it)) },
contentPadding = defaultItemPadding(),
@ -158,7 +158,7 @@ internal fun AccountIncomingConfigContent(
if (state.imapAutodetectNamespaceEnabled) {
TextInput(
onTextChange = {},
label = stringResource(id = R.string.account_server_config_incoming_imap_prefix_label),
label = stringResource(id = R.string.account_server_settings_incoming_imap_prefix_label),
contentPadding = defaultItemPadding(),
isEnabled = false,
)
@ -167,7 +167,7 @@ internal fun AccountIncomingConfigContent(
text = state.imapPrefix.value,
errorMessage = state.imapPrefix.error?.toResourceString(resources),
onTextChange = { onEvent(Event.ImapPrefixChanged(it)) },
label = stringResource(id = R.string.account_server_config_incoming_imap_prefix_label),
label = stringResource(id = R.string.account_server_settings_incoming_imap_prefix_label),
contentPadding = defaultItemPadding(),
)
}
@ -175,7 +175,7 @@ internal fun AccountIncomingConfigContent(
item {
CheckboxInput(
text = stringResource(id = R.string.account_server_config_incoming_imap_compression_label),
text = stringResource(id = R.string.account_server_settings_incoming_imap_compression_label),
checked = state.imapUseCompression,
onCheckedChange = { onEvent(Event.ImapUseCompressionChanged(it)) },
contentPadding = defaultItemPadding(),
@ -184,7 +184,7 @@ internal fun AccountIncomingConfigContent(
item {
CheckboxInput(
text = stringResource(R.string.account_server_config_incoming_imap_send_client_id_label),
text = stringResource(R.string.account_server_settings_incoming_imap_send_client_id_label),
checked = state.imapSendClientId,
onCheckedChange = { onEvent(Event.ImapSendClientIdChanged(it)) },
contentPadding = defaultItemPadding(),

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.core.ui.compose.common.mvi.UnidirectionalViewModel

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import androidx.activity.compose.BackHandler
import androidx.compose.runtime.Composable
@ -13,10 +13,10 @@ import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.feature.account.common.ui.AccountTopAppBar
import app.k9mail.feature.account.common.ui.WizardNavigationBar
import app.k9mail.feature.account.common.ui.preview.PreviewAccountStateRepository
import app.k9mail.feature.account.server.config.R
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Effect
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Event
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.ViewModel
import app.k9mail.feature.account.server.settings.R
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Effect
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Event
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.ViewModel
@Composable
fun AccountIncomingConfigScreen(
@ -43,7 +43,7 @@ fun AccountIncomingConfigScreen(
Scaffold(
topBar = {
AccountTopAppBar(
title = stringResource(id = R.string.account_server_config_incoming_top_bar_title),
title = stringResource(id = R.string.account_server_settings_incoming_top_bar_title),
)
},
bottomBar = {

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import app.k9mail.feature.account.common.domain.entity.AuthenticationType
import app.k9mail.feature.account.common.domain.entity.IncomingProtocolType

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import app.k9mail.feature.account.common.domain.entity.AccountState
import app.k9mail.feature.account.common.domain.entity.IncomingProtocolType
@ -8,7 +8,7 @@ import app.k9mail.feature.account.common.domain.entity.toConnectionSecurity
import app.k9mail.feature.account.common.domain.entity.toMailConnectionSecurity
import app.k9mail.feature.account.common.domain.input.NumberInputField
import app.k9mail.feature.account.common.domain.input.StringInputField
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.State
import com.fsck.k9.mail.ServerSettings
import com.fsck.k9.mail.store.imap.ImapStoreSettings

View file

@ -1,12 +1,12 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.ServerConfigDomainContract.UseCase
import app.k9mail.feature.account.server.config.domain.usecase.ValidateImapPrefix
import app.k9mail.feature.account.server.config.domain.usecase.ValidatePassword
import app.k9mail.feature.account.server.config.domain.usecase.ValidatePort
import app.k9mail.feature.account.server.config.domain.usecase.ValidateServer
import app.k9mail.feature.account.server.config.domain.usecase.ValidateUsername
import app.k9mail.feature.account.server.settings.domain.ServerConfigDomainContract.UseCase
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateImapPrefix
import app.k9mail.feature.account.server.settings.domain.usecase.ValidatePassword
import app.k9mail.feature.account.server.settings.domain.usecase.ValidatePort
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateServer
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateUsername
internal class AccountIncomingConfigValidator(
private val serverValidator: UseCase.ValidateServer = ValidateServer(),

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.core.ui.compose.common.mvi.BaseViewModel
@ -6,14 +6,15 @@ import app.k9mail.feature.account.common.domain.AccountDomainContract
import app.k9mail.feature.account.common.domain.entity.ConnectionSecurity
import app.k9mail.feature.account.common.domain.entity.IncomingProtocolType
import app.k9mail.feature.account.common.domain.entity.toDefaultPort
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Effect
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Event
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Validator
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.ViewModel
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Effect
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Event
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Validator
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.ViewModel
class AccountIncomingConfigViewModel(
private val validator: Validator,
// private val serverSettingsRepository: ServerConfigDomainContract.ServerSettingsRepository,
private val accountStateRepository: AccountDomainContract.AccountStateRepository,
initialState: State = State(),
) : BaseViewModel<State, Event, Effect>(initialState = initialState), ViewModel {

View file

@ -1,7 +1,7 @@
package app.k9mail.feature.account.server.config.ui.incoming.fake
package app.k9mail.feature.account.server.settings.ui.incoming.fake
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract
class FakeAccountIncomingConfigValidator(
private val serverAnswer: ValidationResult = ValidationResult.Success,

View file

@ -0,0 +1,22 @@
package app.k9mail.feature.account.server.settings.ui.incoming.fake
import app.k9mail.core.ui.compose.common.mvi.BaseViewModel
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Effect
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Event
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.ViewModel
class FakeAccountIncomingConfigViewModel(
initialState: State = State(),
) : BaseViewModel<State, Event, Effect>(initialState), ViewModel {
val events = mutableListOf<Event>()
override fun event(event: Event) {
events.add(event)
}
fun effect(effect: Effect) {
emitEffect(effect)
}
}

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
@ -27,11 +27,11 @@ import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.feature.account.common.domain.entity.AuthenticationType
import app.k9mail.feature.account.common.domain.entity.ConnectionSecurity
import app.k9mail.feature.account.common.ui.item.defaultItemPadding
import app.k9mail.feature.account.server.config.R
import app.k9mail.feature.account.server.config.ui.common.ClientCertificateInput
import app.k9mail.feature.account.server.config.ui.common.mapper.toResourceString
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Event
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.settings.R
import app.k9mail.feature.account.server.settings.ui.common.ClientCertificateInput
import app.k9mail.feature.account.server.settings.ui.common.mapper.toResourceString
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Event
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.State
@Suppress("LongMethod")
@Composable
@ -66,7 +66,7 @@ internal fun AccountOutgoingConfigContent(
text = state.server.value,
errorMessage = state.server.error?.toResourceString(resources),
onTextChange = { onEvent(Event.ServerChanged(it)) },
label = stringResource(id = R.string.account_server_config_server_label),
label = stringResource(id = R.string.account_server_settings_server_label),
isRequired = true,
contentPadding = defaultItemPadding(),
)
@ -78,7 +78,7 @@ internal fun AccountOutgoingConfigContent(
optionToStringTransformation = { it.toResourceString(resources) },
selectedOption = state.security,
onOptionChange = { onEvent(Event.SecurityChanged(it)) },
label = stringResource(id = R.string.account_server_config_security_label),
label = stringResource(id = R.string.account_server_settings_security_label),
contentPadding = defaultItemPadding(),
)
}
@ -88,7 +88,7 @@ internal fun AccountOutgoingConfigContent(
value = state.port.value,
errorMessage = state.port.error?.toResourceString(resources),
onValueChange = { onEvent(Event.PortChanged(it)) },
label = stringResource(id = R.string.account_server_config_port_label),
label = stringResource(id = R.string.account_server_settings_port_label),
isRequired = true,
contentPadding = defaultItemPadding(),
)
@ -100,7 +100,7 @@ internal fun AccountOutgoingConfigContent(
optionToStringTransformation = { it.toResourceString(resources) },
selectedOption = state.authenticationType,
onOptionChange = { onEvent(Event.AuthenticationTypeChanged(it)) },
label = stringResource(id = R.string.account_server_config_authentication_label),
label = stringResource(id = R.string.account_server_settings_authentication_label),
contentPadding = defaultItemPadding(),
)
}
@ -111,7 +111,7 @@ internal fun AccountOutgoingConfigContent(
text = state.username.value,
errorMessage = state.username.error?.toResourceString(resources),
onTextChange = { onEvent(Event.UsernameChanged(it)) },
label = stringResource(id = R.string.account_server_config_username_label),
label = stringResource(id = R.string.account_server_settings_username_label),
isRequired = true,
contentPadding = defaultItemPadding(),
)
@ -134,7 +134,7 @@ internal fun AccountOutgoingConfigContent(
ClientCertificateInput(
alias = state.clientCertificateAlias,
onValueChange = { onEvent(Event.ClientCertificateChanged(it)) },
label = stringResource(id = R.string.account_server_config_client_certificate_label),
label = stringResource(id = R.string.account_server_settings_client_certificate_label),
contentPadding = defaultItemPadding(),
)
}

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.core.ui.compose.common.mvi.UnidirectionalViewModel

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
import androidx.activity.compose.BackHandler
import androidx.compose.runtime.Composable
@ -13,10 +13,10 @@ import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.feature.account.common.ui.AccountTopAppBar
import app.k9mail.feature.account.common.ui.WizardNavigationBar
import app.k9mail.feature.account.common.ui.preview.PreviewAccountStateRepository
import app.k9mail.feature.account.server.config.R
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Effect
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Event
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.ViewModel
import app.k9mail.feature.account.server.settings.R
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Effect
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Event
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.ViewModel
@Composable
fun AccountOutgoingConfigScreen(
@ -43,7 +43,7 @@ fun AccountOutgoingConfigScreen(
Scaffold(
topBar = {
AccountTopAppBar(
title = stringResource(id = R.string.account_server_config_outgoing_top_bar_title),
title = stringResource(id = R.string.account_server_settings_outgoing_top_bar_title),
)
},
bottomBar = {

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
internal val AccountOutgoingConfigContract.State.isUsernameFieldVisible: Boolean
get() = authenticationType.isUsernameRequired

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
import app.k9mail.feature.account.common.domain.entity.AccountState
import app.k9mail.feature.account.common.domain.entity.toAuthType
@ -7,7 +7,7 @@ import app.k9mail.feature.account.common.domain.entity.toConnectionSecurity
import app.k9mail.feature.account.common.domain.entity.toMailConnectionSecurity
import app.k9mail.feature.account.common.domain.input.NumberInputField
import app.k9mail.feature.account.common.domain.input.StringInputField
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.State
import com.fsck.k9.mail.ServerSettings
internal fun AccountState.toOutgoingConfigState(): State {

View file

@ -1,10 +1,10 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.usecase.ValidatePassword
import app.k9mail.feature.account.server.config.domain.usecase.ValidatePort
import app.k9mail.feature.account.server.config.domain.usecase.ValidateServer
import app.k9mail.feature.account.server.config.domain.usecase.ValidateUsername
import app.k9mail.feature.account.server.settings.domain.usecase.ValidatePassword
import app.k9mail.feature.account.server.settings.domain.usecase.ValidatePort
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateServer
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateUsername
internal class AccountOutgoingConfigValidator(
private val serverValidator: ValidateServer = ValidateServer(),

View file

@ -1,15 +1,15 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.core.ui.compose.common.mvi.BaseViewModel
import app.k9mail.feature.account.common.domain.AccountDomainContract
import app.k9mail.feature.account.common.domain.entity.ConnectionSecurity
import app.k9mail.feature.account.common.domain.entity.toSmtpDefaultPort
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Effect
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Event
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Validator
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.ViewModel
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Effect
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Event
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Validator
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.ViewModel
class AccountOutgoingConfigViewModel(
private val validator: Validator,

View file

@ -1,7 +1,7 @@
package app.k9mail.feature.account.server.config.ui.outgoing.fake
package app.k9mail.feature.account.server.settings.ui.outgoing.fake
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract
class FakeAccountOutgoingConfigValidator(
private val serverAnswer: ValidationResult = ValidationResult.Success,

View file

@ -0,0 +1,22 @@
package app.k9mail.feature.account.server.settings.ui.outgoing.fake
import app.k9mail.core.ui.compose.common.mvi.BaseViewModel
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Effect
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Event
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.ViewModel
class FakeAccountOutgoingConfigViewModel(
initialState: State = State(),
) : BaseViewModel<State, Event, Effect>(initialState), ViewModel {
val events = mutableListOf<Event>()
override fun event(event: Event) {
events.add(event)
}
fun effect(effect: Effect) {
emitEffect(effect)
}
}

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="account_server_settings_protocol_type_label">Protocol</string>
<string name="account_server_settings_server_label">Server</string>
<string name="account_server_settings_security_label">Security</string>
<string name="account_server_settings_port_label">Port</string>
<string name="account_server_settings_authentication_label">Authentication</string>
<string name="account_server_settings_username_label">Username</string>
<string name="account_server_settings_connection_security_none">None</string>
<string name="account_server_settings_connection_security_start_tls">StartTLS</string>
<string name="account_server_settings_connection_security_ssl">SSL/TLS</string>
<string name="account_server_settings_authentication_none">None</string>
<string name="account_server_settings_authentication_password_cleartext">Normal password</string>
<string name="account_server_settings_authentication_password_encrypted">Encrypted password</string>
<string name="account_server_settings_authentication_client_certificate">Client certificate</string>
<string name="account_server_settings_authentication_client_oauth">OAuth 2.0</string>
<string name="account_server_settings_client_certificate_none_selected">None</string>
<string name="account_server_settings_client_certificate_label">Client certificate</string>
<string name="account_server_settings_incoming_top_bar_title">Incoming server settings</string>
<string name="account_server_settings_incoming_imap_namespace_label">Auto-detect IMAP namespace</string>
<string name="account_server_settings_incoming_imap_prefix_label">IMAP path prefix</string>
<string name="account_server_settings_incoming_imap_compression_label">Use compression</string>
<string name="account_server_settings_incoming_imap_send_client_id_label">Send client ID</string>
<string name="account_server_settings_outgoing_top_bar_title">Outgoing server settings</string>
<string name="account_server_settings_validation_error_email_address_required">Email address is required.</string>
<string name="account_server_settings_validation_error_email_address_invalid">Email address is invalid.</string>
<string name="account_server_settings_validation_error_server_required">Server name is required.</string>
<string name="account_server_settings_validation_error_port_required">Port is required.</string>
<string name="account_server_settings_validation_error_port_invalid">Port is invalid (must be 165535).</string>
<string name="account_server_settings_validation_error_username_required">Username is required.</string>
<string name="account_server_settings_validation_error_password_required">Password is required.</string>
<string name="account_server_settings_validation_error_imap_prefix_blank">Imap prefix can\'t be blank.</string>
</resources>

View file

@ -1,7 +1,7 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.usecase.ValidateEmailAddress.ValidateEmailAddressError
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateEmailAddress.ValidateEmailAddressError
import assertk.assertThat
import assertk.assertions.isInstanceOf
import assertk.assertions.prop

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import assertk.assertThat

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import assertk.assertThat

View file

@ -1,7 +1,7 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.usecase.ValidatePort.ValidatePortError
import app.k9mail.feature.account.server.settings.domain.usecase.ValidatePort.ValidatePortError
import assertk.assertThat
import assertk.assertions.isInstanceOf
import assertk.assertions.prop

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import assertk.assertThat

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.domain.usecase
package app.k9mail.feature.account.server.settings.domain.usecase
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import assertk.assertThat

View file

@ -1,10 +1,10 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import app.k9mail.core.ui.compose.testing.ComposeTest
import app.k9mail.core.ui.compose.testing.setContent
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Effect
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.config.ui.incoming.fake.FakeAccountIncomingConfigViewModel
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Effect
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.incoming.fake.FakeAccountIncomingConfigViewModel
import assertk.assertThat
import assertk.assertions.isEqualTo
import kotlinx.coroutines.test.runTest

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import app.k9mail.feature.account.common.domain.entity.AuthenticationType
import app.k9mail.feature.account.common.domain.entity.ConnectionSecurity
@ -6,7 +6,7 @@ import app.k9mail.feature.account.common.domain.entity.IncomingProtocolType
import app.k9mail.feature.account.common.domain.entity.MailConnectionSecurity
import app.k9mail.feature.account.common.domain.input.NumberInputField
import app.k9mail.feature.account.common.domain.input.StringInputField
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.State
import assertk.assertThat
import assertk.assertions.isEqualTo
import com.fsck.k9.mail.AuthType

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import app.k9mail.feature.account.common.domain.entity.AuthenticationType
import app.k9mail.feature.account.common.domain.entity.ConnectionSecurity
@ -6,7 +6,7 @@ import app.k9mail.feature.account.common.domain.entity.IncomingProtocolType
import app.k9mail.feature.account.common.domain.entity.toImapDefaultPort
import app.k9mail.feature.account.common.domain.input.NumberInputField
import app.k9mail.feature.account.common.domain.input.StringInputField
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.State
import assertk.assertThat
import assertk.assertions.isEqualTo
import org.junit.Test

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.incoming
package app.k9mail.feature.account.server.settings.ui.incoming
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
@ -18,10 +18,10 @@ import app.k9mail.feature.account.common.domain.entity.toImapDefaultPort
import app.k9mail.feature.account.common.domain.entity.toPop3DefaultPort
import app.k9mail.feature.account.common.domain.input.NumberInputField
import app.k9mail.feature.account.common.domain.input.StringInputField
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Effect
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.Event
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.config.ui.incoming.fake.FakeAccountIncomingConfigValidator
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Effect
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.Event
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.incoming.fake.FakeAccountIncomingConfigValidator
import assertk.assertThat
import assertk.assertions.isEqualTo
import com.fsck.k9.mail.AuthType

View file

@ -1,10 +1,10 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
import app.k9mail.core.ui.compose.testing.ComposeTest
import app.k9mail.core.ui.compose.testing.setContent
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Effect
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.config.ui.outgoing.fake.FakeAccountOutgoingConfigViewModel
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Effect
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.outgoing.fake.FakeAccountOutgoingConfigViewModel
import assertk.assertThat
import assertk.assertions.isEqualTo
import kotlinx.coroutines.test.runTest

View file

@ -1,11 +1,11 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
import app.k9mail.feature.account.common.domain.entity.AuthenticationType
import app.k9mail.feature.account.common.domain.entity.ConnectionSecurity
import app.k9mail.feature.account.common.domain.entity.MailConnectionSecurity
import app.k9mail.feature.account.common.domain.input.NumberInputField
import app.k9mail.feature.account.common.domain.input.StringInputField
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.State
import assertk.assertThat
import assertk.assertions.isEqualTo
import com.fsck.k9.mail.AuthType

View file

@ -1,11 +1,11 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
import app.k9mail.feature.account.common.domain.entity.AuthenticationType
import app.k9mail.feature.account.common.domain.entity.ConnectionSecurity
import app.k9mail.feature.account.common.domain.entity.toSmtpDefaultPort
import app.k9mail.feature.account.common.domain.input.NumberInputField
import app.k9mail.feature.account.common.domain.input.StringInputField
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.State
import assertk.assertThat
import assertk.assertions.isEqualTo
import org.junit.Test

View file

@ -1,4 +1,4 @@
package app.k9mail.feature.account.server.config.ui.outgoing
package app.k9mail.feature.account.server.settings.ui.outgoing
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
@ -16,10 +16,10 @@ import app.k9mail.feature.account.common.domain.entity.MailConnectionSecurity
import app.k9mail.feature.account.common.domain.entity.toSmtpDefaultPort
import app.k9mail.feature.account.common.domain.input.NumberInputField
import app.k9mail.feature.account.common.domain.input.StringInputField
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Effect
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.Event
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.config.ui.outgoing.fake.FakeAccountOutgoingConfigValidator
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Effect
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.Event
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract.State
import app.k9mail.feature.account.server.settings.ui.outgoing.fake.FakeAccountOutgoingConfigValidator
import assertk.assertThat
import assertk.assertions.isEqualTo
import com.fsck.k9.mail.AuthType

View file

@ -29,7 +29,7 @@ dependencies {
api(projects.feature.account.common)
implementation(projects.feature.account.oauth)
implementation(projects.feature.account.server.config)
implementation(projects.feature.account.server.settings)
implementation(projects.feature.account.server.certificate)
api(projects.feature.account.server.validation)

View file

@ -4,7 +4,7 @@ import app.k9mail.autodiscovery.api.AutoDiscoveryService
import app.k9mail.autodiscovery.service.RealAutoDiscoveryService
import app.k9mail.feature.account.common.featureAccountCommonModule
import app.k9mail.feature.account.oauth.featureAccountOAuthModule
import app.k9mail.feature.account.server.config.featureAccountServerConfigModule
import app.k9mail.feature.account.server.settings.featureAccountServerConfigModule
import app.k9mail.feature.account.server.validation.featureAccountServerValidationModule
import app.k9mail.feature.account.setup.domain.DomainContract
import app.k9mail.feature.account.setup.domain.usecase.CreateAccount

View file

@ -3,12 +3,12 @@ package app.k9mail.feature.account.setup.ui
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.common.mvi.observe
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigScreen
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigViewModel
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigScreen
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigViewModel
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigScreen
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigViewModel
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigScreen
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigViewModel
import app.k9mail.feature.account.server.validation.KOIN_NAME_INCOMING_SERVER_VALIDATION
import app.k9mail.feature.account.server.validation.KOIN_NAME_OUTGOING_SERVER_VALIDATION
import app.k9mail.feature.account.server.validation.ui.ServerValidationContract

View file

@ -5,8 +5,8 @@ import app.k9mail.autodiscovery.api.SmtpServerSettings
import app.k9mail.feature.account.common.domain.entity.AccountState
import app.k9mail.feature.account.common.domain.input.NumberInputField
import app.k9mail.feature.account.common.domain.input.StringInputField
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.setup.domain.entity.toAuthenticationType
import app.k9mail.feature.account.setup.domain.entity.toConnectionSecurity
import app.k9mail.feature.account.setup.domain.entity.toIncomingProtocolType

View file

@ -1,9 +1,9 @@
package app.k9mail.feature.account.setup.ui.autodiscovery
import app.k9mail.core.common.domain.usecase.validation.ValidationResult
import app.k9mail.feature.account.server.config.domain.ServerConfigDomainContract
import app.k9mail.feature.account.server.config.domain.usecase.ValidateEmailAddress
import app.k9mail.feature.account.server.config.domain.usecase.ValidatePassword
import app.k9mail.feature.account.server.settings.domain.ServerConfigDomainContract
import app.k9mail.feature.account.server.settings.domain.usecase.ValidateEmailAddress
import app.k9mail.feature.account.server.settings.domain.usecase.ValidatePassword
import app.k9mail.feature.account.setup.domain.DomainContract.UseCase
import app.k9mail.feature.account.setup.domain.usecase.ValidateConfigurationApproval

View file

@ -8,7 +8,7 @@ import androidx.compose.ui.platform.LocalContext
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.ui.compose.designsystem.molecule.input.EmailAddressInput
import app.k9mail.feature.account.common.ui.item.ListItem
import app.k9mail.feature.account.server.config.ui.common.mapper.toResourceString
import app.k9mail.feature.account.server.settings.ui.common.mapper.toResourceString
@Composable
internal fun LazyItemScope.EmailAddressItem(

View file

@ -8,7 +8,7 @@ import androidx.compose.ui.platform.LocalContext
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.ui.compose.designsystem.molecule.input.PasswordInput
import app.k9mail.feature.account.common.ui.item.ListItem
import app.k9mail.feature.account.server.config.ui.common.mapper.toResourceString
import app.k9mail.feature.account.server.settings.ui.common.mapper.toResourceString
@Composable
internal fun LazyItemScope.PasswordItem(

View file

@ -5,8 +5,8 @@ import app.k9mail.core.common.oauth.OAuthConfigurationFactory
import app.k9mail.feature.account.common.domain.entity.AccountState
import app.k9mail.feature.account.oauth.ui.AccountOAuthContract
import app.k9mail.feature.account.server.certificate.ui.ServerCertificateErrorContract
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.server.validation.ui.ServerValidationContract
import app.k9mail.feature.account.setup.AccountSetupExternalContract.AccountCreator
import app.k9mail.feature.account.setup.AccountSetupExternalContract.AccountCreator.AccountCreatorResult

View file

@ -4,8 +4,8 @@ import app.k9mail.core.ui.compose.testing.ComposeTest
import app.k9mail.core.ui.compose.testing.onNodeWithTag
import app.k9mail.core.ui.compose.testing.setContent
import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.feature.account.server.config.ui.incoming.fake.FakeAccountIncomingConfigViewModel
import app.k9mail.feature.account.server.config.ui.outgoing.fake.FakeAccountOutgoingConfigViewModel
import app.k9mail.feature.account.server.settings.ui.incoming.fake.FakeAccountIncomingConfigViewModel
import app.k9mail.feature.account.server.settings.ui.outgoing.fake.FakeAccountOutgoingConfigViewModel
import app.k9mail.feature.account.server.validation.ui.fake.FakeServerValidationViewModel
import app.k9mail.feature.account.setup.ui.AccountSetupContract.Effect
import app.k9mail.feature.account.setup.ui.AccountSetupContract.SetupStep

View file

@ -10,8 +10,8 @@ import app.k9mail.feature.account.common.domain.entity.AuthenticationType
import app.k9mail.feature.account.common.domain.entity.IncomingProtocolType
import app.k9mail.feature.account.common.domain.input.NumberInputField
import app.k9mail.feature.account.common.domain.input.StringInputField
import app.k9mail.feature.account.server.config.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.config.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.server.settings.ui.incoming.AccountIncomingConfigContract
import app.k9mail.feature.account.server.settings.ui.outgoing.AccountOutgoingConfigContract
import app.k9mail.feature.account.setup.domain.entity.AutoDiscoveryAuthenticationType
import app.k9mail.feature.account.setup.domain.entity.AutoDiscoveryConnectionSecurity
import app.k9mail.feature.account.setup.domain.entity.toConnectionSecurity

View file

@ -48,7 +48,7 @@ include(
":feature:account:oauth",
":feature:account:setup",
":feature:account:server:certificate",
":feature:account:server:config",
":feature:account:server:settings",
":feature:account:server:validation",
)