Added Preview when also TanMedia list gets displayed

This commit is contained in:
dankito 2024-08-28 18:23:27 +02:00
parent 9a38a85a4f
commit edd9598a72
1 changed files with 26 additions and 0 deletions

View File

@ -2,6 +2,8 @@ package net.codinux.banking.ui.dialogs
import androidx.compose.desktop.ui.tooling.preview.Preview import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import net.codinux.banking.client.model.BankAccountType
import net.codinux.banking.client.model.BankAccountViewInfo
import net.codinux.banking.client.model.BankingGroup import net.codinux.banking.client.model.BankingGroup
import net.codinux.banking.client.model.UserAccountViewInfo import net.codinux.banking.client.model.UserAccountViewInfo
import net.codinux.banking.client.model.tan.* import net.codinux.banking.client.model.tan.*
@ -31,3 +33,27 @@ fun EnterTanDialogPreview_TanImage() {
EnterTanDialog(TanChallengeReceived(tanChallenge) { }) { } EnterTanDialog(TanChallengeReceived(tanChallenge) { }) { }
} }
@Preview
@Composable
fun EnterTanDialogPreview_WithMultipleTanMedia() { // shows that dialog is really long if a TAN Image, select box for TAN Media, bank name, bank account, ... gets displayed
val tanImageBytes = "iVBORw0KGgoAAAANSUhEUgAAAJYAAACWAQAAAAAUekxPAAABZUlEQVR4Xs2WsY7DMAxDtfmXvVmbflnDAT6SSXDBdQsz1O4QvQKVQkp2Y3+sn/hPvo5lxKiMlXP1YmCy2rsKYFcPBS7LURthT+Ri8AJTnp1DwQts5xzAvd5g+/wwxU2Xp0weXevu20PGJVFZ89lDDoPfMSFD5ULNPZnDYXxxiEk4Z0QskzFCsWzLDrS5ajaY2hEhhIW+UzU7LDl4GBn00YLt6TI43eOK2ZYm200hGSNdj5bOBqPXuWhR8NQp5TXYltmDv8/yj5oNVhxoNWNyT9VsMHiOkuX20Zwmw3HNBuJXU9NjMtQcg5nYk3TeZXqmELhSsF22ZXfAdd4CeZxhBsMT5KTxmBs4xRwO48RgQ9dmhnIZV3FwYDx90nsYLHUHoFj1eP39Z3jIeC1BAIw1yj5zWCzZkJo+nhaHpiZTL1LXuM4cl8EqHdx5y/GQbdrOoV5ooz7Pjefs8Ajs0EAz47CP9fXsFzPY58fQF5StAAAAAElFTkSuQmCC"
val tanImage = TanImage("image/png", tanImageBytes)
val tanMethods = listOf(
TanMethod("chipTAN optisch", TanMethodType.ChipTanFlickercode, "911", 6, AllowedTanFormat.Numeric),
TanMethod("chipTAN-QR", TanMethodType.ChipTanQrCode, "913", 6, AllowedTanFormat.Numeric)
)
val tanMedia = listOf(
TanMedium(TanMediumType.TanGenerator, "SparkassenCard (Debitkarte)", TanMediumStatus.Available, TanGeneratorTanMedium("5678901234")),
TanMedium(TanMediumType.TanGenerator, "SparkassenCard (Debitkarte)", TanMediumStatus.Used, TanGeneratorTanMedium("5432109876"))
)
val user = UserAccountViewInfo("10010010", "Ihr krasser Login Name", "Eine ganz gewöhnliche Sparkasse", BankingGroup.Sparkasse)
val account = BankAccountViewInfo("12345678", null, BankAccountType.CheckingAccount, null, "Giro Konto")
val tanChallenge = TanChallenge(TanChallengeType.Image, ActionRequiringTan.GetTransactions, "Sie möchten eine \"Umsatzabfrage\" freigeben: Bitte bestätigen Sie den \"Startcode 80061030\" mit der Taste \"OK\".", "913", tanMethods, "SparkassenCard (Debitkarte)", tanMedia, tanImage, null, user, account)
EnterTanDialog(TanChallengeReceived(tanChallenge) { }) { }
}