Skip to content

Commit c1c5c39

Browse files
authored
🎨 Feature: Wallets on staging (#4614)
1 parent 6de9559 commit c1c5c39

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

services/static-webserver/client/source/class/osparc/desktop/credits/BuyCredits.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,17 @@ qx.Class.define("osparc.desktop.credits.BuyCredits", {
421421
const nCredits = this.getNCredits();
422422
const totalPrice = this.getTotalPrice();
423423
const wallet = this.getWallet();
424-
const title = "3rd party payment gateway";
424+
const title = "AppMotion's middleware";
425+
let url = "https://www.paymentservice.io";
426+
url += "?user_id=2";
427+
url += "&session_id=1234";
428+
url += "&token=5678";
429+
url += "&wallet_id=" + wallet.getWalletId();
430+
url += "&wallet_name=" + encodeURIComponent(wallet.getName()); // without white spaces
431+
url += "&total_price=" + totalPrice;
432+
url += "&n_credits=" + nCredits;
425433
const paymentGateway = new osparc.desktop.credits.PaymentGateway().set({
426-
url: "https://www.paymentservice.io?user_id=2&session_id=1234567890&token=5678",
434+
url,
427435
nCredits,
428436
totalPrice,
429437
walletName: wallet.getName()

services/static-webserver/client/source/class/osparc/desktop/credits/WalletsMiniViewer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ qx.Class.define("osparc.desktop.credits.WalletsMiniViewer", {
2424
this._setLayout(new qx.ui.layout.VBox(3));
2525

2626
this.set({
27-
padding: 5
27+
padding: 5,
28+
paddingRight: 10
2829
});
2930

3031
this.__walletListeners = [];

services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,17 @@ qx.Class.define("osparc.navigation.NavigationBar", {
135135
const walletsViewer = this.getChildControl("wallets-viewer");
136136
walletsViewer.exclude();
137137
osparc.utils.Utils.isDevelopmentPlatform()
138-
.then(isDevel => isDevel && osparc.product.Utils.isProduct("s4l") ? walletsViewer.show() : walletsViewer.exclude());
138+
.then(isDevel => {
139+
if (isDevel && osparc.product.Utils.isProduct("s4l")) {
140+
walletsViewer.show();
141+
}
142+
});
143+
osparc.utils.Utils.isStagingPlatform()
144+
.then(isStaging => {
145+
if (isStaging && osparc.product.Utils.isProduct("s4l")) {
146+
walletsViewer.show();
147+
}
148+
});
139149
this.getChildControl("tasks-button");
140150
this.getChildControl("notifications-button");
141151
this.getChildControl("expiration-icon");

services/static-webserver/client/source/class/osparc/utils/Utils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@ qx.Class.define("osparc.utils.Utils", {
238238
});
239239
},
240240

241+
isStagingPlatform: function() {
242+
return new Promise(resolve => {
243+
osparc.store.StaticInfo.getInstance().getPlatformName()
244+
.then(platformName => resolve(platformName === "staging"));
245+
});
246+
},
247+
241248
getEditButton: function() {
242249
const button = new qx.ui.form.Button(null, "@FontAwesome5Solid/pencil-alt/12").set({
243250
allowGrowY: false,

0 commit comments

Comments
 (0)