Skip to content

Commit 3a98dc5

Browse files
committed
[skip ci] Show rent buttons
1 parent 9dcd855 commit 3a98dc5

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,17 @@ qx.Class.define("osparc.study.PricingUnit", {
5858

5959
showEditButton: {
6060
check: "Boolean",
61-
init: null,
61+
init: false,
6262
nullable: true,
6363
event: "changeShowEditButton"
6464
},
65+
66+
showRentButton: {
67+
check: "Boolean",
68+
init: false,
69+
nullable: true,
70+
event: "changeShowRentButton"
71+
},
6572
},
6673

6774
members: {
@@ -97,6 +104,13 @@ qx.Class.define("osparc.study.PricingUnit", {
97104
control = new qx.ui.form.Button(qx.locale.Manager.tr("Edit"));
98105
this._add(control);
99106
break;
107+
case "rent-button":
108+
control = new qx.ui.form.Button(qx.locale.Manager.tr("Rent")).set({
109+
appearance: "strong-button",
110+
center: true,
111+
});
112+
this._add(control);
113+
break;
100114
}
101115
return control || this.base(arguments, id);
102116
},
@@ -134,14 +148,21 @@ qx.Class.define("osparc.study.PricingUnit", {
134148
unitExtraInfo.setValue(text);
135149
this.bind("showUnitExtraInfo", unitExtraInfo, "visibility", {
136150
converter: show => show ? "visible" : "excluded"
137-
})
151+
});
138152

139153
// add edit button
140154
const editButton = this.getChildControl("edit-button");
141155
this.bind("showEditButton", editButton, "visibility", {
142156
converter: show => show ? "visible" : "excluded"
143157
})
144158
editButton.addListener("execute", () => this.fireEvent("editPricingUnit"));
159+
160+
// add rent button
161+
const rentButton = this.getChildControl("rent-button");
162+
this.bind("showRentButton", rentButton, "visibility", {
163+
converter: show => show ? "visible" : "excluded"
164+
})
165+
rentButton.addListener("execute", () => this.fireEvent("rentPricingUnit"));
145166
}
146167
}
147168
});

services/static-webserver/client/source/class/osparc/vipMarket/AnatomicalModelDetails.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
2121
construct: function() {
2222
this.base(arguments);
2323

24-
const layout = new qx.ui.layout.VBox(10);
24+
const layout = new qx.ui.layout.VBox(20);
2525
this._setLayout(layout);
2626

2727
this.__poplulateLayout();
@@ -172,7 +172,9 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
172172

173173
__createPricingUnits: function(anatomicalModelsData) {
174174
console.log(anatomicalModelsData);
175-
const pricingUnitsLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(5));
175+
const pricingUnitsLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(5).set({
176+
alignX: "center"
177+
}));
176178

177179
const params = {
178180
url: {
@@ -187,6 +189,7 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
187189
showAwsSpecificInfo: false,
188190
showUnitExtraInfo: false,
189191
showEditButton: false,
192+
showRentButton: true,
190193
allowGrowY: false
191194
});
192195
pricingUnitsLayout.add(pUnit);

0 commit comments

Comments
 (0)