Removed savePassword option again

This commit is contained in:
dankito 2020-11-06 01:32:49 +01:00
parent 883a64ce91
commit 30f564a886
13 changed files with 12 additions and 43 deletions

View File

@ -120,7 +120,7 @@ open class AddAccountDialog : DialogFragment() {
btnAddAccount.isEnabled = false
pgrbrAddAccount.visibility = View.VISIBLE
presenter.addAccountAsync(selectedBank, userName, password, bankCredentialsPassword.savePassword) { response ->
presenter.addAccountAsync(selectedBank, userName, password) { response ->
context?.asActivity()?.runOnUiThread {
btnAddAccount.isEnabled = true
pgrbrAddAccount.visibility = View.GONE

View File

@ -63,7 +63,6 @@ open class BankSettingsDialog : SettingsDialogBase() {
edtxtBankName.text = bank.displayName
edtxtUserName.text = bank.userName
bankCredentialsPassword.password = bank.password
bankCredentialsPassword.savePassword = bank.savePassword
val tanMethodItems = createTanMethodItems()
val tanMethodsAdapter = FastAdapterRecyclerView(rootView.rcyTanMethods, tanMethodItems)
@ -127,13 +126,12 @@ open class BankSettingsDialog : SettingsDialogBase() {
get() = didChange(edtxtBankName, bank.displayName)
|| didChange(edtxtUserName, bank.userName)
|| bankCredentialsPassword.password != bank.password
|| bankCredentialsPassword.savePassword != bank.savePassword
|| bank.selectedTanMethod != selectedTanMethod
override fun saveChanges() {
bank.userSetDisplayName = edtxtBankName.text
presenter.bankUpdated(bank, edtxtUserName.text, bankCredentialsPassword.password, bankCredentialsPassword.savePassword, selectedTanMethod)
presenter.bankUpdated(bank, edtxtUserName.text, bankCredentialsPassword.password, selectedTanMethod)
}
protected open fun askUserToDeleteAccount() {

View File

@ -38,10 +38,4 @@ open class BankCredentialsPasswordView @JvmOverloads constructor(
open val passwordBox: TextInputEditText
get() = textInputEditText
open var savePassword: Boolean
get() = swtchSavePassword.isChecked
set(value) {
swtchSavePassword.isChecked = value
}
}

View File

@ -17,12 +17,4 @@
android:inputType="textPassword"
/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swtchSavePassword"
style="@style/FormSwitchStyle"
android:text="@string/online_banking_credentials_save_password"
android:checked="true"
android:enabled="false"
/>
</LinearLayout>

View File

@ -24,7 +24,6 @@
<string name="online_banking_credentials_section_title">Online-Banking Zugangsdaten</string>
<string name="online_banking_credentials_login_name">Login Name</string>
<string name="online_banking_credentials_password">Passwort</string>
<string name="online_banking_credentials_save_password">Password speichern (kommt noch)</string>
<string name="accounts">Konten</string>
<string name="bank_credentials">Bankzugänge</string>

View File

@ -24,7 +24,6 @@
<string name="online_banking_credentials_section_title">Online banking login data</string>
<string name="online_banking_credentials_login_name">Login name</string>
<string name="online_banking_credentials_password">Password</string>
<string name="online_banking_credentials_save_password">Save password (to be implemented)</string>
<string name="accounts">Accounts</string>
<string name="bank_credentials">Bank credentials</string>

View File

@ -243,7 +243,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
isEnteredCredentialsResultVisible.value = false
selectedBank?.let {
presenter.addAccountAsync(it, userName.value, password.value, true) { response ->
presenter.addAccountAsync(it, userName.value, password.value) { response ->
runLater { handleAddAccountResultOnUiThread(response) }
}
}

View File

@ -174,9 +174,8 @@ open class BankingPresenter(
// TODO: move BankInfo out of fints4k
open fun addAccountAsync(bankInfo: BankInfo, userName: String, password: String, savePassword: Boolean = true, callback: (AddAccountResponse) -> Unit) {
open fun addAccountAsync(bankInfo: BankInfo, userName: String, password: String, callback: (AddAccountResponse) -> Unit) {
val bank = modelCreator.createBank(bankInfo.bankCode, userName, password, bankInfo.pinTanAddress ?: "", bankInfo.name, bankInfo.bic, "")
bank.savePassword = savePassword
val newClient = getBankingClientCreatorForBank(bank).createClient(bank, dataFolder, asyncRunner, this.callback)
@ -527,14 +526,13 @@ open class BankingPresenter(
callBanksChangedListeners()
}
open fun bankUpdated(bank: TypedBankData, enteredUsername: String, enteredPassword: String, savePassword: Boolean, selectedTanMethod: TanMethod?) {
val didCredentialsChange = bank.userName != enteredUsername || bank.password != enteredPassword || bank.savePassword != savePassword
open fun bankUpdated(bank: TypedBankData, enteredUsername: String, enteredPassword: String, selectedTanMethod: TanMethod?) {
val didCredentialsChange = bank.userName != enteredUsername || bank.password != enteredPassword
val didSelectedTanMethodChange = bank.selectedTanMethod != selectedTanMethod
if (didCredentialsChange) {
bank.userName = enteredUsername
bank.password = enteredPassword
bank.savePassword = savePassword
if (bank.wrongCredentialsEntered) {
bank.wrongCredentialsEntered = false // so that on next call its accounts are considered and so it gets checked if credentials are now correct

View File

@ -78,7 +78,6 @@
"Enter Online banking login name" = "Enter login name";
"Online banking login password" = "Password";
"Enter Online banking login password" = "Enter password";
"Save online banking login password" = "Save password (to be implemented)";
"Could not add account" = "Could not add account";
"Error message from your bank %@" = "Error message from your bank:\n\n%@";

View File

@ -78,7 +78,6 @@
"Enter Online banking login name" = "Login Name eingeben";
"Online banking login password" = "Passwort";
"Enter Online banking login password" = "Passwort eingeben";
"Save online banking login password" = "Password speichern (kommt noch)";
"Could not add account" = "Konto konnte nicht hinzugefügt werden.";
"Error message from your bank %@" = "Fehlermeldung Ihrer Bank:\n\n%@";

View File

@ -9,7 +9,6 @@ struct AddAccountDialog: View {
@State private var userName = ""
@State private var password = ""
@State private var savePassword: Bool = true
@State private var focusLoginNameTextField: Bool = false
@ -46,7 +45,7 @@ struct AddAccountDialog: View {
LabelledUIKitTextField(label: "Online banking login name", text: $userName, placeholder: "Enter Online banking login name", autocapitalizationType: .none,
focusNextTextFieldOnReturnKeyPress: true, focusTextField: focusLoginNameTextField, actionOnReturnKeyPress: handleReturnKeyPress)
BankCredentialsPasswordView($password, $savePassword, handleReturnKeyPress)
BankCredentialsPasswordView($password, handleReturnKeyPress)
}
Section {
@ -96,7 +95,7 @@ struct AddAccountDialog: View {
isTryingToAddAccount = true
UIApplication.hideKeyboard()
presenter.addAccountAsync(bankInfo: bank, userName: userName, password: password, savePassword: savePassword) { (response) in
presenter.addAccountAsync(bankInfo: bank, userName: userName, password: password) { (response) in
self.handleAddAccountResponse(response)
}
}

View File

@ -16,7 +16,6 @@ struct BankSettingsDialog: View {
@State private var userName: String
@State private var password: String
@State private var savePassword: Bool
@State private var selectedTanMethod: TanMethod?
@ -40,7 +39,6 @@ struct BankSettingsDialog: View {
_userName = State(initialValue: bank.userName)
_password = State(initialValue: bank.password)
_savePassword = State(initialValue: bank.savePassword)
_selectedTanMethod = State(initialValue: bank.selectedTanMethod)
@ -58,7 +56,7 @@ struct BankSettingsDialog: View {
LabelledUIKitTextField(label: "Online banking login name", text: $userName, autocapitalizationType: .none)
BankCredentialsPasswordView($password, $savePassword)
BankCredentialsPasswordView($password)
}
Section {
@ -133,7 +131,7 @@ struct BankSettingsDialog: View {
if hasUnsavedData {
bank.userSetDisplayName = displayName
presenter.bankUpdated(bank: bank, enteredUsername: userName, enteredPassword: password, savePassword: savePassword, selectedTanMethod: selectedTanMethod)
presenter.bankUpdated(bank: bank, enteredUsername: userName, enteredPassword: password, selectedTanMethod: selectedTanMethod)
}
closeDialog()

View File

@ -5,14 +5,11 @@ struct BankCredentialsPasswordView: View {
@Binding private var password: String
@Binding private var savePassword: Bool
private var handleReturnKeyPress: (() -> Bool)? = nil
init(_ password: Binding<String>, _ showPassword: Binding<Bool>, _ handleReturnKeyPress: (() -> Bool)? = nil) {
init(_ password: Binding<String>, _ handleReturnKeyPress: (() -> Bool)? = nil) {
self._password = password
self._savePassword = showPassword
self.handleReturnKeyPress = handleReturnKeyPress
}
@ -21,9 +18,6 @@ struct BankCredentialsPasswordView: View {
var body: some View {
LabelledUIKitTextField(label: "Online banking login password", text: $password, placeholder: "Enter Online banking login password",
autocapitalizationType: .none, isPasswordField: true, actionOnReturnKeyPress: handleReturnKeyPress)
Toggle("Save online banking login password", isOn: $savePassword)
.disabled(true)
}
}
@ -32,7 +26,7 @@ struct BankCredentialsPasswordView: View {
struct BankCredentialsPasswordView_Previews: PreviewProvider {
static var previews: some View {
BankCredentialsPasswordView(.constant(""), .constant(true))
BankCredentialsPasswordView(.constant(""))
}
}