Skip to content

Commit 9d6f156

Browse files
authored
🎨 [Frontend] ViP Market: Requests after review 02.19 (#7249)
1 parent 75ad9b0 commit 9d6f156

File tree

10 files changed

+152
-218
lines changed

10 files changed

+152
-218
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,26 @@ qx.Class.define("osparc.desktop.credits.BillingCenter", {
4343

4444
statics: {
4545
createMiniWalletView: function() {
46-
const layout = new qx.ui.container.Composite(new qx.ui.layout.VBox(8)).set({
46+
const layout = new qx.ui.container.Composite(new qx.ui.layout.VBox(6)).set({
4747
alignX: "center",
4848
minWidth: 120,
4949
maxWidth: 150
5050
});
5151

52-
const store = osparc.store.Store.getInstance();
52+
const walletName = new qx.ui.basic.Label().set({
53+
alignX: "center"
54+
});
55+
layout.add(walletName);
5356
const creditsIndicator = new osparc.desktop.credits.CreditsIndicator();
54-
store.bind("contextWallet", creditsIndicator, "wallet");
5557
layout.add(creditsIndicator);
58+
const store = osparc.store.Store.getInstance();
59+
store.bind("contextWallet", walletName, "value", {
60+
converter: wallet => wallet.getName()
61+
});
62+
store.bind("contextWallet", walletName, "toolTipText", {
63+
converter: wallet => wallet.getName()
64+
});
65+
store.bind("contextWallet", creditsIndicator, "wallet");
5666

5767
layout.add(new qx.ui.core.Spacer(15, 15));
5868

services/static-webserver/client/source/class/osparc/desktop/wallets/WalletListItem.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ qx.Class.define("osparc.desktop.wallets.WalletListItem", {
8181
control = new qx.ui.basic.Label().set({
8282
font: "text-14"
8383
});
84+
control.bind("value", control, "toolTipText");
8485
this._add(control, {
8586
row: 0,
8687
column: 0,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ qx.Class.define("osparc.navigation.UserMenu", {
8686
this.add(control);
8787
break;
8888
case "market":
89-
control = new qx.ui.menu.Button(this.tr("Market"));
89+
control = new qx.ui.menu.Button(this.tr("Model Market"));
9090
control.addListener("execute", () => osparc.vipMarket.MarketWindow.openWindow());
9191
this.add(control);
9292
break;

services/static-webserver/client/source/class/osparc/store/LicensedItems.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ qx.Class.define("osparc.store.LicensedItems", {
7070
return nSeats;
7171
},
7272

73-
licensedResourceNameAndVersion: function(licensedResource) {
73+
licensedResourceTitle: function(licensedResource) {
7474
const name = licensedResource["source"]["features"]["name"] || osparc.store.LicensedItems.extractNameFromDescription(licensedResource);
75-
const version = licensedResource["source"]["features"]["version"] || "";
76-
return `${name} ${version}`;
75+
const functionality = licensedResource["source"]["features"]["functionality"] || "Static";
76+
return `${name}, ${functionality}`;
7777
},
7878

7979
extractNameFromDescription: function(licensedResource) {

services/static-webserver/client/source/class/osparc/store/Pricing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ qx.Class.define("osparc.store.Pricing", {
8282
},
8383

8484
fetchPricingUnits: function(pricingPlanId) {
85-
if (this.getPricingPlan(pricingPlanId)) {
85+
if (this.getPricingPlan(pricingPlanId) && this.getPricingPlan(pricingPlanId).getPricingUnits().length !== 0) {
8686
return new Promise(resolve => resolve(this.getPricingPlan(pricingPlanId).getPricingUnits()));
8787
}
8888
const params = {

services/static-webserver/client/source/class/osparc/study/PricingUnitLicense.js

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ qx.Class.define("osparc.study.PricingUnitLicense", {
2929
nullable: true,
3030
event: "changeShowRentButton"
3131
},
32-
33-
licenseUrl: {
34-
check: "String",
35-
init: false,
36-
nullable: true,
37-
event: "changeLicenseUrl"
38-
},
3932
},
4033

4134
statics: {
@@ -95,49 +88,19 @@ qx.Class.define("osparc.study.PricingUnitLicense", {
9588
const nCredits = this.getUnitData().getCost();
9689
const expirationDate = osparc.study.PricingUnitLicense.getExpirationDate();
9790
let msg = this.getUnitData().getName() + this.tr(" will be available until ") + osparc.utils.Utils.formatDate(expirationDate);
98-
msg += "<br>";
99-
msg += `The rental will cost ${nCredits} credits`;
91+
msg += `<br>The rental will cost ${nCredits} credits`;
92+
msg += `<br>I hereby accept the Terms and Conditions`;
10093
const confirmationWin = new osparc.ui.window.Confirmation(msg).set({
10194
caption: this.tr("Rent"),
10295
confirmText: this.tr("Rent"),
10396
});
10497

105-
if (this.getLicenseUrl()) {
106-
const useCacheCB = new qx.ui.form.CheckBox().set({
107-
value: false,
108-
label: this.tr("Accept <u>Terms and Conditions</u>"),
109-
rich: true,
110-
});
111-
useCacheCB.getChildControl("label").set({
112-
anonymous: false,
113-
cursor: "pointer",
114-
});
115-
useCacheCB.getChildControl("label").addListener("tap", () => this.__openLicense());
116-
confirmationWin.addWidget(useCacheCB);
117-
confirmationWin.getExtraWidgetsLayout().setPaddingTop(0); // reset paddingTop
118-
useCacheCB.bind("value", confirmationWin.getConfirmButton(), "enabled");
119-
}
120-
12198
confirmationWin.open();
12299
confirmationWin.addListener("close", () => {
123100
if (confirmationWin.getConfirmed()) {
124101
this.fireEvent("rentPricingUnit");
125102
}
126103
}, this);
127104
},
128-
129-
__openLicense: function() {
130-
let rawLink = this.getLicenseUrl() || "";
131-
if (rawLink.includes("github")) {
132-
// make sure the raw version of the link is shown
133-
rawLink += "?raw=true";
134-
}
135-
const mdWindow = new osparc.ui.markdown.MarkdownWindow(rawLink).set({
136-
caption: this.tr("Terms and Conditions"),
137-
width: 800,
138-
height: 600,
139-
});
140-
mdWindow.open();
141-
},
142105
}
143106
});

0 commit comments

Comments
 (0)