From edd9598a7200cdacb141c3c550035dc93fd2d164 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 28 Aug 2024 18:23:27 +0200 Subject: [PATCH] Added Preview when also TanMedia list gets displayed --- .../ui/dialogs/EnterTanDialogPreview.kt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/composeApp/src/desktopMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialogPreview.kt b/composeApp/src/desktopMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialogPreview.kt index e4ab417..cfdb579 100644 --- a/composeApp/src/desktopMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialogPreview.kt +++ b/composeApp/src/desktopMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialogPreview.kt @@ -2,6 +2,8 @@ package net.codinux.banking.ui.dialogs import androidx.compose.desktop.ui.tooling.preview.Preview 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.UserAccountViewInfo import net.codinux.banking.client.model.tan.* @@ -29,5 +31,29 @@ fun EnterTanDialogPreview_TanImage() { val tanChallenge = TanChallenge(TanChallengeType.Image, ActionRequiringTan.GetAccountInfo, "Geben Sie die TAN ein", tanMethod.identifier, listOf(tanMethod), null, emptyList(), tanImage, null, user) + 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) { }) { } } \ No newline at end of file