Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit 73a7c2c

Browse files
hyperrealitymleanos
authored andcommitted
feat(core): Minor UI fixes for mobile; autofocus (#1499)
* Added configuration for owasp. Synchronize client owap configs with the server configs. Also added a time indicator on failed login attempts to give the user feedback on subsequent failed login attempts. * switched to handlebar template for passing the server's owasp config down to the client. reverted some of the other changes (regarding the http request). * Removed debug code. * Changed variable name to owaspConfig * Fixed minor type-o's and set owasp.config() rather than the underlying configs. * chore(tidy): tidying up minor lint and layout issues * fix(lint): CSS alphabetize warnings (#1498) Fixes css lintings warnings of properties not alphabetized. * fix(authentication) Stops error on signin/signup (#1495) Uses the passport info object to simplify login and remove the need to temporarily cache the redirect within the session. * Moved owasp config into default and reverted other config files. Modified config to be "shared". This will allow future configurations to be easily passed to the client. * fixed 403 redirect if not signed in (#1496) * Update form-article.client.view.html For New Article, delete function no required * UI changes for mobile; autofocus * fixed broken password popover balloon * add e2e test for autofocus * Remove test, fix delete social login button * feat(core): Move template to .github folder * Deprecated $http success/error promise methods (#1508) Replaces the $http service calls with promise based methods of the client-side UsersService for the following: Users Change Password Users Manage Social Accounts Users Password Forgot Users Password Reset Users Signup Users Signin Modifies tests to reflect changes. Closes #1479 * rebase
1 parent f0867c2 commit 73a7c2c

File tree

12 files changed

+42
-14
lines changed

12 files changed

+42
-14
lines changed

modules/chat/client/views/chat.client.view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1>Chat Example</h1>
77
<form class="col-xs-12 col-md-offset-4 col-md-4" ng-submit="vm.sendMessage();">
88
<fieldset class="row">
99
<div class="input-group">
10-
<input type="text" id="messageText" name="messageText" class="form-control" ng-model="vm.messageText" placeholder="Enter new message">
10+
<input type="text" id="messageText" name="messageText" class="form-control" ng-model="vm.messageText" placeholder="Enter new message" autofocus>
1111
<span class="input-group-btn">
1212
<button type="submit" class="btn btn-primary" ng-disabled="!vm.messageText.length">Submit</button>
1313
</span>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
(function () {
2+
'use strict';
3+
4+
// Focus the element on page load
5+
// Unless the user is on a small device, because this could obscure the page with a keyboard
6+
7+
angular.module('core')
8+
.directive('autofocus', autofocus);
9+
10+
autofocus.$inject = ['$timeout', '$window'];
11+
12+
function autofocus($timeout, $window) {
13+
var directive = {
14+
restrict: 'A',
15+
link: link
16+
};
17+
18+
return directive;
19+
20+
function link(scope, element, attrs) {
21+
if ($window.innerWidth >= 800) {
22+
$timeout(function() {
23+
element[0].focus();
24+
}, 100);
25+
}
26+
}
27+
}
28+
}());
336 Bytes
Loading
-757 Bytes
Loading
745 Bytes
Loading
323 Bytes
Loading
696 Bytes
Loading
198 Bytes
Loading

modules/users/client/views/authentication/signin.client.view.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ <h3 class="col-xs-12 text-center">Or with your account</h3>
44
<form name="vm.userForm" ng-submit="vm.signin(vm.userForm.$valid)" class="signin" novalidate autocomplete="off">
55
<fieldset>
66
<div class="form-group" show-errors>
7+
<uib-alert type="danger" ng-show="vm.error" class="text-center text-danger">
8+
<span ng-bind="vm.error"></span>
9+
</uib-alert>
710
<label for="username">Username</label>
8-
<input type="text" id="username" name="username" class="form-control" ng-model="vm.credentials.username" placeholder="Username" lowercase required>
11+
<input type="text" id="username" name="username" class="form-control" ng-model="vm.credentials.username" placeholder="Username" lowercase required autofocus>
912
<div ng-messages="vm.userForm.username.$error" role="alert">
1013
<p class="help-block error-text" ng-message="required">Username is required.</p>
1114
</div>
@@ -25,12 +28,7 @@ <h3 class="col-xs-12 text-center">Or with your account</h3>
2528
<div class="text-center forgot-password">
2629
<a ui-sref="password.forgot">Forgot your password?</a>
2730
</div>
28-
<p>
29-
&nbsp;
30-
</p>
31-
<uib-alert type="danger" ng-show="vm.error" class="text-center text-danger">
32-
<span ng-bind="vm.error"></span>
33-
</uib-alert>
31+
<br />
3432
</fieldset>
3533
</form>
3634
</div>

modules/users/client/views/authentication/signup.client.view.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ <h3 class="col-xs-12 text-center">Or sign up using your email</h3>
55
<fieldset>
66
<div class="form-group" show-errors>
77
<label for="firstName">First Name</label>
8-
<input type="text" id="firstName" name="firstName" class="form-control" ng-model="vm.credentials.firstName" placeholder="First Name" required>
8+
<input type="text" id="firstName" name="firstName" class="form-control" ng-model="vm.credentials.firstName" placeholder="First Name" required autofocus>
99
<div ng-messages="vm.userForm.firstName.$error" role="alert">
1010
<p class="help-block error-text" ng-message="required">First name is required.</p>
1111
</div>
@@ -34,7 +34,7 @@ <h3 class="col-xs-12 text-center">Or sign up using your email</h3>
3434
</div>
3535
<div class="form-group" show-errors>
3636
<label for="password">Password</label>
37-
<input type="password" id="password" name="password" class="form-control" ng-model="vm.credentials.password" placeholder="Password" uib-popover="{{vm.getPopoverMsg()}}" uib-popover-trigger="focus" password-validator required>
37+
<input type="password" id="password" name="password" class="form-control" ng-model="vm.credentials.password" placeholder="Password" uib-popover="{{vm.getPopoverMsg()}}" popover-trigger="outsideClick" password-validator required>
3838
<div ng-messages="vm.userForm.password.$error" role="alert">
3939
<p class="help-block error-text" ng-message="required">Password is required.</p>
4040
<div ng-repeat="passwordError in passwordErrors">

0 commit comments

Comments
 (0)