Skip to content

Commit e95e772

Browse files
committed
getSelectedUnit
1 parent 02ea277 commit e95e772

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,8 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
790790
if (selectedPricingUnitId) {
791791
const nodeId = nodesIdsListed[idx];
792792
const pricingPlanId = nodePricingUnits.getPricingPlanId();
793-
promises.push(osparc.store.Study.updateSelectedPricingUnit(studyId, nodeId, pricingPlanId, selectedPricingUnitId));
793+
const selectedUnit = nodePricingUnits.getPricingUnits().getSelectedUnit();
794+
promises.push(osparc.store.Study.updateSelectedPricingUnit(studyId, nodeId, pricingPlanId, selectedUnit));
794795
}
795796
});
796797

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,13 @@ qx.Class.define("osparc.study.PricingUnitTiers", {
8484
// select and unselect the rest
8585
this.__pricingUnitTiers.forEach(puTIer => puTIer.setSelected(puTIer.getUnitData().getPricingUnitId() === selectedUnitId));
8686
},
87+
88+
getSelectedUnit: function() {
89+
const selectedUnitTier = this.__pricingUnitTiers.find(puTier => puTier.isSelected());
90+
if (selectedUnitTier) {
91+
return selectedUnitTier.getUnitData();
92+
}
93+
return null;
94+
},
8795
}
8896
});

0 commit comments

Comments
 (0)