Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,26 @@ qx.Class.define("osparc.desktop.credits.BillingCenter", {

statics: {
createMiniWalletView: function() {
const layout = new qx.ui.container.Composite(new qx.ui.layout.VBox(8)).set({
const layout = new qx.ui.container.Composite(new qx.ui.layout.VBox(6)).set({
alignX: "center",
minWidth: 120,
maxWidth: 150
});

const store = osparc.store.Store.getInstance();
const walletName = new qx.ui.basic.Label().set({
alignX: "center"
});
layout.add(walletName);
const creditsIndicator = new osparc.desktop.credits.CreditsIndicator();
store.bind("contextWallet", creditsIndicator, "wallet");
layout.add(creditsIndicator);
const store = osparc.store.Store.getInstance();
store.bind("contextWallet", walletName, "value", {
converter: wallet => wallet.getName()
});
store.bind("contextWallet", walletName, "toolTipText", {
converter: wallet => wallet.getName()
});
store.bind("contextWallet", creditsIndicator, "wallet");

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ qx.Class.define("osparc.desktop.wallets.WalletListItem", {
control = new qx.ui.basic.Label().set({
font: "text-14"
});
control.bind("value", control, "toolTipText");
this._add(control, {
row: 0,
column: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ qx.Class.define("osparc.navigation.UserMenu", {
this.add(control);
break;
case "market":
control = new qx.ui.menu.Button(this.tr("Market"));
control = new qx.ui.menu.Button(this.tr("Model Market"));
control.addListener("execute", () => osparc.vipMarket.MarketWindow.openWindow());
this.add(control);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ qx.Class.define("osparc.store.LicensedItems", {
return nSeats;
},

licensedResourceNameAndVersion: function(licensedResource) {
licensedResourceTitle: function(licensedResource) {
const name = licensedResource["source"]["features"]["name"] || osparc.store.LicensedItems.extractNameFromDescription(licensedResource);
const version = licensedResource["source"]["features"]["version"] || "";
return `${name} ${version}`;
const functionality = licensedResource["source"]["features"]["functionality"] || "Static";
return `${name}, ${functionality}`;
},

extractNameFromDescription: function(licensedResource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ qx.Class.define("osparc.store.Pricing", {
},

fetchPricingUnits: function(pricingPlanId) {
if (this.getPricingPlan(pricingPlanId)) {
if (this.getPricingPlan(pricingPlanId) && this.getPricingPlan(pricingPlanId).getPricingUnits().length !== 0) {
return new Promise(resolve => resolve(this.getPricingPlan(pricingPlanId).getPricingUnits()));
}
const params = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ qx.Class.define("osparc.study.PricingUnitLicense", {
nullable: true,
event: "changeShowRentButton"
},

licenseUrl: {
check: "String",
init: false,
nullable: true,
event: "changeLicenseUrl"
},
},

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

if (this.getLicenseUrl()) {
const useCacheCB = new qx.ui.form.CheckBox().set({
value: false,
label: this.tr("Accept <u>Terms and Conditions</u>"),
rich: true,
});
useCacheCB.getChildControl("label").set({
anonymous: false,
cursor: "pointer",
});
useCacheCB.getChildControl("label").addListener("tap", () => this.__openLicense());
confirmationWin.addWidget(useCacheCB);
confirmationWin.getExtraWidgetsLayout().setPaddingTop(0); // reset paddingTop
useCacheCB.bind("value", confirmationWin.getConfirmButton(), "enabled");
}

confirmationWin.open();
confirmationWin.addListener("close", () => {
if (confirmationWin.getConfirmed()) {
this.fireEvent("rentPricingUnit");
}
}, this);
},

__openLicense: function() {
let rawLink = this.getLicenseUrl() || "";
if (rawLink.includes("github")) {
// make sure the raw version of the link is shown
rawLink += "?raw=true";
}
const mdWindow = new osparc.ui.markdown.MarkdownWindow(rawLink).set({
caption: this.tr("Terms and Conditions"),
width: 800,
height: 600,
});
mdWindow.open();
},
}
});
Loading
Loading