Skip to content

Commit 7109bbb

Browse files
committed
purchased
1 parent 7e8355a commit 7109bbb

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,12 @@ qx.Class.define("osparc.data.model.PricingUnit", {
8787
init: null,
8888
event: "changeSpecificInfo",
8989
},
90+
91+
purchased: {
92+
check: "Boolean",
93+
nullable: true,
94+
init: false,
95+
event: "changePurchased",
96+
},
9097
},
9198
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
2828
},
2929

3030
events: {
31-
"modelLeased": "qx.event.type.Event",
31+
"modelPurchased": "qx.event.type.Event",
3232
},
3333

3434
properties: {

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
4747
curatedModel[key] = model[key];
4848
}
4949
if (key === "ID") {
50-
curatedModel["leased"] = model["ID"] < 4;
50+
curatedModel["purchased"] = model["ID"] < 4;
5151
}
5252
});
5353
anatomicalModels.push(curatedModel);
@@ -116,7 +116,7 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
116116
ctrl.bindProperty("date", "date", null, item, id);
117117
ctrl.bindProperty("licensedItemId", "licensedItemId", null, item, id);
118118
ctrl.bindProperty("pricingPlanId", "pricingPlanId", null, item, id);
119-
ctrl.bindProperty("leased", "leased", null, item, id);
119+
ctrl.bindProperty("purchased", "purchased", null, item, id);
120120
},
121121
configureItem: item => {
122122
item.subscribeToFilterGroup("vipModels");
@@ -178,18 +178,18 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
178178
anatomicalModel["licensedItemId"] = licensedItem["licensedItemId"];
179179
anatomicalModel["pricingPlanId"] = licensedItem["pricingPlanId"];
180180
// attach leased data
181-
anatomicalModel["leased"] = model["leased"];
181+
anatomicalModel["purchased"] = model["purchased"];
182182
this.__anatomicalModels.push(anatomicalModel);
183183
}
184184
});
185185

186186
this.__populateModels();
187187

188-
anatomicModelDetails.addListener("modelLeased", e => {
188+
anatomicModelDetails.addListener("modelPurchased", e => {
189189
const modelId = e.getData();
190190
const found = this.__anatomicalModels.find(model => model["ID"] === modelId);
191191
if (found) {
192-
found["leased"] = true;
192+
found["purchased"] = true;
193193
this.__populateModels();
194194
anatomicModelDetails.setAnatomicalModelsData(found);
195195
}
@@ -206,9 +206,9 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
206206
const sortModel = sortBy => {
207207
models.sort((a, b) => {
208208
// first criteria
209-
if (b["leased"] !== a["leased"]) {
209+
if (b["purchased"] !== a["purchased"]) {
210210
// leased first
211-
return b["leased"] - a["leased"];
211+
return b["purchased"] - a["purchased"];
212212
}
213213
// second criteria
214214
if (sortBy) {

0 commit comments

Comments
 (0)