Skip to content

Commit 5d6e9a3

Browse files
committed
Merge remote-tracking branch 'upstream/master' into storage/add-pagination
2 parents 5149d03 + 9d6f156 commit 5d6e9a3

File tree

12 files changed

+181
-238
lines changed

12 files changed

+181
-238
lines changed

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,26 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
160160
},
161161

162162
__addNewStudyItems: async function() {
163-
await osparc.data.Resources.get("templates")
164-
.then(templates => {
165-
const plusButtonConfig = osparc.store.Products.getInstance().getPlusButtonUiConfig();
166-
if (plusButtonConfig["categories"]) {
167-
this.__addCategories(plusButtonConfig["categories"]);
168-
}
169-
plusButtonConfig["resources"].forEach(newStudyData => {
170-
if (newStudyData["showDisabled"]) {
171-
this.__addDisabledButton(newStudyData);
172-
} else if (newStudyData["resourceType"] === "study") {
173-
this.__addEmptyStudyButton(newStudyData);
174-
} else if (newStudyData["resourceType"] === "template") {
175-
this.__addFromTemplateButton(newStudyData, templates);
176-
} else if (newStudyData["resourceType"] === "service") {
177-
this.__addFromServiceButton(newStudyData);
163+
const plusButtonConfig = osparc.store.Products.getInstance().getPlusButtonUiConfig();
164+
if (plusButtonConfig) {
165+
await osparc.data.Resources.get("templates")
166+
.then(templates => {
167+
if (plusButtonConfig["categories"]) {
168+
this.__addCategories(plusButtonConfig["categories"]);
178169
}
170+
plusButtonConfig["resources"].forEach(newStudyData => {
171+
if (newStudyData["showDisabled"]) {
172+
this.__addDisabledButton(newStudyData);
173+
} else if (newStudyData["resourceType"] === "study") {
174+
this.__addEmptyStudyButton(newStudyData);
175+
} else if (newStudyData["resourceType"] === "template") {
176+
this.__addFromTemplateButton(newStudyData, templates);
177+
} else if (newStudyData["resourceType"] === "service") {
178+
this.__addFromServiceButton(newStudyData);
179+
}
180+
});
179181
});
180-
});
182+
}
181183
},
182184

183185
__getLastIdxFromCategory: function(categoryId) {

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -949,13 +949,15 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
949949

950950
__addPlusButtons: function() {
951951
const plusButtonConfig = osparc.store.Products.getInstance().getNewStudiesUiConfig();
952-
plusButtonConfig["resources"].forEach(newStudyData => {
953-
if (newStudyData["resourceType"] === "study") {
954-
this.__addEmptyStudyPlusButton(newStudyData);
955-
} else if (newStudyData["resourceType"] === "service") {
956-
this.__addNewStudyFromServiceButton(newStudyData);
957-
}
958-
});
952+
if (plusButtonConfig) {
953+
plusButtonConfig["resources"].forEach(newStudyData => {
954+
if (newStudyData["resourceType"] === "study") {
955+
this.__addEmptyStudyPlusButton(newStudyData);
956+
} else if (newStudyData["resourceType"] === "service") {
957+
this.__addNewStudyFromServiceButton(newStudyData);
958+
}
959+
});
960+
}
959961
},
960962

961963
__addEmptyStudyPlusButton: function(newStudyData) {

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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ qx.Class.define("osparc.store.Pricing", {
8282
},
8383

8484
fetchPricingUnits: function(pricingPlanId) {
85+
if (this.getPricingPlan(pricingPlanId) && this.getPricingPlan(pricingPlanId).getPricingUnits().length !== 0) {
86+
return new Promise(resolve => resolve(this.getPricingPlan(pricingPlanId).getPricingUnits()));
87+
}
8588
const params = {
8689
url: {
8790
pricingPlanId,

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)