Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/github_actions/actions/setup-no…
Browse files Browse the repository at this point in the history
…de-4.0.4
  • Loading branch information
pcrespov authored Sep 23, 2024
2 parents 9d398bc + 38e128d commit e0ea736
Showing 1 changed file with 5 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ qx.Class.define("osparc.study.StudyPricingUnits", {

this.__studyData = studyData;

this.showPricingUnits();
this.__showPricingUnits();
},

events: {
Expand All @@ -38,7 +38,7 @@ qx.Class.define("osparc.study.StudyPricingUnits", {
members: {
__studyData: null,

showPricingUnits: function() {
__showPricingUnits: function() {
const unitsLoading = () => this.fireEvent("loadingUnits");
const unitsAdded = () => this.fireEvent("unitsReady");
unitsLoading();
Expand All @@ -48,40 +48,16 @@ qx.Class.define("osparc.study.StudyPricingUnits", {
const workbench = this.__studyData["workbench"];
Object.keys(workbench).forEach(nodeId => {
const node = workbench[nodeId];
if (osparc.data.model.Node.isFrontend(node)) {
return;
}
const nodePricingUnits = new osparc.study.NodePricingUnits(this.__studyData["uuid"], nodeId, node);
this._add(nodePricingUnits);
promises.push(nodePricingUnits.showPricingUnits());
});
}
Promise.all(promises)
.then(() => unitsAdded());
},

__createPricingUnitsGroup: function(nodeLabel, pricingPlans, preselectedPricingUnit) {
if (pricingPlans && "pricingUnits" in pricingPlans && pricingPlans["pricingUnits"].length) {
const pricingUnitsLayout = osparc.study.StudyOptions.createGroupBox(nodeLabel);

const unitButtons = new osparc.study.PricingUnits(pricingPlans["pricingUnits"], preselectedPricingUnit);
pricingUnitsLayout.add(unitButtons);

return {
layout: pricingUnitsLayout,
unitButtons
};
}
return null;
},

__pricingUnitSelected: function(nodeId, pricingPlanId, selectedPricingUnitId) {
const params = {
url: {
studyId: this.__studyData["uuid"],
nodeId,
pricingPlanId,
pricingUnitId: selectedPricingUnitId
}
};
return osparc.data.Resources.fetch("studies", "putPricingUnit", params);
}
}
});

0 comments on commit e0ea736

Please sign in to comment.