Commit d88fa2c9ce4ce1763f543cdfd393c64340649c9f

Authored by Amrita Vishnoi
2 parents 9beb762c 65c11490

Merge branch 'Bug_17182' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -68,7 +68,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
68 68 $rootScope.shapestyleFillBorderColor = "black";
69 69 $rootScope.shapestyleborderWidth = 2;
70 70 $rootScope.shapestyleborderStyles = "solid";
71   - $rootScope.errorMassage = '';
  71 + //$rootScope.errorMessage = ''; // Commented initialization to retain message when coming to login after password reset success screen
72 72 $rootScope.disableFileMenu = "disableFileMenu";
73 73  
74 74 $rootScope.userInfo = {
... ... @@ -82,7 +82,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
82 82 };
83 83 $rootScope.userData;
84 84 $rootScope.userModules;
85   - $rootScope.errorMesaage;
  85 + $rootScope.passwordMismatchMessage;
86 86 $rootScope.isVisibleLogin;
87 87 $rootScope.haveRoleAdmin;
88 88 var isfilloptionChecked = "";
... ... @@ -111,7 +111,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
111 111 if (userInfo.username == "" || userInfo.username == null || userInfo.password == "" || userInfo.password == null) {
112 112  
113 113 // alert(LoginMessageConstants.USER_CREDENTIALS_MISSING);
114   - $rootScope.errorMassage = LoginMessageConstants.USER_CREDENTIALS_MISSING;
  114 + $rootScope.errorMessage = LoginMessageConstants.USER_CREDENTIALS_MISSING;
115 115 $("#messageModal").modal('show');
116 116 }
117 117 else {
... ... @@ -128,14 +128,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
128 128 if (result == LoginConstants.USER_NOT_FOUND) {
129 129 $rootScope.isVisibleLogin = true;
130 130 // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT);
131   - $rootScope.errorMassage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT;
  131 + $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT;
132 132 $("#messageModal").modal('show');
133 133  
134 134 }
135 135 else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) {
136 136 //alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
137 137 $rootScope.isVisibleLogin = true;
138   - $rootScope.errorMassage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
  138 + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
139 139 $("#messageModal").modal('show');
140 140 }
141 141 else {
... ... @@ -167,7 +167,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
167 167 console.log(' Error in authentication = ' + error.statusText);
168 168 // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
169 169 $rootScope.isVisibleLogin = true;
170   - $rootScope.errorMassage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
  170 + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
171 171 $("#messageModal").modal('show');
172 172 });
173 173 }
... ... @@ -226,17 +226,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
226 226 .then(function (result) {
227 227 if (result == LoginConstants.USER_NOT_FOUND) {
228 228 // alert(LoginMessageConstants.INCORRECT_EMAIL_ID);
229   - $rootScope.errorMassage = LoginMessageConstants.INCORRECT_EMAIL_ID;
  229 + $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID;
230 230 $("#messageModal").modal('show');
231 231 }
232 232 else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) {
233 233 // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
234   - $rootScope.errorMassage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
  234 + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
235 235 $("#messageModal").modal('show');
236 236 }
237 237 else if (result == LoginConstants.MAIL_NOT_SENT) {
238 238 // alert(LoginMessageConstants.MAIL_NOT_SENT);
239   - $rootScope.errorMassage = LoginMessageConstants.MAIL_NOT_SENT;
  239 + $rootScope.errorMessage = LoginMessageConstants.MAIL_NOT_SENT;
240 240 $("#messageModal").modal('show');
241 241 }
242 242 else {
... ... @@ -255,7 +255,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
255 255 else
256 256 message = LoginMessageConstants.USERID_SENT_IN_EMAIL
257 257 //alert(message);
258   - $rootScope.errorMassage = message;
  258 + $rootScope.errorMessage = message;
259 259 $("#messageModal").modal('show');
260 260  
261 261  
... ... @@ -266,19 +266,19 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
266 266 function (error) {
267 267 console.log(' Error in authentication = ' + error.statusText);
268 268 // alert(LoginConstants.ERROR_IN_FECTHING_DETAILS);
269   - $rootScope.errorMassage = LoginConstants.ERROR_IN_FECTHING_DETAILS;
  269 + $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS;
270 270 $("#messageModal").modal('show');
271 271 });
272 272 }
273 273 else {
274 274 // alert(LoginMessageConstants.INCORRECT_EMAIL_ID);
275   - $rootScope.errorMassage = LoginMessageConstants.INCORRECT_EMAIL_ID;
  275 + $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID;
276 276 $("#messageModal").modal('show');
277 277 }
278 278 }
279 279 else {
280 280 //alert(LoginMessageConstants.BLANK_EMAIL_ID);
281   - $rootScope.errorMassage = LoginMessageConstants.BLANK_EMAIL_ID;
  281 + $rootScope.errorMessage = LoginMessageConstants.BLANK_EMAIL_ID;
282 282 $("#messageModal").modal('show');
283 283  
284 284 }
... ... @@ -299,28 +299,30 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
299 299 userInfo.emailId = split[1];
300 300 }
301 301  
302   - if (userInfo.newPassword === userInfo.confirmPassword) {
303   - $rootScope.errorMesaage = null;
  302 + if (userInfo.newPassword != null) {
  303 +
  304 + if (userInfo.newPassword === userInfo.confirmPassword) {
  305 + $rootScope.passwordMismatchMessage = null;
304 306  
305 307 AuthenticationService.ResetUserPassword(userInfo)
306 308 .then(
307 309 function (result) {
308 310 if (result == LoginConstants.USER_NOT_FOUND) {
309 311 // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT);
310   - $rootScope.errorMassage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT;
  312 + $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT;
311 313 $("#messageModal").modal('show');
312 314  
313 315 }
314 316 else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) {
315 317 // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
316   - $rootScope.errorMassage = LoginConstants.ERROR_IN_FECTHING_DETAILS;
  318 + $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS;
317 319 $("#messageModal").modal('show');
318 320  
319 321 }
320 322 else {
321 323 if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) {
322 324 // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE);
323   - $rootScope.errorMassage = LoginMessageConstants.PASSWORD_RESET_MESSAGE;
  325 + $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE;
324 326 $("#messageModal").modal('show');
325 327 $rootScope.isVisibleLogin = true;
326 328 $rootScope.isVisibleResetPass = false;
... ... @@ -331,13 +333,18 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
331 333 function (error) {
332 334 console.log(' Error in authentication = ' + error.statusText);
333 335 // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
334   - $rootScope.errorMassage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
  336 + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
335 337 $("#messageModal").modal('show');
336 338  
337 339 });
338 340 }
339 341 else {
340   - $rootScope.errorMesaage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH;
  342 + $rootScope.passwordMismatchMassage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH;
  343 + //$("#messageModal").modal('show');
  344 + }
  345 + }
  346 + else {
  347 + $rootScope.errorMessage = LoginMessageConstants.NEW_PASSWORD_FIELD_IS_EMPTY;
341 348 $("#messageModal").modal('show');
342 349 }
343 350 }
... ... @@ -3639,7 +3646,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3639 3646 AdminService.SendAdminAccessRequestMail(userInfo)
3640 3647 .then(function (result) {
3641 3648 if (result == AdminConstants.MAIL_SENT) {
3642   - $rootScope.errorMassage = AdminConstants.MAIL_SENT_SUCCESS_MESSAGE;
  3649 + $rootScope.errorMessage = AdminConstants.MAIL_SENT_SUCCESS_MESSAGE;
3643 3650 $("#messageModal").modal('show');
3644 3651 }
3645 3652 $("#adminModal").fadeOut();
... ... @@ -3648,7 +3655,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3648 3655 },
3649 3656 function (error) {
3650 3657 console.log(' Error in sending mail to admin support = ' + error.statusText);
3651   - $rootScope.errorMassage = AdminConstants.ERROR_IN_SENDING_MAIL;
  3658 + $rootScope.errorMessage = AdminConstants.ERROR_IN_SENDING_MAIL;
3652 3659 $("#messageModal").modal('show');
3653 3660 });
3654 3661 };
... ...
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
... ... @@ -306,6 +306,7 @@ AIA.constant("LoginMessageConstants", {
306 306 "NEW_AND_OLD_PASSWORD_DONOT_MATCH": "Your new password and confirm password not matched!",
307 307 "USER_CREDENTIALS_MISSING": "Please Enter your credentials.",
308 308 "USER_NOT_FOUND": "User not found.",
  309 + "NEW_PASSWORD_FIELD_IS_EMPTY": "Please enter new password to reset your password."
309 310 //"ERROR_IN_FECTHING_DETAILS": "Error in fecthing details.",
310 311 //"MAIL_NOT_SENT": "Mail not sent."
311 312  
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
... ... @@ -1128,7 +1128,7 @@
1128 1128 <td>
1129 1129 <input class="form-control" name="confirmPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.confirmPassword" required>
1130 1130 <span style="color: maroon; font-weight: bold; " ng-show="resetPasswordForm.confirmPassword.$touched && resetPasswordForm.confirmPassword.$invalid">Confirm password is required.</span>
1131   - <span style="color: maroon; font-weight: bold; " ng-if="errorMesaage">{{errorMesaage}}</span>
  1131 + <span style="color: maroon; font-weight: bold; " ng-if="passwordMismatchMessage">{{passwordMismatchMessage}}</span>
1132 1132 </td>
1133 1133 </tr>
1134 1134 <tr>
... ... @@ -1157,7 +1157,7 @@
1157 1157 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1158 1158 </div>
1159 1159 <div class="modal-title"></div>
1160   - <div class="modal-body">{{errorMassage}}</div>
  1160 + <div class="modal-body">{{errorMessage}}</div>
1161 1161 <div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">OK</button></div>
1162 1162 </div>
1163 1163 </div>
... ...