Skip to content

Commit 7e95307

Browse files
committed
rentAnatomicalModel
1 parent 3a98dc5 commit 7e95307

File tree

3 files changed

+12
-30
lines changed

3 files changed

+12
-30
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,11 @@ qx.Class.define("osparc.data.Resources", {
12501250
get: {
12511251
method: "GET",
12521252
url: statics.API + "/catalog/licensed-items"
1253-
}
1253+
},
1254+
purchase: {
1255+
method: "GET",
1256+
url: statics.API + "/catalog/licensed-items/{licensedItemId}:purchase"
1257+
},
12541258
}
12551259
}
12561260
};

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ qx.Class.define("osparc.study.PricingUnit", {
3131
},
3232

3333
events: {
34-
"editPricingUnit": "qx.event.type.Event"
34+
"editPricingUnit": "qx.event.type.Event",
35+
"rentPricingUnit": "qx.event.type.Event",
3536
},
3637

3738
properties: {

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

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -192,40 +192,17 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
192192
showRentButton: true,
193193
allowGrowY: false
194194
});
195+
pUnit.addListener("rentPricingUnit", () => this.__rentAnatomicalModel(anatomicalModelsData, pricingUnit));
195196
pricingUnitsLayout.add(pUnit);
196197
});
197198
})
198199
.catch(err => console.error(err));
199200

200-
/*
201-
if (anatomicalModelsData["leased"]) {
202-
const leaseModelButton = new qx.ui.form.Button().set({
203-
label: this.tr("3 seats Leased (27 days left)"),
204-
appearance: "strong-button",
205-
center: true,
206-
enabled: false,
207-
});
208-
buttonsLayout.add(leaseModelButton, {
209-
flex: 1
210-
});
211-
}
212-
const leaseModelButton = new osparc.ui.form.FetchButton().set({
213-
label: this.tr("Lease model (2 for months)"),
214-
appearance: "strong-button",
215-
center: true,
216-
});
217-
leaseModelButton.addListener("execute", () => {
218-
leaseModelButton.setFetching(true);
219-
setTimeout(() => {
220-
leaseModelButton.setFetching(false);
221-
this.fireDataEvent("modelLeased", this.getAnatomicalModelsData()["modelId"]);
222-
}, 2000);
223-
});
224-
buttonsLayout.add(leaseModelButton, {
225-
flex: 1
226-
});
227-
*/
228201
return pricingUnitsLayout;
229202
},
203+
204+
__rentAnatomicalModel: function(anatomicalModelsData, pricingUnit) {
205+
console.log(":puschase", anatomicalModelsData["licensedItemId"], pricingUnit["pricingUnitId"]);
206+
},
230207
}
231208
});

0 commit comments

Comments
 (0)