Commit af2327c2d36234e00cdf2e218149accc2c4f190e

Authored by Amrita Vishnoi
2 parents d0c99d3c 12277ca5

Merge branch 'Bug_20433' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -411,56 +411,56 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
411 411 var split = url.split('?em:');
412 412 userInfo.emailId = split[1];
413 413 }
414   -
415 414 if (userInfo.newPassword != null) {
416 415  
417 416 if (userInfo.newPassword === userInfo.confirmPassword) {
418 417 $rootScope.passwordMismatchMessage = null;
419 418  
420   - AuthenticationService.ResetUserPassword(userInfo)
421   - .then(
422   - function (result) {
423   - if (result == LoginConstants.USER_NOT_FOUND) {
424   - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT);
425   - $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT;
426   - $("#messageModal").modal('show');
427   -
428   - }
429   - else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) {
430   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
431   - $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS;
432   - $("#messageModal").modal('show');
  419 + AuthenticationService.ResetUserPassword(userInfo)
  420 + .then(
  421 + function (result) {
  422 + if (result == LoginConstants.USER_NOT_FOUND) {
  423 + // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT);
  424 + $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT;
  425 + $("#messageModal").modal('show');
433 426  
434   - }
435   - else {
436   - //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) {
437   - if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) {
438   - // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE);
439   - $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE;
  427 + }
  428 + else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) {
  429 + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
  430 + $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS;
440 431 $("#messageModal").modal('show');
441   - $rootScope.isVisibleLogin = true;
442   - $rootScope.isVisibleResetPass = false;
443   - $location.url("/");
  432 +
444 433 }
445   - }
446   - },
447   - function (error) {
448   - console.log(' Error in authentication = ' + error.statusText);
449   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
450   - $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
451   - $("#messageModal").modal('show');
  434 + else {
  435 + //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) {
  436 + if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) {
  437 + // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE);
  438 + $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE;
  439 + $("#messageModal").modal('show');
  440 + $rootScope.isVisibleLogin = true;
  441 + $rootScope.isVisibleResetPass = false;
  442 + $location.url("/");
  443 + }
  444 + }
  445 + },
  446 + function (error) {
  447 + console.log(' Error in authentication = ' + error.statusText);
  448 + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
  449 + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
  450 + $("#messageModal").modal('show');
452 451  
453   - });
454   - }
455   - else {
456   - $rootScope.passwordMismatchMassage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH;
457   - //$("#messageModal").modal('show');
  452 + });
  453 + }
  454 + else {
  455 + $rootScope.errorMessage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH;
  456 + $("#messageModal").modal('show');
458 457 }
459 458 }
460 459 else {
461 460 $rootScope.errorMessage = LoginMessageConstants.NEW_PASSWORD_FIELD_IS_EMPTY;
462 461 $("#messageModal").modal('show');
463 462 }
  463 +
464 464 }
465 465  
466 466 $rootScope.lexiconLanguageArray = [];
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
... ... @@ -1115,9 +1115,10 @@
1115 1115 </tr>
1116 1116 <tr>
1117 1117 <td>
1118   - <input class="form-control" name="newPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.newPassword" ng-minlength="5" required>
  1118 + <input class="form-control" name="newPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.newPassword" ng-minlength="8" ng-maxlength="20" required>
1119 1119 <span style="color: maroon; font-weight:bold" ng-show="resetPasswordForm.newPassword.$touched && resetPasswordForm.newPassword.$invalid && resetPasswordForm.newPassword.$pristine">The password is required.</span>
1120   - <p ng-show="resetPasswordForm.newPassword.$error.minlength" style="font-weight: bold; color: maroon;">Password is too short.</p>
  1120 + <p ng-show="resetPasswordForm.newPassword.$error.minlength" style="font-weight: bold; color: maroon;">Password length must be between 8 - 20 characters.</p>
  1121 + <p ng-show="resetPasswordForm.newPassword.$error.maxlength" style="font-weight: bold; color: maroon;">Password length must be between 8 - 20 characters.</p>
1121 1122 </td>
1122 1123 </tr>
1123 1124 <tr>
... ... @@ -1131,7 +1132,7 @@
1131 1132 <td>
1132 1133 <input class="form-control" name="confirmPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.confirmPassword" required>
1133 1134 <span style="color: maroon; font-weight: bold; " ng-show="resetPasswordForm.confirmPassword.$touched && resetPasswordForm.confirmPassword.$invalid">Confirm password is required.</span>
1134   - <span style="color: maroon; font-weight: bold; " ng-if="passwordMismatchMessage">{{passwordMismatchMessage}}</span>
  1135 + <span style="color: maroon; font-weight: bold; " ng-if="resetPasswordForm.newPassword !== resetPasswordForm.confirmPassword">{{passwordMismatchMessage}}</span>
1135 1136 </td>
1136 1137 </tr>
1137 1138 <tr>
... ... @@ -1139,7 +1140,7 @@
1139 1140 </tr>
1140 1141 <tr>
1141 1142 <td>
1142   - <button type="submit" ng-click="ResetUserPassword(userInfo)" ng-submit="submitForm(resetPwdForm.$valid)" style="background: #0072a7; border: 1px solid #005076; cursor: pointer; color: #fff; padding: 5px 10px; font-size: 16px; text-transform: uppercase; text-align: center; text-decoration: none; font-family: gotham, 'Helvetica Neue', helvetica, arial, sans-serif; " id="btnUpdatePassword">Submit</button>
  1143 + <button type="submit" ng-disabled="resetPasswordForm.$invalid" ng-submit="submitForm(resetPasswordForm.$valid)" ng-click="ResetUserPassword(userInfo)" style="background: #0072a7; border: 1px solid #005076; cursor: pointer; color: #fff; padding: 5px 10px; font-size: 16px; text-transform: uppercase; text-align: center; text-decoration: none; font-family: gotham, 'Helvetica Neue', helvetica, arial, sans-serif; " id="btnUpdatePassword">Submit</button> <!--ng-submit="submitForm(resetPwdForm.$valid)"--> <!--ng-click="ResetUserPassword(userInfo)"-->
1143 1144 </td>
1144 1145 </tr>
1145 1146 </tbody>
... ...