Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fixed: Bug 1610190 #1081

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/modules/users/add-user/add-user.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="form-group">
<label class="col-sm-2 col-md-1 control-label" for="password">Password</label>
<div class="col-sm-8 col-md-6 inner-addon">
<input type="{{ addUserCntrl.typePassword ? 'text' : 'password' }}" data-id="password" aria-describedby="passwordStatus" name="password" ng-model="addUserCntrl.user.password" minlength="9" ng-maxlength="128" required/>
<input type="{{ addUserCntrl.typePassword ? 'text' : 'password' }}" data-id="password" aria-describedby="passwordStatus" name="password" ng-model="addUserCntrl.user.password" ng-minlength="9" ng-maxlength="128" required/>
<span id="passwordStatus" class="showPassword" ng-click="addUserCntrl.toggleTypePassword()">
<span ng-if="addUserCntrl.typePassword === true">
<i class="glyphicon glyphicon-eye-open" aria-hidden="true"></i>
Expand All @@ -57,7 +57,7 @@
<div class="form-group required">
<label class="col-sm-2 col-md-1 control-label cp-padding" for="password">Confirm Password</label>
<div class="col-sm-8 col-md-6 inner-addon">
<input type="{{ addUserCntrl.confirmPassword ? 'text' : 'password' }}" data-id="password" aria-describedby="passwordStatus" name="confirmPassword" ng-model="addUserCntrl.user.confirmPassword" minlength="9" ng-maxlength="128" required/>
<input type="{{ addUserCntrl.confirmPassword ? 'text' : 'password' }}" data-id="password" aria-describedby="passwordStatus" name="confirmPassword" ng-model="addUserCntrl.user.confirmPassword" ng-minlength="9" ng-maxlength="128" required/>
<span id="passwordStatus" class="showPassword" ng-click="addUserCntrl.toggleConfirmPassword()">
<span ng-if="addUserCntrl.confirmPassword === true">
<i class="glyphicon glyphicon-eye-open" aria-hidden="true"></i>
Expand Down
10 changes: 7 additions & 3 deletions src/modules/users/add-user/add-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,16 @@
} else if (form.username.$invalid) {
vm.errorMsg = "Please specify valid User Id.";
isFormValid = false;
} else if ((form.confirmPassword.$dirty && form.confirmPassword.$error.minlength) ||
(form.password.$dirty && form.password.$error.minlength)) {
vm.errorMsg = "Password should contain minimum 9 characters.";
isFormValid = false;
} else if ((form.confirmPassword.$dirty && form.confirmPassword.$error.maxlength) ||
(form.password.$dirty && form.password.$error.maxlength)) {
vm.errorMsg = "Password can contain maximum 128 characters."
vm.errorMsg = "Password can contain maximum 128 characters.";
isFormValid = false;
} else if (form.password.$invalid || form.confirmPassword.$invalid) {
vm.errorMsg = "Please specify valid Password."
vm.errorMsg = "Please specify valid Password.";
isFormValid = false;
} else if (!_isPasswordSame()) {
vm.errorMsg = "Password and Confirm Password doesn't match.";
Expand All @@ -118,4 +122,4 @@
}

}
})();
})();
4 changes: 2 additions & 2 deletions src/modules/users/edit-user/edit-user.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<div class="form-group">
<label class="col-sm-2 col-md-1 control-label cp-padding" for="password">New Password</label>
<div class="col-sm-8 col-md-6 inner-addon">
<input type="{{ editUserCntrl.typePassword ? 'text' : 'password' }}" data-id="password" name="password" ng-model="editUserCntrl.user.password" minlength="9" ng-maxlength="128"/>
<input type="{{ editUserCntrl.typePassword ? 'text' : 'password' }}" data-id="password" name="password" ng-model="editUserCntrl.user.password" ng-minlength="9" ng-maxlength="128"/>
<span id="passwordStatus" class="showPassword" ng-click="editUserCntrl.toggleTypePassword()">
<span ng-if="editUserCntrl.typePassword === true">
<i class="glyphicon glyphicon-eye-open" aria-hidden="true"></i>
Expand All @@ -56,7 +56,7 @@
<div class="form-group">
<label class="col-sm-2 col-md-1 control-label cp-padding" for="password">Confirm Password</label>
<div class="col-sm-8 col-md-6 inner-addon">
<input type="{{ editUserCntrl.confirmPassword ? 'text' : 'password' }}" data-id="password" aria-describedby="passwordStatus" name="confirmPassword" ng-model="editUserCntrl.user.confirmPassword" minlength="9" ng-maxlength="128">
<input type="{{ editUserCntrl.confirmPassword ? 'text' : 'password' }}" data-id="password" aria-describedby="passwordStatus" name="confirmPassword" ng-model="editUserCntrl.user.confirmPassword" ng-minlength="9" ng-maxlength="128">
<span id="passwordStatus" class="showPassword" ng-click="editUserCntrl.toggleConfirmPassword()">
<span ng-if="editUserCntrl.confirmPassword === true">
<i class="glyphicon glyphicon-eye-open" aria-hidden="true"></i>
Expand Down
6 changes: 5 additions & 1 deletion src/modules/users/edit-user/edit-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,13 @@
if (form.name.$invalid) {
vm.errorMsg = "Please specify valid Name."
isFormValid = false;
} else if((form.confirmPassword.$dirty && form.confirmPassword.$error.minlength) ||
(form.password.$dirty && form.password.$error.minlength) ) {
vm.errorMsg = "Password should contain minimum 9 characters.";
isFormValid = false;
} else if((form.confirmPassword.$dirty && form.confirmPassword.$error.maxlength) ||
(form.password.$dirty && form.password.$error.maxlength) ) {
vm.errorMsg = "Password can contain maximum 128 characters."
vm.errorMsg = "Password can contain maximum 128 characters.";
isFormValid = false;
} else if (!_isPasswordSame()) {
vm.errorMsg = "Password and Confirm Password doesn't match.";
Expand Down