Added message that changing the TAN medium is currently not implemented yet

This commit is contained in:
dankito 2024-09-26 04:13:08 +02:00
parent 4fbc52542d
commit 51fe6d621d
3 changed files with 34 additions and 7 deletions

View File

@ -20,8 +20,10 @@ import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime import kotlinx.datetime.toLocalDateTime
import net.codinux.banking.client.model.tan.* import net.codinux.banking.client.model.tan.*
import net.codinux.banking.ui.composables.BankIcon import net.codinux.banking.ui.composables.BankIcon
import net.codinux.banking.ui.config.Colors
import net.codinux.banking.ui.config.DI import net.codinux.banking.ui.config.DI
import net.codinux.banking.ui.config.Internationalization import net.codinux.banking.ui.config.Internationalization
import net.codinux.banking.ui.forms.CaptionText
import net.codinux.banking.ui.forms.OutlinedTextField import net.codinux.banking.ui.forms.OutlinedTextField
import net.codinux.banking.ui.forms.Select import net.codinux.banking.ui.forms.Select
import net.codinux.banking.ui.model.TanChallengeReceived import net.codinux.banking.ui.model.TanChallengeReceived
@ -45,6 +47,8 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () ->
val minTanImageHeight = 100 val minTanImageHeight = 100
val maxTanImageHeight = 500 val maxTanImageHeight = 500
var showSelectingTanMediumNotImplementedWarning by remember { mutableStateOf(false) }
val textFieldFocus = remember { FocusRequester() } val textFieldFocus = remember { FocusRequester() }
var enteredTan by remember { mutableStateOf("") } var enteredTan by remember { mutableStateOf("") }
@ -131,10 +135,14 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () ->
"TAN Medium", "TAN Medium",
challenge.availableTanMedia.sortedBy { it.status }.map { it.displayName }, challenge.availableTanMedia.sortedBy { it.status }.map { it.displayName },
challenge.selectedTanMedium?.displayName ?: "<Keines ausgewählt>", challenge.selectedTanMedium?.displayName ?: "<Keines ausgewählt>",
{ Log.info { "User selected TanMedium $it" } }, // TODO: change TanMethod { showSelectingTanMediumNotImplementedWarning = true }, // TODO: change TanMedium
{ it } { it }
) )
} }
if (showSelectingTanMediumNotImplementedWarning) {
CaptionText("Es tut uns Leid, aber das Ändern des TAN Mediums ist gegenwärtig noch nicht implementiert", Colors.DestructiveColor, Arrangement.Start)
}
} }

View File

@ -21,6 +21,7 @@ import net.codinux.banking.ui.composables.BankIcon
import net.codinux.banking.ui.config.Colors import net.codinux.banking.ui.config.Colors
import net.codinux.banking.ui.config.DI import net.codinux.banking.ui.config.DI
import net.codinux.banking.ui.forms.AutocompleteTextField import net.codinux.banking.ui.forms.AutocompleteTextField
import net.codinux.banking.ui.forms.CaptionText
import net.codinux.banking.ui.forms.OutlinedTextField import net.codinux.banking.ui.forms.OutlinedTextField
import net.codinux.banking.ui.forms.Select import net.codinux.banking.ui.forms.Select
import net.codinux.banking.ui.model.ShowTransferMoneyDialogData import net.codinux.banking.ui.model.ShowTransferMoneyDialogData
@ -238,12 +239,7 @@ fun TransferMoneyDialog(
} }
} }
Row(Modifier.fillMaxWidth().padding(top = 4.dp), horizontalArrangement = Arrangement.End) { CaptionText("${paymentReference.length} / 140")
Text(
text = "${paymentReference.length} / 140",
style = MaterialTheme.typography.caption
)
}
Row(Modifier.padding(top = verticalSpace), verticalAlignment = Alignment.CenterVertically) { Row(Modifier.padding(top = verticalSpace), verticalAlignment = Alignment.CenterVertically) {

View File

@ -0,0 +1,23 @@
package net.codinux.banking.ui.forms
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
@Composable
fun CaptionText(text: String, color: Color = Color.Unspecified, horizontalArrangement: Arrangement.Horizontal = Arrangement.End) {
Row(Modifier.fillMaxWidth().padding(top = 4.dp), horizontalArrangement = horizontalArrangement) {
Text(
text = text,
style = MaterialTheme.typography.caption,
color = color
)
}
}