Skip to content

Commit

Permalink
rentAnatomicalModel
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Dec 5, 2024
1 parent 3a98dc5 commit 7e95307
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,11 @@ qx.Class.define("osparc.data.Resources", {
get: {
method: "GET",
url: statics.API + "/catalog/licensed-items"
}
},
purchase: {
method: "GET",
url: statics.API + "/catalog/licensed-items/{licensedItemId}:purchase"
},
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ qx.Class.define("osparc.study.PricingUnit", {
},

events: {
"editPricingUnit": "qx.event.type.Event"
"editPricingUnit": "qx.event.type.Event",
"rentPricingUnit": "qx.event.type.Event",
},

properties: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,40 +192,17 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
showRentButton: true,
allowGrowY: false
});
pUnit.addListener("rentPricingUnit", () => this.__rentAnatomicalModel(anatomicalModelsData, pricingUnit));
pricingUnitsLayout.add(pUnit);
});
})
.catch(err => console.error(err));

/*
if (anatomicalModelsData["leased"]) {
const leaseModelButton = new qx.ui.form.Button().set({
label: this.tr("3 seats Leased (27 days left)"),
appearance: "strong-button",
center: true,
enabled: false,
});
buttonsLayout.add(leaseModelButton, {
flex: 1
});
}
const leaseModelButton = new osparc.ui.form.FetchButton().set({
label: this.tr("Lease model (2 for months)"),
appearance: "strong-button",
center: true,
});
leaseModelButton.addListener("execute", () => {
leaseModelButton.setFetching(true);
setTimeout(() => {
leaseModelButton.setFetching(false);
this.fireDataEvent("modelLeased", this.getAnatomicalModelsData()["modelId"]);
}, 2000);
});
buttonsLayout.add(leaseModelButton, {
flex: 1
});
*/
return pricingUnitsLayout;
},

__rentAnatomicalModel: function(anatomicalModelsData, pricingUnit) {
console.log(":puschase", anatomicalModelsData["licensedItemId"], pricingUnit["pricingUnitId"]);
},
}
});

0 comments on commit 7e95307

Please sign in to comment.