Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
NIFIREG-188: Login by hitting Enter in the input fields in web UI
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Villard <[email protected]>

This closes #147.
  • Loading branch information
kotarot authored and pvillard31 committed Sep 14, 2020
1 parent 0647389 commit 3739334
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<div fxLayout="column" fxLayoutAlign="space-between start" class="pad-bottom-md">
<div class="fill-available-width">
<mat-form-field floatLabel="always" fxFlex>
<input #usernameInput matInput floatPlaceholder="always" placeholder="Username">
<input #usernameInput matInput floatPlaceholder="always" placeholder="Username" (keyup.enter)="login(usernameInput, passwordInput)">
</mat-form-field>
</div>
<div class="fill-available-width">
<mat-form-field floatLabel="always" fxFlex>
<input #passwordInput type="password" matInput floatPlaceholder="always" placeholder="Password" autocomplete="off">
<input #passwordInput type="password" matInput floatPlaceholder="always" placeholder="Password" autocomplete="off" (keyup.enter)="login(usernameInput, passwordInput)">
</mat-form-field>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ NfRegistryUserLogin.prototype = {
* @param password The password.
*/
login: function (username, password) {
if (username.value.length === 0 || password.value.length === 0) {
return;
}
var self = this;
this.nfRegistryApi.postToLogin(username.value, password.value).subscribe(function (response) {
if (response || response.status === 200) {
Expand Down

0 comments on commit 3739334

Please sign in to comment.