From a5145b0da73870f2867b9de39c7bb742931e8c44 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 24 Jun 2020 22:13:41 +0200 Subject: [PATCH] Implemented displaying bank name instead of bank code in AddAccountDialog --- .../dankito/banking/bankfinder/InMemoryBankFinder.kt | 2 +- .../banking/ui/android/dialogs/AddAccountDialog.kt | 10 +++++----- .../src/main/res/layout/dialog_add_account.xml | 4 ++-- .../src/main/res/values-de/strings.xml | 2 +- ui/BankingAndroidApp/src/main/res/values/strings.xml | 2 +- .../src/main/resources/Messages.properties | 2 +- .../src/main/resources/Messages_de.properties | 2 +- .../banking/ui/javafx/dialogs/AddAccountDialog.kt | 10 +++++----- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tools/BankFinder/src/main/kotlin/net/dankito/banking/bankfinder/InMemoryBankFinder.kt b/tools/BankFinder/src/main/kotlin/net/dankito/banking/bankfinder/InMemoryBankFinder.kt index a1063f5e..c57bcf1f 100644 --- a/tools/BankFinder/src/main/kotlin/net/dankito/banking/bankfinder/InMemoryBankFinder.kt +++ b/tools/BankFinder/src/main/kotlin/net/dankito/banking/bankfinder/InMemoryBankFinder.kt @@ -20,7 +20,7 @@ open class InMemoryBankFinder() : BankFinderBase(), IBankFinder { } override fun findBankByNameOrCityForNonEmptyQuery(query: String): List { - val queryPartsLowerCase = query.toLowerCase().split(" ") + val queryPartsLowerCase = query.toLowerCase().split(" ", "-") return getBankList().filter { bankInfo -> checkIfAllQueryPartsMatchBankNameOrCity(queryPartsLowerCase, bankInfo) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt index c47de7a9..efc9e3fa 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt @@ -74,7 +74,7 @@ open class AddAccountDialog : DialogFragment() { rootView.edtxtCustomerId.addTextChangedListener(otherEditTextChangedWatcher) rootView.edtxtPin.addTextChangedListener(otherEditTextChangedWatcher) - addAccountIfEnterPressed(rootView.edtxtBankCode) + addAccountIfEnterPressed(rootView.edtxtBank) addAccountIfEnterPressed(rootView.edtxtCustomerId) addAccountIfEnterPressed(rootView.edtxtPin) @@ -88,7 +88,7 @@ open class AddAccountDialog : DialogFragment() { true } - Autocomplete.on(rootView.edtxtBankCode) + Autocomplete.on(rootView.edtxtBank) .with(6f) .with(ColorDrawable(Color.WHITE)) .with(autocompleteCallback) @@ -190,7 +190,7 @@ open class AddAccountDialog : DialogFragment() { protected open fun bankSelected(bank: BankInfo) { selectedBank = bank - edtxtBankCode.setText(bank.bankCode) + edtxtBank.setText(bank.name) edtxtCustomerId.requestFocus() @@ -215,8 +215,8 @@ open class AddAccountDialog : DialogFragment() { protected open fun checkIfRequiredDataEnteredOnUiThread() { val requiredDataEntered = selectedBank != null && selectedBank?.supportsFinTs3_0 == true - && edtxtCustomerId.text.toString().isNotEmpty() // TODO: check if it is of length 10? - && edtxtPin.text.toString().isNotEmpty() // TODO: check if it is of length 5? + && edtxtCustomerId.text.toString().isNotEmpty() + && edtxtPin.text.toString().isNotEmpty() btnAddAccount.isEnabled = requiredDataEntered } diff --git a/ui/BankingAndroidApp/src/main/res/layout/dialog_add_account.xml b/ui/BankingAndroidApp/src/main/res/layout/dialog_add_account.xml index c5d31097..a6e406b3 100644 --- a/ui/BankingAndroidApp/src/main/res/layout/dialog_add_account.xml +++ b/ui/BankingAndroidApp/src/main/res/layout/dialog_add_account.xml @@ -10,11 +10,11 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/dialog_add_account_field_bottom_margin" - android:hint="@string/dialog_add_account_enter_bank_code" + android:hint="@string/dialog_add_account_enter_bank" > Kontoumsätze für \'%1$s\' konnten nicht empfangen werden.\n\nFehlermeldung Ihrer Bank:\n\n%2$s Neue Überweisung an %s - Bankleitzahl (Suche auch mittels Bankname oder Ort): + Bank (Suche auch mittels Bankleitzahl oder Ort): Geben Sie hier die selben Werte ein wie auf Ihrer Online Banking Webseite: Onlinebanking Login Name: Onlinebanking Passwort: diff --git a/ui/BankingAndroidApp/src/main/res/values/strings.xml b/ui/BankingAndroidApp/src/main/res/values/strings.xml index 7ed31ec6..098d6303 100644 --- a/ui/BankingAndroidApp/src/main/res/values/strings.xml +++ b/ui/BankingAndroidApp/src/main/res/values/strings.xml @@ -32,7 +32,7 @@ Could not retrieve account transactions for \'%1$s\'.\n\nError message from your bank:\n\n%2$s Transfer money to %s - Bank code (find also by bank name or city): + Bank (find also by bank code or city): Enter the same values here as in your online banking portal Online banking login name: Online banking password: diff --git a/ui/BankingJavaFxApp/src/main/resources/Messages.properties b/ui/BankingJavaFxApp/src/main/resources/Messages.properties index a1fee08a..9140ef85 100755 --- a/ui/BankingJavaFxApp/src/main/resources/Messages.properties +++ b/ui/BankingJavaFxApp/src/main/resources/Messages.properties @@ -35,7 +35,7 @@ account.transactions.table.context.menu.show.transaction.details=Show details add.account.dialog.title=Add account -add.account.dialog.bank.code.label=Bank code +add.account.dialog.bank.label=Bank (search also by bank code or city) add.account.dialog.customer.id.and.password.hint=Enter the same values here as in your online banking portal add.account.dialog.customer.id=Customer Id (Account number) add.account.dialog.customer.id.hint=The user name you use for logging in into online banking diff --git a/ui/BankingJavaFxApp/src/main/resources/Messages_de.properties b/ui/BankingJavaFxApp/src/main/resources/Messages_de.properties index 627e56cf..90ce6211 100755 --- a/ui/BankingJavaFxApp/src/main/resources/Messages_de.properties +++ b/ui/BankingJavaFxApp/src/main/resources/Messages_de.properties @@ -35,7 +35,7 @@ account.transactions.table.context.menu.show.transaction.details=Details anzeige add.account.dialog.title=Konto hinzufügen -add.account.dialog.bank.code.label=Bankleitzahl +add.account.dialog.bank.label=Bank (Suche auch mittels Bankleitzahl oder Ort) add.account.dialog.customer.id.and.password.hint=Geben Sie hier die selben Werte ein wie auf Ihrer Online Banking Webseite add.account.dialog.customer.id=Kundennummer (Kontonummer) add.account.dialog.customer.id.hint=Der Nutzernamen den Sie fürs Online Banking verwenden diff --git a/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt b/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt index 72e45e0d..f04d4e15 100755 --- a/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt +++ b/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt @@ -43,7 +43,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window( protected val dialogService = JavaFxDialogService() - protected val bankCode = SimpleStringProperty("") + protected val bankName = SimpleStringProperty("") protected var txtfldBankCode: AutoCompletionSearchTextField by singleAssign() @@ -67,7 +67,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window( init { - bankCode.addListener { _, _, newValue -> searchBanks(newValue) } + bankName.addListener { _, _, newValue -> searchBanks(newValue) } customerId.addListener { _, _, _ -> checkIfRequiredDataHasBeenEntered() } @@ -78,13 +78,13 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window( override val root = vbox { prefWidth = 350.0 - label(messages["add.account.dialog.bank.code.label"]) { + label(messages["add.account.dialog.bank.label"]) { vboxConstraints { margin = LabelMargins } } - txtfldBankCode = autocompletionsearchtextfield(bankCode) { + txtfldBankCode = autocompletionsearchtextfield(bankName) { prefHeight = TextFieldHeight onAutoCompletion = { bankSelected(it) } @@ -213,7 +213,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window( selectedBank = bank - bankCode.value = bank.bankCode + bankName.value = bank.name checkIfRequiredDataHasBeenEntered()