Skip to content

Commit 1fb8e5b

Browse files
committed
merge master into polish-api-keys-domain
2 parents 6caaa4e + e3cbabb commit 1fb8e5b

File tree

11 files changed

+219
-124
lines changed

11 files changed

+219
-124
lines changed

services/static-webserver/client/source/class/osparc/data/model/LicensedItemResource.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ qx.Class.define("osparc.data.model.LicensedItemResource", {
5252
}
5353

5454
this.set({
55+
modelId: licensedItemResourceData.id,
5556
description: description,
5657
title: title,
5758
subtitle: subtitle,
@@ -66,6 +67,13 @@ qx.Class.define("osparc.data.model.LicensedItemResource", {
6667
},
6768

6869
properties: {
70+
modelId: {
71+
check: "Number",
72+
nullable: false,
73+
init: null,
74+
event: "changeModelId",
75+
},
76+
6977
description: {
7078
check: "String",
7179
nullable: false,

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("Model Store"));
89+
control = new qx.ui.menu.Button(this.tr("The Shop"));
9090
control.addListener("execute", () => osparc.vipMarket.MarketWindow.openWindow());
9191
this.add(control);
9292
break;

services/static-webserver/client/source/class/osparc/pricing/PlanDetails.js

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,27 @@ qx.Class.define("osparc.pricing.PlanDetails", {
3333
"backToPricingPlans": "qx.event.type.Event"
3434
},
3535

36+
statics: {
37+
createTabPage: function(label, icon) {
38+
const tabPage = new qx.ui.tabview.Page().set({
39+
layout: new qx.ui.layout.VBox()
40+
});
41+
if (label) {
42+
tabPage.setLabel(label);
43+
}
44+
if (icon) {
45+
tabPage.setIcon(icon);
46+
}
47+
tabPage.getChildControl("button").set({
48+
font: "text-13"
49+
});
50+
return tabPage;
51+
}
52+
},
53+
3654
members: {
55+
__servicesPage: null,
56+
3757
_createChildControlImpl: function(id) {
3858
let control;
3959
let layout;
@@ -68,7 +88,7 @@ qx.Class.define("osparc.pricing.PlanDetails", {
6888
break;
6989
case "pricing-units": {
7090
control = new osparc.pricing.UnitsList();
71-
const tabPage = this.__createTabPage(this.tr("Pricing Units"), "@FontAwesome5Solid/paw/14");
91+
const tabPage = this.self().createTabPage(this.tr("Pricing Units"), "@FontAwesome5Solid/paw/14");
7292
tabPage.add(control, {
7393
flex: 1
7494
});
@@ -78,7 +98,7 @@ qx.Class.define("osparc.pricing.PlanDetails", {
7898
}
7999
case "service-list": {
80100
control = new osparc.pricing.ServicesList();
81-
const tabPage = this.__createTabPage(this.tr("Services"), "@FontAwesome5Solid/cogs/14");
101+
const tabPage = this.__servicesPage = this.self().createTabPage(this.tr("Services"), "@FontAwesome5Solid/cogs/14");
82102
tabPage.add(control, {
83103
flex: 1
84104
});
@@ -90,38 +110,27 @@ qx.Class.define("osparc.pricing.PlanDetails", {
90110
return control || this.base(arguments, id);
91111
},
92112

93-
setCurrentPricingPlan: function(pricingPlanModel) {
94-
if (pricingPlanModel === null) {
113+
setCurrentPricingPlan: function(pricingPlan) {
114+
if (pricingPlan === null) {
95115
return;
96116
}
97117

98118
const pricingPlanListItem = this.getChildControl("pricing-plan-details");
99-
pricingPlanModel.bind("model", pricingPlanListItem, "model");
100-
pricingPlanModel.bind("ppId", pricingPlanListItem, "ppId");
101-
pricingPlanModel.bind("ppKey", pricingPlanListItem, "ppKey");
102-
pricingPlanModel.bind("title", pricingPlanListItem, "title");
103-
pricingPlanModel.bind("description", pricingPlanListItem, "description");
104-
pricingPlanModel.bind("isActive", pricingPlanListItem, "isActive");
119+
pricingPlan.bind("model", pricingPlanListItem, "model");
120+
pricingPlan.bind("ppId", pricingPlanListItem, "ppId");
121+
pricingPlan.bind("ppKey", pricingPlanListItem, "ppKey");
122+
pricingPlan.bind("title", pricingPlanListItem, "title");
123+
pricingPlan.bind("description", pricingPlanListItem, "description");
124+
pricingPlan.bind("isActive", pricingPlanListItem, "isActive");
105125

106126
// set PricingPlanId to the tab views
107-
this.getChildControl("pricing-units").setPricingPlanId(pricingPlanModel.getModel());
108-
this.getChildControl("service-list").setPricingPlanId(pricingPlanModel.getModel());
109-
},
127+
this.getChildControl("pricing-units").setPricingPlanId(pricingPlan.getModel());
128+
this.getChildControl("service-list").setPricingPlanId(pricingPlan.getModel());
110129

111-
__createTabPage: function(label, icon) {
112-
const tabPage = new qx.ui.tabview.Page().set({
113-
layout: new qx.ui.layout.VBox()
114-
});
115-
if (label) {
116-
tabPage.setLabel(label);
117-
}
118-
if (icon) {
119-
tabPage.setIcon(icon);
120-
}
121-
tabPage.getChildControl("button").set({
122-
font: "text-13"
130+
// show services only if it's a TIER pricing plan
131+
this.__servicesPage.getChildControl("button").set({
132+
visibility: pricingPlan.getClassification() === "TIER" ? "visible" : "excluded"
123133
});
124-
return tabPage;
125-
}
134+
},
126135
}
127136
});

0 commit comments

Comments
 (0)