Skip to content

Commit 9afd568

Browse files
committed
logic to services
1 parent 97cc41c commit 9afd568

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

services/static-webserver/client/source/class/osparc/dashboard/ServiceBrowser.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,24 @@ qx.Class.define("osparc.dashboard.ServiceBrowser", {
4848
// overridden
4949
initResources: function() {
5050
this._resourcesList = [];
51-
this.getChildControl("resources-layout");
52-
this.reloadResources();
53-
this._hideLoadingPage();
51+
osparc.store.Services.getServicesLatest(false)
52+
.then(services => {
53+
// Show "Contact Us" message if services.length === 0
54+
// Most probably is a product-stranger user (it can also be that the catalog is down)
55+
if (Object.keys(services).length === 0) {
56+
let msg = this.tr("It seems you don't have access to this product.");
57+
msg += "</br>";
58+
msg += this.tr("Please contact us:");
59+
msg += "</br>";
60+
const supportEmail = osparc.store.VendorInfo.getInstance().getSupportEmail();
61+
msg += supportEmail;
62+
osparc.FlashMessenger.getInstance().logAs(msg, "WARNING");
63+
}
64+
65+
this.getChildControl("resources-layout");
66+
this.reloadResources();
67+
this._hideLoadingPage();
68+
});
5469
},
5570

5671
reloadResources: function() {

services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
122122
.then(notifications => {
123123
osparc.notification.Notifications.getInstance().addNotifications(notifications);
124124
});
125-
126-
// Show "Contact Us" message if services.length === 0
127-
// Most probably is a product-stranger user (it can also be that the catalog is down)
128-
osparc.store.Services.getServicesLatest()
129-
.then(services => {
130-
if (Object.keys(services).length === 0) {
131-
let msg = this.tr("It seems you don't have access to this product.");
132-
msg += "</br>";
133-
msg += this.tr("Please contact us:");
134-
msg += "</br>";
135-
const supportEmail = osparc.store.VendorInfo.getInstance().getSupportEmail();
136-
msg += supportEmail;
137-
osparc.FlashMessenger.getInstance().logAs(msg, "WARNING");
138-
}
139-
});
140125
})
141126
.catch(err => {
142127
console.error(err);

0 commit comments

Comments
 (0)