Attached Files | mobile-core.diff [^] (21,731 bytes) 2019-02-19 11:51 [Show Content] [Hide Content]diff --git a/src/org/openbravo/mobile/core/login/Context.java b/src/org/openbravo/mobile/core/login/Context.java
--- a/src/org/openbravo/mobile/core/login/Context.java
+++ b/src/org/openbravo/mobile/core/login/Context.java
@@ -1,6 +1,6 @@
/*
************************************************************************************
- * Copyright (C) 2012-2018 Openbravo S.L.U.
+ * Copyright (C) 2012-2019 Openbravo S.L.U.
* Licensed under the Openbravo Commercial License version 1.0
* You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
* or in the legal folder of this module distribution.
@@ -87,10 +87,10 @@
final JSONRowConverter converter = new JSONRowConverter(DataResolvingMode.FULL);
JSONArray data = new JSONArray();
- String hqlUser = "select u as user, r as role, org as organization, cli as client "
- + "from ADUser u, ADRole r, Organization org, ADClient cli " + "where u.id = :userId "
- + " and u.active = true " + " and r.id = :roleId " + " and org.id = :orgId "
- + " and cli.id = :clientId ";
+ String hqlUser = "select u as user, r as role, org as organization, cli as client, img.bindaryData as img "
+ + "from ADUser u left outer join u.image img, ADRole r, Organization org, ADClient cli "
+ + "where u.id = :userId " + " and u.active = true " + " and r.id = :roleId "
+ + " and org.id = :orgId " + " and cli.id = :clientId ";
Query<Object[]> qryUser = OBDal.getInstance().getSession().createQuery(hqlUser, Object[].class);
qryUser.setParameter("userId", OBContext.getOBContext().getUser().getId());
@@ -105,6 +105,7 @@
item.put("role", converter.convert(qryUserObjectItem[1]));
item.put("organization", converter.convert(qryUserObjectItem[2]));
item.put("client", converter.convert(qryUserObjectItem[3]));
+ item.put("userImgData", converter.convert(qryUserObjectItem[4]));
data.put(item);
}
return data;
diff --git a/src/org/openbravo/mobile/core/login/MobileCoreLoginUtilsServlet.java b/src/org/openbravo/mobile/core/login/MobileCoreLoginUtilsServlet.java
--- a/src/org/openbravo/mobile/core/login/MobileCoreLoginUtilsServlet.java
+++ b/src/org/openbravo/mobile/core/login/MobileCoreLoginUtilsServlet.java
@@ -1,6 +1,6 @@
/*
************************************************************************************
- * Copyright (C) 2012-2018 Openbravo S.L.U.
+ * Copyright (C) 2012-2019 Openbravo S.L.U.
* Licensed under the Openbravo Commercial License version 1.0
* You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
* or in the legal folder of this module distribution.
@@ -43,13 +43,11 @@
import org.openbravo.mobile.core.MobileServerDefinition;
import org.openbravo.mobile.core.MobileServerService;
import org.openbravo.mobile.core.MobileServiceDefinition;
-import org.openbravo.mobile.core.process.JSONRowConverter;
import org.openbravo.mobile.core.process.WebServiceAbstractServlet;
import org.openbravo.mobile.core.servercontroller.MobileServerController;
import org.openbravo.mobile.core.servercontroller.MobileServerUtils;
import org.openbravo.mobile.core.utils.OBMOBCUtils;
import org.openbravo.model.ad.system.ClientInformation;
-import org.openbravo.service.json.DataResolvingMode;
import org.openbravo.service.json.JsonConstants;
import org.openbravo.service.json.JsonUtils;
@@ -95,7 +93,6 @@
MobileServerUtils.setTemporaryCORSHeaders(request, response);
result.put("exception", "invalidRequestOrigin");
}
-
} else if (command.equals("companyLogo")) {
result = getCompanyLogo(request);
} else if (command.equals("userImages")) {
@@ -104,8 +101,6 @@
result = preLogin(request);
} else if (command.equals("initActions")) {
result = initActions(request);
- } else if (command.equals("currentUserImage")) {
- result = getCurrentUserImage(request);
}
writeResult(response, result.toString());
@@ -159,29 +154,6 @@
return result;
}
- protected JSONObject getCurrentUserImage(HttpServletRequest request) throws JSONException {
- JSONObject result = new JSONObject();
- final JSONRowConverter converter = new JSONRowConverter(DataResolvingMode.FULL);
- JSONArray data = new JSONArray();
-
- String hqlUser = "select u.id as user, img.bindaryData as img "
- + "from ADUser u left outer join u.image img " + "where u.id = :userId "
- + " and u.active = true ";
-
- Query<Object[]> qryUser = OBDal.getInstance().getSession().createQuery(hqlUser, Object[].class);
- qryUser.setParameter("userId", OBContext.getOBContext().getUser().getId());
- final Object[] qryUserObjectItem = qryUser.uniqueResult();
-
- JSONObject item = new JSONObject();
- item.put("user", converter.convert(qryUserObjectItem[0]));
- item.put("img", converter.convert(qryUserObjectItem[1]));
- data.put(item);
-
- result.put("data", data);
-
- return result;
- }
-
protected JSONObject getUserImages(HttpServletRequest request) throws JSONException {
String formId = defaultsHandler.getDefaults(request.getParameter("appName")).getFormId();
diff --git a/web/org.openbravo.mobile.core/assets/css/ob-standard.css b/web/org.openbravo.mobile.core/assets/css/ob-standard.css
--- a/web/org.openbravo.mobile.core/assets/css/ob-standard.css
+++ b/web/org.openbravo.mobile.core/assets/css/ob-standard.css
@@ -1591,7 +1591,7 @@
}
.offlineicon {
- background: url('./../img/iconOffline.svg');
+ background-image: url('./../img/iconOffline.svg');
background-size: 15px 15px;
}
@@ -1601,26 +1601,89 @@
}
.menu-connection {
- padding-left: 15px;
background-repeat: no-repeat;
background-position: 11px 14px;
+}
+
+.menu-connection-icon {
+ width: 20px;
+ height: 20px;
+ background-repeat: no-repeat;
+ position: relative;
+ left: 40px;
+ top: 40px;
+}
+
+.menu-item-profile-user {
+ padding: 12px 5px 12px 12px;
+ height: 50px;
+}
+
+.menu-item-profile-user-image-content {
+ width: 50px;
+ float: left;
+}
+
+.menu-item-profile-user-image {
+ width: 50px;
+ border-radius: 50%;
+}
+
+.menu-item-profile-user-content {
+ width: 100px;
+ float: left;
+ padding-left: 5px;
+ padding-top: 5px;
+}
+
+.menu-item-profile-user-name {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+.menu-item-profile-user-connected {
font-style: italic;
+ margin-top: 5px
}
.widget-profile-title {
- height: 40px;
+ height: 60px;
background-color: #FFF899;
margin: -6px;
- background-repeat: no-repeat;
- background-position: 18px 22px;
- font-style: italic;
- padding-top: 20px;
+}
+
+.widget-profile-title-image {
+ float: left;
+ width: 55px;
+ margin: 6px 0px 0px 6px;
+}
+
+.widget-profile-title-content {
+ float: left;
+ line-height: 150%;
+}
+
+.widget-profile-title-content-outer {
+ margin: 6px 0px 0px 0px;
+}
+
+.widget-profile-title-item {
+ float: left;
+ margin: 0px 0px 0px 5px;
}
.widget-profile-title-connection {
padding-left: 40px;
}
+.widget-profile-dialog-connection {
+ font-style: italic;
+ padding-left: 28px;
+ background-repeat: no-repeat;
+ background-position: 5px 4px;
+}
+
/* Popup.css */
div.popup-processing {
box-shadow: none;
diff --git a/web/org.openbravo.mobile.core/source/component/dialog/ob-profile.js b/web/org.openbravo.mobile.core/source/component/dialog/ob-profile.js
--- a/web/org.openbravo.mobile.core/source/component/dialog/ob-profile.js
+++ b/web/org.openbravo.mobile.core/source/component/dialog/ob-profile.js
@@ -1,6 +1,6 @@
/*
************************************************************************************
- * Copyright (C) 2012-2017 Openbravo S.L.U.
+ * Copyright (C) 2012-2019 Openbravo S.L.U.
* Licensed under the Openbravo Commercial License version 1.0
* You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
* or in the legal folder of this module distribution.
@@ -425,12 +425,32 @@
kind: 'OB.UI.Popup',
classes: 'modal',
components: [{
- classes: 'widget-profile-title widget-profile-title-connection',
- name: 'connStatus'
+ name: 'userWidget',
+ kind: 'OB.UI.Profile.UserWidget'
}, {
style: 'height: 5px;'
}, {
kind: 'OB.UI.MenuAction',
+ i18nLabel: 'OBMOBC_Profile',
+ name: 'profileButton',
+ tap: function () {
+ this.owner.hide(); // Manual dropdown menu closure
+ var proc, profileHandler = OB.MobileApp.model.get('profileHandlerUrl') || 'org.openbravo.mobile.core.login.ProfileUtils';
+ proc = new OB.DS.Process(profileHandler);
+
+ OB.UTIL.showLoading(true);
+ proc.exec({}, enyo.bind(this, function (response) {
+ if (response.exception) {
+ // we are offline...
+ OB.UTIL.showLoading(false);
+ return;
+ }
+ OB.UTIL.showLoading(false);
+ OB.MobileApp.view.$.dialogsContainer.$.profileDialog.show(response);
+ }));
+ }
+ }, {
+ kind: 'OB.UI.MenuAction',
name: 'lockOption',
allowHtml: true,
tap: function () {
@@ -474,16 +494,19 @@
style: 'height: 5px;'
}],
- setConnectionStatus: function () {
- var connected = OB.MobileApp.model.get('connectedToERP');
- this.$.connStatus.setContent(OB.I18N.getLabel(connected ? 'OBMOBC_Online' : 'OBMOBC_Offline'));
- this.$.connStatus.addRemoveClass('onlineicon', connected);
- this.$.connStatus.addRemoveClass('offlineicon', !connected);
- },
-
executeOnShow: function () {
this.$.lockOption.setLabel(OB.I18N.getLabel('OBMOBC_LogoutDialogLock') + '<span style="padding-left:190px">0\u21B5</span>');
this.$.endSessionButton.setLabel(OB.I18N.getLabel('OBMOBC_EndSession'));
+ // Set user image
+ var ctx = OB.MobileApp.model.get('context');
+ if (ctx) {
+ if (ctx.userImgData) {
+ this.$.userWidget.setUserImg(ctx.userImgData);
+ }
+ this.$.userWidget.setUserName(ctx.user._identifier);
+ this.$.userWidget.setUserRole(ctx.role._identifier);
+ }
+ this.$.profileButton.setShowing(OB.MobileApp.model.hasPermission('OBMOBC_ChangeProfile'));
},
initComponents: function () {
@@ -491,85 +514,9 @@
this.$.lockOption.setShowing(OB.MobileApp.model.get('supportsOffline'));
OB.MobileApp.model.on('change:connectedToERP', function () {
- this.setConnectionStatus();
+ this.$.userWidget.setConnectionStatus();
}, this);
- this.setConnectionStatus();
-
- }
-});
-
-enyo.kind({
- name: 'OB.UI.Profile.UserInfo',
- kind: 'OB.UI.Popup',
- classes: 'modal',
- components: [{
- name: 'userWidget',
- kind: 'OB.UI.Profile.UserWidget'
- }, {
- style: 'height: 5px;'
- }, {
- kind: 'OB.UI.MenuAction',
- i18nLabel: 'OBMOBC_Profile',
- name: 'profileButton',
- tap: function () {
- this.owner.hide(); // Manual dropdown menu closure
- var proc, profileHandler = OB.MobileApp.model.get('profileHandlerUrl') || 'org.openbravo.mobile.core.login.ProfileUtils';
- proc = new OB.DS.Process(profileHandler);
-
- OB.UTIL.showLoading(true);
- proc.exec({}, enyo.bind(this, function (response) {
- if (response.exception) {
- // we are offline...
- OB.UTIL.showLoading(false);
- return;
- }
- OB.UTIL.showLoading(false);
- OB.MobileApp.view.$.dialogsContainer.$.profileDialog.show(response);
- }));
- }
- }],
-
- show: function () {
- enyo.$.scrim.show();
- this.args = arguments;
- var me = this;
- var params = OB.MobileApp.model.get('loginUtilsParams') || {};
- params.appName = OB.MobileApp.model.get('appName');
-
- params.command = 'currentUserImage';
-
- var rr, ajaxRequest = new OB.OBPOSLogin.UI.LoginRequest({
- url: OB.MobileApp.model.get('loginUtilsUrl'),
- timeout: 10000,
- data: params,
- success: function (inSender, inResponse) {
- me.$.userWidget.setUserImg(inResponse.data[0].img);
- me.$.profileButton.setShowing(OB.MobileApp.model.hasPermission('OBMOBC_ChangeProfile'));
- me.inherited(me.args);
- },
- fail: function (inSender, inResponde) {
- me.$.userWidget.setUserImg(undefined);
- me.$.profileButton.setShowing(OB.MobileApp.model.hasPermission('OBMOBC_ChangeProfile'));
- me.inherited(me.args);
- }
- });
-
- rr = new OB.RR.Request({
- ajaxRequest: ajaxRequest
- });
- rr.exec(ajaxRequest.url);
- },
-
- initComponents: function () {
- this.inherited(arguments);
- OB.MobileApp.model.on('change:context', function () {
- var ctx = OB.MobileApp.model.get('context');
- if (!ctx) {
- return;
- }
- this.$.userWidget.setUserName(ctx.user._identifier);
- this.$.userWidget.setUserRole(ctx.role._identifier);
- }, this);
+ this.$.userWidget.setConnectionStatus();
}
});
@@ -582,46 +529,36 @@
userImg: ''
},
components: [{
- //style: 'height: 60px; background-color: #FFF899;',
- classes: 'widget-profile-title ',
+ classes: 'widget-profile-title',
components: [{
- style: 'float: left; width: 55px; margin: -15px 0px 0px 6px;',
+ classes: 'widget-profile-title-image',
components: [{
kind: 'OB.UI.Thumbnail',
'default': '../org.openbravo.mobile.core/assets/img/anonymous-icon.png',
name: 'img'
}]
}, {
- style: 'float: left; margin: 6px 0px 0px 0px; line-height: 150%;',
+ classes: 'widget-profile-title-content widget-profile-title-content-outer',
components: [{
- components: [{
- components: [{
- tag: 'span',
- style: 'font-weight: 800; margin: 0px 0px 0px 5px;',
- name: 'username'
- }]
- }]
- }]
- }, {
- style: 'float: left; margin: 6px 0px 0px 0px; line-height: 150%;',
- components: [{
+ style: 'widget-profile-title-content',
components: [{
+ style: 'height: 25px;',
components: [{
+ classes: 'widget-profile-title-item',
tag: 'span',
- style: 'font-weight: 800; margin: 0px 0px 0px 5px;',
+ name: 'username'
+ }, {
+ classes: 'widget-profile-title-item',
+ tag: 'span',
content: '-'
- }]
- }]
- }]
- }, {
- style: 'float: left; margin: 6px 0px 0px 0px; line-height: 150%;',
- components: [{
- components: [{
- components: [{
+ }, {
+ classes: 'widget-profile-title-item',
tag: 'span',
- style: 'font-weight: 800; margin: 0px 0px 0px 5px;',
name: 'role'
}]
+ }, {
+ classes: 'widget-profile-dialog-connection',
+ name: 'connStatus'
}]
}]
}]
@@ -637,5 +574,13 @@
userImgChanged: function () {
this.$.img.setImg(this.userImg);
+ },
+
+ setConnectionStatus: function () {
+ var connected = OB.MobileApp.model.get('connectedToERP');
+ this.$.connStatus.setContent(OB.I18N.getLabel(connected ? 'OBMOBC_Online' : 'OBMOBC_Offline'));
+ this.$.connStatus.addRemoveClass('onlineicon', connected);
+ this.$.connStatus.addRemoveClass('offlineicon', !connected);
}
+
});
\ No newline at end of file
diff --git a/web/org.openbravo.mobile.core/source/component/ob-menu.js b/web/org.openbravo.mobile.core/source/component/ob-menu.js
--- a/web/org.openbravo.mobile.core/source/component/ob-menu.js
+++ b/web/org.openbravo.mobile.core/source/component/ob-menu.js
@@ -1,6 +1,6 @@
/*
************************************************************************************
- * Copyright (C) 2013-2018 Openbravo S.L.U.
+ * Copyright (C) 2013-2019 Openbravo S.L.U.
* Licensed under the Openbravo Commercial License version 1.0
* You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
* or in the legal folder of this module distribution.
@@ -356,7 +356,7 @@
kind: 'OB.UI.MenuAction',
style: 'padding-top: 3px;',
i18nLabel: 'OBMOBC_PendingSynchronization',
- classes: 'menu-connection ',
+ classes: 'menu-connection',
modelsToSynchObject: new Backbone.Model(),
events: {
onShowPopup: ''
@@ -388,7 +388,7 @@
this.inherited(arguments);
var me = this;
me.hide();
- me.$.lbl.setStyle('padding: 12px 5px 12px 15px; margin-left: 20px;');
+ me.$.lbl.setStyle('padding: 12px 5px 12px 15px; margin-left: 35px;');
me.addClass('btn-icon-notsynchronized_old');
}
});
@@ -474,15 +474,51 @@
});
enyo.kind({
+ name: 'OB.UI.MenuProfileUser',
+ classes: 'menu-connection',
+ eventName: 'onSessionInfo',
+ components: [{
+ classes: 'dropdown-menuitem menu-item-profile-user',
+ components: [{
+ classes: 'menu-item-profile-user-image-content',
+ components: [{
+ classes: 'menu-item-profile-user-image',
+ src: '../org.openbravo.mobile.core/assets/img/anonymous-icon.png',
+ kind: 'Image',
+ name: 'userImg'
+ }]
+ }, {
+ classes: 'menu-item-profile-user-content',
+ components: [{
+ components: [{
+ components: [{
+ classes: 'menu-item-profile-user-name',
+ name: 'username'
+ }, {
+ classes: 'menu-item-profile-user-connected',
+ name: 'connected'
+ }]
+ }]
+ }]
+ }, {
+ classes: 'menu-connection-icon',
+ name: 'connectedIcon'
+ }]
+ }],
+ tap: function () {
+ this.inherited(arguments); // Manual dropdown menu closure
+ // restore focus keeper to its previous status
+ OB.MobileApp.view.scanningFocus(this.parent.parent.parent.parent.parent.parent.originalSanMode);
+ this.bubble(this.eventName);
+ }
+});
+
+enyo.kind({
name: 'OB.UI.MainMenuContents',
kind: 'OB.UI.ToolbarMenu',
menuEntries: [],
- init: function (model) {
- this.model = model;
- },
handlers: {
onSessionInfo: 'showSession',
- onUserInfo: 'showUser',
onDisableMenuEntry: 'disableMenuEntry',
onHideButtons: 'doHideButtons'
},
@@ -491,6 +527,28 @@
onShowPopup: ''
},
+ loadUserInfo: function () {
+ if (!this.$.menuScroller) {
+ return;
+ }
+ var ctx = OB.MobileApp.model.get('context'),
+ menuEntry = this.$.menuScroller.$.connStatusButton;
+ menuEntry.$.username.setContent(ctx ? ctx.user._identifier : '');
+ if (ctx) {
+ if (ctx.userImgData) {
+ menuEntry.$.userImg.setAttribute('src', 'data:image/jpeg;base64,' + ctx.userImgData);
+ } else {
+ menuEntry.$.userImg.setAttribute('src', '../org.openbravo.mobile.core/assets/img/anonymous-icon.png');
+ }
+ }
+ },
+
+ init: function (model) {
+ this.model = model;
+ OB.MobileApp.model.off('change:orgUserId', this.loadUserInfo);
+ OB.MobileApp.model.on('change:orgUserId', this.loadUserInfo, this);
+ },
+
showSession: function () {
this.doShowPopup({
popup: 'profileSessionInfo',
@@ -500,26 +558,21 @@
});
},
- showUser: function () {
- this.doShowPopup({
- popup: 'profileUserInfo'
- });
- },
-
setConnected: function () {
- var menuEntry, connected;
+ var menuEntry, connected, ctx = OB.MobileApp.model.get('context');
if (!this.$.menu) {
// menu is not already built...
return;
}
+ connected = OB.MobileApp.model.get('connectedToERP');
menuEntry = this.$.menuScroller.$.connStatusButton;
- connected = OB.MobileApp.model.get('connectedToERP');
- menuEntry.$.lbl.setStyle('padding: 12px 5px 12px 15px; margin-left: 20px;');
- menuEntry.setLabel(OB.I18N.getLabel(connected ? 'OBMOBC_Online' : 'OBMOBC_Offline'));
- menuEntry.addRemoveClass('onlineicon', connected);
- menuEntry.addRemoveClass('offlineicon', !connected);
+ menuEntry.$.connected.setContent(OB.I18N.getLabel(connected ? 'OBMOBC_Online' : 'OBMOBC_Offline'));
+ menuEntry.$.connectedIcon.addRemoveClass('onlineicon', connected);
+ menuEntry.$.connectedIcon.addRemoveClass('offlineicon', !connected);
+
+ this.loadUserInfo();
},
disableMenuEntry: function (inSender, inEvent) {
@@ -559,10 +612,8 @@
});
this.menuEntries.push({
- kind: 'OB.UI.MenuAction',
- name: 'connStatusButton',
- classes: 'menu-connection',
- eventName: 'onSessionInfo'
+ kind: 'OB.UI.MenuProfileUser',
+ name: 'connStatusButton'
});
if (this.customMenuEntries && this.customMenuEntries.length > 0) {
@@ -614,14 +665,6 @@
kind: 'OB.UI.MenuSeparator'
});
- this.menuEntries.push({
- name: 'OB.UI.MenuUserInfo',
- kind: 'OB.UI.MenuAction',
- classes: 'dropdown-menuitem',
- i18nLabel: 'OBMOBC_User',
- eventName: 'onUserInfo'
- });
-
// start menu recording entry
enyo.kind({
name: 'OBMOBC.UI.MenuRecording',
@@ -688,6 +731,7 @@
OB.MobileApp.model.on('change:connectedToERP', function () {
this.setConnected();
}, this);
+
this.setConnected();
}
});
\ No newline at end of file
diff --git a/web/org.openbravo.mobile.core/source/component/ob-terminal-component.js b/web/org.openbravo.mobile.core/source/component/ob-terminal-component.js
--- a/web/org.openbravo.mobile.core/source/component/ob-terminal-component.js
+++ b/web/org.openbravo.mobile.core/source/component/ob-terminal-component.js
@@ -179,9 +179,6 @@
kind: 'OB.UI.Profile.SessionInfo',
name: 'profileSessionInfo'
}, {
- kind: 'OB.UI.Profile.UserInfo',
- name: 'profileUserInfo'
- }, {
// To globaly handle keypup events when not using focusKeeper
kind: enyo.Signals,
onkeyup: "keypressHandler",
Test_38463.diff [^] (15,903 bytes) 2019-02-19 12:06 [Show Content] [Hide Content]diff --git a/src-test/org/openbravo/test/mobile/core/utils/AllowedErrorsHelper.java b/src-test/org/openbravo/test/mobile/core/utils/AllowedErrorsHelper.java
--- a/src-test/org/openbravo/test/mobile/core/utils/AllowedErrorsHelper.java
+++ b/src-test/org/openbravo/test/mobile/core/utils/AllowedErrorsHelper.java
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2008-2018 Openbravo S.L.U.
+ * All portions are Copyright (C) 2008-2019 Openbravo S.L.U.
* All Rights Reserved.
* Contributor(s):
************************************************************************
@@ -156,6 +156,7 @@
testsAllowedToHaveTomcatErrors.add("LoginOfflineCreateBPWait");
testsAllowedToHaveTomcatErrors.add("LoginOfflineSimplesale");
testsAllowedToHaveTomcatErrors.add("LoginOfflineSimplesaleWait");
+ testsAllowedToHaveTomcatErrors.add("LoginOfflineUserInformation");
// other offline test
testsAllowedToHaveTomcatErrors.add("I34743_JSErrorShownInBPandBPLocationDetails");
testsAllowedToHaveTomcatErrors.add("OfflineCheckCashManagement");
@@ -369,6 +370,7 @@
testsAllowedToHaveJavascriptErrors.add("LoginOfflineCreateBPWait");
testsAllowedToHaveJavascriptErrors.add("LoginOfflineSimplesale");
testsAllowedToHaveJavascriptErrors.add("LoginOfflineSimplesaleWait");
+ testsAllowedToHaveJavascriptErrors.add("LoginOfflineUserInformation");
// other offline test
testsAllowedToHaveJavascriptErrors.add("OfflineCheckCashManagement");
testsAllowedToHaveJavascriptErrors.add("I34280_VerifyLoginOffline");
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/TestIdPack.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/TestIdPack.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/TestIdPack.java
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/TestIdPack.java
@@ -127,7 +127,7 @@
"editTabContent_discountsEdit"); //
public static TestIdConstructor BUTTON_MENU_OFFLINE = new TestIdConstructor(
- "connStatusButton_lbl", EnyoKind.BUTTON); //
+ "connStatusButton_connected", EnyoKind.BUTTON); //
public static TestIdConstructor BUTTON_MENU_RETRYCONNECT = new TestIdConstructor(
"menuScroller_reconnectButton", EnyoKind.BUTTON); //
public static TestIdConstructor BUTTON_MENU_RETRYCONNECT_LBL = new TestIdConstructor(
@@ -192,8 +192,6 @@
"menuScroller_menuScroller_menuDisableEnableRFIDReader", EnyoKind.BUTTON); //
public static TestIdConstructor LABEL_BUTTON_RFID = new TestIdConstructor(
"menuScroller_menuDisableEnableRFIDReader"); //
- public static TestIdConstructor BUTTON_MENU_USER = new TestIdConstructor(
- "menuScroller_OB.UI.MenuUserInfo", EnyoKind.BUTTON); //
public static TestIdConstructor BUTTON_MENU_OPENDRAWER = new TestIdConstructor(
"menuScroller_menuOpenDrawer", EnyoKind.BUTTON); //
public static TestIdConstructor BUTTON_MENU_OPENRECEIPT = new TestIdConstructor(EnyoKind.BUTTON,
@@ -201,7 +199,7 @@
// Modal User Dialog
public static TestIdConstructor BUTTON_USER_PROFILE = new TestIdConstructor(
- "profileUserInfo_profileButton", EnyoKind.BUTTON); //
+ "profileSessionInfo_profileButton", EnyoKind.BUTTON); //
public static TestIdConstructor BUTTON_USER_PROFILE_APPLY = new TestIdConstructor(
"bodyButtons_profileDialogApply", EnyoKind.BUTTON); //
public static TestIdConstructor BUTTON_USER_PROFILE_CANCEL = new TestIdConstructor(
@@ -214,6 +212,10 @@
"bodyContent_defaultBox"); //
public static TestIdConstructor COMBO_USER_PROFILE_ROLE_LIST = new TestIdConstructor(
"bodyContent_roleList", EnyoKind.BUTTON); //
+ public static TestIdConstructor PROFILE_DIALOG_POPUP_USERNAME = new TestIdConstructor(
+ "userWidget_username"); //
+ public static TestIdConstructor PROFILE_DIALOG_POPUP_ROLE = new TestIdConstructor(
+ "userWidget_role"); //
// ISLAYAWAY LABEL
public static TestIdConstructor LABEL_ISLAYAWAY = new TestIdConstructor(
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/I33730_VerifyRoleOrgAccess.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/I33730_VerifyRoleOrgAccess.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/I33730_VerifyRoleOrgAccess.java
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/I33730_VerifyRoleOrgAccess.java
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2016 Openbravo S.L.U.
+ * All portions are Copyright (C) 2016-2019 Openbravo S.L.U.
* All Rights Reserved.
* Contributor(s):
************************************************************************
@@ -72,7 +72,7 @@
private void openUserProfileDialog() {
tap(TestIdPack.BUTTON_MENU);
- tap(TestIdPack.BUTTON_MENU_USER);
+ tap(TestIdPack.BUTTON_MENU_ONLINE);
tap(TestIdPack.BUTTON_USER_PROFILE);
isVisible(TestIdPack.PROFILE_DIALOG_POPUP_TITLE, true);
}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/I34424_VerifyRoleOrgAccessPaymentMethod.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/I34424_VerifyRoleOrgAccessPaymentMethod.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/I34424_VerifyRoleOrgAccessPaymentMethod.java
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/loginout/I34424_VerifyRoleOrgAccessPaymentMethod.java
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2016 Openbravo S.L.U.
+ * All portions are Copyright (C) 2016-2019 Openbravo S.L.U.
* All Rights Reserved.
* Contributor(s):
************************************************************************
@@ -125,7 +125,7 @@
private void openUserProfileDialog() {
tap(TestIdPack.BUTTON_MENU);
- tap(TestIdPack.BUTTON_MENU_USER);
+ tap(TestIdPack.BUTTON_MENU_ONLINE);
tap(TestIdPack.BUTTON_USER_PROFILE);
isVisible(TestIdPack.PROFILE_DIALOG_POPUP_TITLE, true);
}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/offline/LoginOfflineUserInformation.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/offline/LoginOfflineUserInformation.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/offline/LoginOfflineUserInformation.java
@@ -0,0 +1,49 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo Public License
+ * Version 1.0 (the "License"), being the Mozilla Public License
+ * Version 1.1 with a permitted attribution clause; you may not use this
+ * file except in compliance with the License. You may obtain a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo S.L.U.
+ * All portions are Copyright (C) 2019 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author EBE
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.offline;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
+import org.openbravo.test.mobile.retail.mobilecore.javascript.SynchronizationMonitor;
+import org.openbravo.test.mobile.retail.mobilecore.utils.ApplicationWindow;
+import org.openbravo.test.mobile.retail.pack.selenium.TestIdPack;
+
+@TestClassAnnotations(isServiceWorkersCompatible = true)
+public class LoginOfflineUserInformation extends WebPOSOfflineCustomTerminalHelper {
+
+ @Test
+ public void test() {
+ // 1. goOffline
+ goOffline();
+ reload();
+ SynchronizationMonitor.waitUntilCurrentWindowIsRendered(ApplicationWindow.POINTOFSALE);
+ // 2. Verify user information
+ tap(TestIdPack.BUTTON_MENU);
+ tap(TestIdPack.BUTTON_MENU_ONLINE);
+ verify(TestIdPack.PROFILE_DIALOG_POPUP_USERNAME, "Vall Blanca Store User");
+ verify(TestIdPack.PROFILE_DIALOG_POPUP_ROLE, "VallBlancaUser");
+ tap(TestIdPack.BUTTON_USER_PROFILE);
+ // 3. goOnline
+ goOnline(false, false);
+ }
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/HideActionButtons.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/HideActionButtons.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/HideActionButtons.java
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/HideActionButtons.java
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2017 Openbravo S.L.U.
+ * All portions are Copyright (C) 2017-2019 Openbravo S.L.U.
* All Rights Reserved.
* Contributor(s):
************************************************************************
@@ -51,7 +51,7 @@
createPermission("OBPOS_ReturnLine");
reload();
tap(TestIdPack.BUTTON_MENU);
- tap(TestIdPack.BUTTON_MENU_USER);
+ tap(TestIdPack.BUTTON_MENU_ONLINE);
tap(TestIdPack.BUTTON_USER_PROFILE);
verify(TestIdPack.PROFILE_DIALOG_POPUP_TITLE, "Edit Profile");
TestIdPack.COMBO_USER_PROFILE_ROLE_LIST.enyoNode().executeExtension(".setSelected(0)");
@@ -154,7 +154,7 @@
tap(TestIdPack.BUTTON_PAY_DONE);
verify(TestIdPack.LABEL_TOTALTOPAY, "0.00");
tap(TestIdPack.BUTTON_MENU);
- tap(TestIdPack.BUTTON_MENU_USER);
+ tap(TestIdPack.BUTTON_MENU_ONLINE);
tap(TestIdPack.BUTTON_USER_PROFILE);
verify(TestIdPack.PROFILE_DIALOG_POPUP_TITLE, "Edit Profile");
TestIdPack.COMBO_USER_PROFILE_ROLE_LIST.enyoNode().executeExtension(".setSelected(1)");
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I29459_HookProfileDialogApply.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I29459_HookProfileDialogApply.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I29459_HookProfileDialogApply.java
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I29459_HookProfileDialogApply.java
@@ -1,3 +1,25 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo Public License
+ * Version 1.0 (the "License"), being the Mozilla Public License
+ * Version 1.1 with a permitted attribution clause; you may not use this
+ * file except in compliance with the License. You may obtain a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo S.L.U.
+ * All portions are Copyright (C) 2016-2019 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author SHI
+ *
+ */
+
package org.openbravo.test.mobile.retail.pack.selenium.tests.system;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -35,7 +57,7 @@
private void openUserProfileDialog() {
tap(TestIdPack.BUTTON_MENU);
- tap(TestIdPack.BUTTON_MENU_USER);
+ tap(TestIdPack.BUTTON_MENU_ONLINE);
tap(TestIdPack.BUTTON_USER_PROFILE);
isVisible(TestIdPack.PROFILE_DIALOG_POPUP_TITLE, true);
}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I32625_VerifyUserProfileDefaultLang.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I32625_VerifyUserProfileDefaultLang.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I32625_VerifyUserProfileDefaultLang.java
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I32625_VerifyUserProfileDefaultLang.java
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2016 Openbravo S.L.U.
+ * All portions are Copyright (C) 2016-2019 Openbravo S.L.U.
* All Rights Reserved.
* Contributor(s):
************************************************************************
@@ -64,7 +64,7 @@
private void openProfile() {
tap(TestIdPack.BUTTON_MENU);
- tap(TestIdPack.BUTTON_MENU_USER);
+ tap(TestIdPack.BUTTON_MENU_ONLINE);
tap(TestIdPack.BUTTON_USER_PROFILE);
}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I35040_RequestDuringChangeRoleAction.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I35040_RequestDuringChangeRoleAction.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I35040_RequestDuringChangeRoleAction.java
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I35040_RequestDuringChangeRoleAction.java
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2017 Openbravo S.L.U.
+ * All portions are Copyright (C) 2017-2019 Openbravo S.L.U.
* All Rights Reserved.
* Contributor(s):
************************************************************************
@@ -57,7 +57,7 @@
for (int i = 1; i <= 10; i++) {
SeleniumHelper.executeScript(scriptFunction);
tap(TestIdPack.BUTTON_MENU);
- tap(TestIdPack.BUTTON_MENU_USER);
+ tap(TestIdPack.BUTTON_MENU_ONLINE);
tap(TestIdPack.BUTTON_USER_PROFILE);
verify(TestIdPack.PROFILE_DIALOG_POPUP_TITLE, "Edit Profile");
if (i % 2 == 0) {
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I36374_VerifyLayawayWithDifferentUserRole.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I36374_VerifyLayawayWithDifferentUserRole.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I36374_VerifyLayawayWithDifferentUserRole.java
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I36374_VerifyLayawayWithDifferentUserRole.java
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2017 Openbravo S.L.U.
+ * All portions are Copyright (C) 2017-2019 Openbravo S.L.U.
* All Rights Reserved.
* Contributor(s):
************************************************************************
@@ -72,7 +72,7 @@
private void changeUserRole(final int index) {
tap(TestIdPack.BUTTON_MENU);
- tap(TestIdPack.BUTTON_MENU_USER);
+ tap(TestIdPack.BUTTON_MENU_ONLINE);
tap(TestIdPack.BUTTON_USER_PROFILE);
isVisible(TestIdPack.PROFILE_DIALOG_POPUP_TITLE, true);
|