Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027415Retail ModulesWeb POSpublic2014-08-22 10:192015-03-06 16:57
Orekaria 
aaroncalero 
normalmajoralways
closedfixed 
5
 
RR15Q2RR15Q2 
marvintm
No
0027415: Stabilization: alert("") should never be used
It stops the javascript heap
The browser alert is not shown in the screenshots
The test logic to detect when one is present is almost a hack. Also, the tests cannot access the content of the alert
Is also not seen when in a hangout call
In the WebPOS login page
Try to login with wrong credentials

Verify that an alert is shown
in ob-login.js change this code:

    var params;
    OB.UTIL.showLoggingOut(false);
    OB.MobileApp.model.on('loginfail', function (status, data) {
      var msg;
      if (data && data.messageTitle) {
        msg = data.messageTitle;
      }

      if (data && data.messageText) {
        msg += (msg ? '\n' : '') + data.messageText;
      }
      msg = msg || 'Invalid user name or password.\nPlease try again.';
      alert(msg);
      if (this.$.password) {
        this.$.password.setValue('');
      }
      if (this.$.username) {
        this.$.username.focus();
      }
    }, this);

for this one:

OB.MobileApp.model.on('loginfail', function (status, data) {
      var me = this;
      var msgTittle = 'Error';
      var msgText = 'Invalid user name or password. Please try again.';
      if (data && data.messageTitle) {
        msgTittle = data.messageTitle;
      }
      if (data && data.messageText) {
        msgText = data.messageText;
      }
      OB.UTIL.showConfirmation.display(msgTittle, msgText, [{
        label: 'OK',
        isConfirmButton: true,
        action: function () {
          if (me.$.password) {
            me.$.password.setValue('');
          }
          OB.MobileApp.model.navigate('login');
        }
      }], {
        onHideFunction: function () {
          if (me.$.password) {
            me.$.password.setValue('');
          }
          OB.MobileApp.model.navigate('login');
        }
      });
    }, this);
No tags attached.
has duplicate design defect 0022172 closed adrianromero Information messages must be consolidated (javascript alerts) 
has duplicate design defect 0021087 closed adrianromero Different application messages formats 
blocks feature request 0027329 new Retail Stabilization: Overhaul the loading process (since the url is entered until the webpos has loaded) 
blocks feature request 0026771RR14Q3 closed Orekaria TestCases. Work in progress 
blocks feature request 0028933RR16Q1 closed Retail QA: RR15Q2: Add tests for Mobile applications 
diff issue-27415-posterminal.diff (4,040) 2014-12-17 10:59
https://issues.openbravo.com/file_download.php?file_id=7601&type=bug
diff issue-27415-mobile-core.diff (7,794) 2014-12-17 11:01
https://issues.openbravo.com/file_download.php?file_id=7602&type=bug
Issue History
2014-08-22 10:19OrekariaNew Issue
2014-08-22 10:19OrekariaAssigned To => Orekaria
2014-08-22 10:19OrekariaTriggers an Emergency Pack => No
2014-08-22 10:19OrekariaRelationship addedblocks 0027329
2014-08-22 10:20OrekariaRelationship addedblocks 0026771
2014-09-14 17:05OrekariaTarget VersionRR14Q4 => RR15Q1
2014-09-14 17:07OrekariaProposed Solution updated
2014-12-08 11:51mtaalTarget VersionRR15Q1 => RR15Q2
2014-12-16 23:27mtaalRelationship addedhas duplicate 0022172
2014-12-16 23:33hgbotCheckin
2014-12-16 23:33hgbotNote Added: 0072584
2014-12-17 10:57hgbotCheckin
2014-12-17 10:57hgbotNote Added: 0072604
2014-12-17 10:59mtaalFile Added: issue-27415-posterminal.diff
2014-12-17 11:01mtaalFile Added: issue-27415-mobile-core.diff
2014-12-17 12:46mtaalRelationship addedhas duplicate 0021087
2015-02-03 17:35aaroncaleroAssigned ToOrekaria => aaroncalero
2015-02-03 17:38hgbotCheckin
2015-02-03 17:38hgbotNote Added: 0074042
2015-02-03 17:43hgbotCheckin
2015-02-03 17:43hgbotNote Added: 0074044
2015-02-03 17:43hgbotStatusnew => resolved
2015-02-03 17:43hgbotResolutionopen => fixed
2015-02-03 17:43hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/7df040939eecdaefb786784b64a2a3af9c638c35 [^]
2015-02-06 19:20hgbotCheckin
2015-02-06 19:20hgbotNote Added: 0074263
2015-02-26 17:32dmitry_mezentsevNote Added: 0074979
2015-03-06 15:41marvintmReview Assigned To => marvintm
2015-03-06 15:41marvintmStatusresolved => closed
2015-03-06 15:41marvintmFixed in Version => RR15Q2
2015-03-06 16:55OrekariaRelationship addedblocks 0028933
2015-03-06 16:57OrekariaNote Added: 0075259
2015-03-06 16:57OrekariaNote Edited: 0075259bug_revision_view_page.php?bugnote_id=0075259#r7890

