Skip to content

Commit

Permalink
Implement check for account name existence in login dialog (#205)
Browse files Browse the repository at this point in the history
* Implement check for account name existence in login dialog

* Improve semantics of method name

* Refactor duplicate finding
  • Loading branch information
EightSQ authored and timgarrels committed Jun 6, 2019
1 parent aa8423c commit d689b20
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
helper
checkIfAccountnameUnused: aDictionary

" return false if account with same name exists "
ICHelper loadCredentialsIntoDictionaries
detect: [:credDict | (aDictionary at: 'name') = (credDict at: 'name')]
ifFound: [:credDict | self displayAccountnameExistsErrorMessage. ^false]
ifNone: [^true]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
toasts
displayAccountnameExistsErrorMessage

UserDialogBoxMorph inform: 'This account name already exists.' title: ''
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ login
dataDictionary := self makeDataDictionary.
(self checkForEmptyParameter: dataDictionary)
ifFalse: [^ self].
(self checkIfAccountnameUnused: dataDictionary)
ifFalse: [^ self].

((ICEndPoint new) testAccountWith: dataDictionary)
ifTrue: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
"changeInputField:" : "DH 7/25/2018 00:10",
"checkBoxColor" : "ms 7/13/2016 17:34",
"checkForEmptyParameter:" : "C.G. 7/25/2018 12:20",
"checkIfAccountnameUnused:" : "fr 6/6/2019 09:53",
"checkIfLastCharacterIsTab:" : "C.G. 7/25/2018 14:22",
"defaultBackgroundColor" : "C.G. 6/21/2018 00:28",
"dialogTitle" : "ms 6/14/2016 09:53",
"displayAccountnameExistsErrorMessage" : "ok 6/5/2019 21:04",
"displayEmptyFieldErrorMessage:" : "C.G. 7/25/2018 12:20",
"emptyParameterFrom:" : "C.G. 7/25/2018 12:18",
"endpoint" : "C.G. 7/25/2018 14:22",
Expand All @@ -33,7 +35,7 @@
"inputCollection:" : "C.G. 7/25/2018 14:23",
"keyEvent:" : "DH 7/25/2018 00:08",
"loadData:" : "C.G. 6/21/2018 10:58",
"login" : "tg 4/30/2019 11:43",
"login" : "ok 6/6/2019 09:36",
"loginMorph" : "C.G. 7/25/2018 14:24",
"loginMorph:" : "C.G. 7/25/2018 14:24",
"makeDataDictionary" : "C.G. 7/25/2018 12:16",
Expand Down

0 comments on commit d689b20

Please sign in to comment.