# HG changeset patch
# User Prakash M <prakash@qualiantech.com>
# Date 1585663154 -19800
#      Tue Mar 31 19:29:14 2020 +0530
# Node ID 129a995f907aa780ece9a214d8a4382eb2981f21
# Parent  b4ee2649722cdb6ba105d9684ec7483a1f64b9e3
Fixed BUG-43372: Fixed following in Password Expiry
* Moved error message from footer to below header
* Displayed only error, removed error title

diff -r b4ee2649722c -r 129a995f907a web/org.openbravo.mobile.core/assets/css/obmobc-main.css
--- a/web/org.openbravo.mobile.core/assets/css/obmobc-main.css	Thu Apr 02 05:10:09 2020 +0000
+++ b/web/org.openbravo.mobile.core/assets/css/obmobc-main.css	Tue Mar 31 19:29:14 2020 +0530
@@ -4352,7 +4352,7 @@
 
 .obUiExpirationPassword-body-scroller {
   /* Inherits: [Scroller] */
-  max-height: 225px;
+  max-height: 325px;
   background-color: #ffffff;
   overflow-x: hidden;
 }
@@ -4361,6 +4361,10 @@
   padding-bottom: 20px;
 }
 
+.obUiExpirationPassword-scroller-newheader:empty {
+  display:none;	
+}
+
 .obUiExpirationPassword-scroller-attributes {}
 
 .obUiExpirationPassword-scroller-attributes .obUiFormElement_dataFilter.obUiFormElement {
@@ -4375,10 +4379,14 @@
   /* Inherits: [OB.UI.renderTextProperty] */
 }
 
-.obUiExpirationPassword-footer-error {
+.obUiExpirationPassword-scroller-error {
   color: var(--color-on-message_error);
 }
 
+.obUiExpirationPassword-scroller-error:empty {
+  display: none	
+}
+
 .obUiExpirationPassword-footer {}
 
 .obUiExpirationPassword-footer-expirationOkButton {}
diff -r b4ee2649722c -r 129a995f907a web/org.openbravo.mobile.core/source/component/dialog/ob-expirationpassword.js
--- a/web/org.openbravo.mobile.core/source/component/dialog/ob-expirationpassword.js	Thu Apr 02 05:10:09 2020 +0000
+++ b/web/org.openbravo.mobile.core/source/component/dialog/ob-expirationpassword.js	Tue Mar 31 19:29:14 2020 +0530
@@ -67,6 +67,11 @@
         classes: 'obUiExpirationPassword-scroller-newheader'
       },
       {
+        name: 'error',
+        content: '',
+        classes: 'obUiExpirationPassword-scroller-error'
+      },
+      {
         name: 'attributes',
         classes: 'obUiExpirationPassword-scroller-attributes'
       }
@@ -76,11 +81,6 @@
     classes: 'obUiModal-footer-mainButtons obUiExpirationPassword-footer',
     components: [
       {
-        name: 'error',
-        content: '',
-        classes: 'obUiExpirationPassword-footer-error'
-      },
-      {
         kind: 'OB.UI.ModalDialogButton',
         i18nContent: 'OBMOBC_LblCancel',
         classes: 'obUiExpirationPassword-footer-obUiModalDialogButton',
@@ -102,15 +102,18 @@
     var inputpassword = this.propertycomponents.password;
     var inputconfirmpassword = this.propertycomponents.confirmpassword;
     var messagenewheader = this.$.body.$.newheader;
-    this.$.footer.$.error.setContent('');
+    messagenewheader.setContent('');
+    this.$.body.$.error.setContent('');
     if (inputpassword.getValue() === '') {
-      messagenewheader.setContent(OB.I18N.getLabel('OBMOBC_EmptyPassword'));
+      this.$.body.$.error.setContent(OB.I18N.getLabel('OBMOBC_EmptyPassword'));
       OB.MobileApp.model.set('isLoggingIn', false);
       return;
     } else if (inputpassword.getValue() !== inputconfirmpassword.getValue()) {
       inputconfirmpassword.setValue('');
       inputpassword.setValue('');
-      messagenewheader.setContent(OB.I18N.getLabel('OBMOBC_DifferentPassword'));
+      this.$.body.$.error.setContent(
+        OB.I18N.getLabel('OBMOBC_DifferentPassword')
+      );
       OB.MobileApp.model.set('isLoggingIn', false);
       return;
     }
@@ -126,7 +129,7 @@
     return;
   },
   executeOnShow: function() {
-    this.$.footer.$.error.setContent('');
+    this.$.body.$.error.setContent('');
   },
   initComponents: function() {
     this.inherited(arguments);
diff -r b4ee2649722c -r 129a995f907a web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
--- a/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js	Thu Apr 02 05:10:09 2020 +0000
+++ b/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js	Tue Mar 31 19:29:14 2020 +0530
@@ -3125,12 +3125,13 @@
                 }
               );
               this.dialog.show();
-              this.dialog.$.body.$.newheader.setContent(
-                inResponse.messageTitle
-              );
 
               if (inResponse.attemptedChange) {
-                this.dialog.$.footer.$.error.setContent(inResponse.messageText);
+                this.dialog.$.body.$.error.setContent(inResponse.messageText);
+              } else {
+                this.dialog.$.body.$.newheader.setContent(
+                  inResponse.messageTitle
+                );
               }
 
               return;