Notes
(0072584)
hgbot   
2014-12-16 23:33   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 469ce9f2de73f1418bc0551c00aef06cae645578
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Dec 16 23:33:00 2014 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/469ce9f2de73f1418bc0551c00aef06cae645578 [^]

Related to issue 27415: Stabilization: alert("") should never be used
Changed alert to OB.Utils call, changed message, export database made slight change in order of foreign key definitions

---
M src-db/database/model/modifiedTables/AD_ORG.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0072604)
hgbot   
2014-12-17 10:57   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 410f7d5aadfc83c325bcfa829548c9590d0a1019
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Dec 17 10:56:49 2014 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/410f7d5aadfc83c325bcfa829548c9590d0a1019 [^]

Related to issue 27415: Stabilization: alert("") should never be used, backout
Backout of changeset, will be moved/done in Q2

---
M src-db/database/model/modifiedTables/AD_ORG.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0074042)
hgbot   
2015-02-03 17:38   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 369babc96d637224784a31e6d62b2fd3aae3e5b5
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Tue Feb 03 17:36:44 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/369babc96d637224784a31e6d62b2fd3aae3e5b5 [^]

Related to issue 27415: Stabilization: alert() should never be used

Changed alerts to OB.Utils calls and changed message

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0074044)
hgbot   
2015-02-03 17:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 7df040939eecdaefb786784b64a2a3af9c638c35
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Tue Feb 03 17:28:48 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/7df040939eecdaefb786784b64a2a3af9c638c35 [^]

Fixed issue 27415: Stabilization: alert() should never be used

Changed alerts to OB.UTIL calls
Added message to replace static text
Removal of whitespaces done by the JSBeautifier

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M web/org.openbravo.mobile.core/source/component/ob-login.js
M web/org.openbravo.mobile.core/source/component/obpos-approval.js
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0074263)
hgbot   
2015-02-06 19:20   
Repository: tools/automation/pi-mobile
Changeset: d664bafdc2d9b180c1061fb9482962ecfa7050fd
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Fri Feb 06 17:52:41 2015 +0100
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/d664bafdc2d9b180c1061fb9482962ecfa7050fd [^]

Related to issue 27415: Added test 'LoginWithWrongCredentialsNonSecureNoAlert'
- added annotation for version compatibility

---
M src-test/org/openbravo/test/mobile/common/selenium/javascript/TestId.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/AllLoginoutTests.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/LoginWithWrongCredentialsNonSecure.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/LoginWithWrongCredentialsNonSecureNoAlert.java
---
(0074979)
dmitry_mezentsev   
2015-02-26 17:32   
Guys,
Not closed for 23 days!
(0075259)
Orekaria   
2015-03-06 16:57   
Suggestion: create a test that searches for the 'alert' keyword in the javascript generated file