Skip to content

Commit beccf2d

Browse files
committed
renaming
1 parent a51c8a1 commit beccf2d

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
4949
if (anatomicalModelsData) {
5050
const modelInfo = this.__createModelInfo(anatomicalModelsData);
5151
const pricingUnits = this.__createPricingUnits(anatomicalModelsData);
52-
const purchasedSection = this.__createPurchasesSection(anatomicalModelsData);
52+
const purchasesSection = this.__createPurchasesSection(anatomicalModelsData);
5353
const importButton = this.__createImportButton(anatomicalModelsData);
5454
this._add(modelInfo);
5555
this._add(pricingUnits);
56-
this._add(purchasedSection);
56+
this._add(purchasesSection);
5757
this._add(importButton);
5858
} else {
5959
const selectModelLabel = new qx.ui.basic.Label().set({
@@ -224,7 +224,7 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
224224
center: true,
225225
maxWidth: 200,
226226
alignX: "center",
227-
visibility: anatomicalModelsData["purchased"].length ? "visible" : "excluded",
227+
visibility: anatomicalModelsData["purchases"].length ? "visible" : "excluded",
228228
});
229229
importButton.addListener("execute", () => {
230230
this.fireDataEvent("modelImportRequested", {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelListItem", {
9797
event: "changePricingPlanId",
9898
},
9999

100-
purchased: {
100+
purchases: {
101101
check: "Array",
102102
nullable: false,
103103
init: [],
104-
event: "changePurchased",
105-
apply: "__applyPurchased",
104+
event: "changePurchases",
105+
apply: "__applyPurchases",
106106
},
107107
},
108108

@@ -161,7 +161,7 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelListItem", {
161161
this.getChildControl("name").setValue(value);
162162
},
163163

164-
__applyPurchased: function(purchases) {
164+
__applyPurchases: function(purchases) {
165165
if (purchases.length) {
166166
this.setBackgroundColor("strong-main");
167167
}

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
6464

6565
members: {
6666
__anatomicalModels: null,
67-
__purchasedItems: null,
67+
__purchasesItems: null,
6868
__anatomicalModelsModel: null,
6969

7070
_createChildControlImpl: function(id) {
@@ -150,7 +150,7 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
150150
ctrl.bindProperty("date", "date", null, item, id);
151151
ctrl.bindProperty("licensedItemId", "licensedItemId", null, item, id);
152152
ctrl.bindProperty("pricingPlanId", "pricingPlanId", null, item, id);
153-
ctrl.bindProperty("purchased", "purchased", null, item, id);
153+
ctrl.bindProperty("purchases", "purchases", null, item, id);
154154
},
155155
configureItem: item => {
156156
item.subscribeToFilterGroup("vipModels");
@@ -205,8 +205,8 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
205205
])
206206
.then(values => {
207207
const licensedItems = values[0];
208-
const purchasedItems = values[1];
209-
this.__purchasedItems = purchasedItems;
208+
const purchasesItems = values[1];
209+
this.__purchasesItems = purchasesItems;
210210

211211
this.__anatomicalModels = [];
212212
allAnatomicalModels.forEach(model => {
@@ -225,13 +225,13 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
225225
anatomicalModel["licensedItemId"] = licensedItem["licensedItemId"];
226226
anatomicalModel["pricingPlanId"] = licensedItem["pricingPlanId"];
227227
// attach leased data
228-
anatomicalModel["purchased"] = []; // default
229-
const purchasedItemsFound = purchasedItems.filter(purchasedItem => purchasedItem["licensedItemId"] === licensedItem["licensedItemId"]);
230-
if (purchasedItemsFound.length) {
231-
purchasedItemsFound.forEach(purchasedItemFound => {
232-
anatomicalModel["purchased"].push({
233-
expiresAt: new Date(purchasedItemFound["expireAt"]),
234-
numberOfSeats: purchasedItemFound["numOfSeats"],
228+
anatomicalModel["purchases"] = []; // default
229+
const purchasesItemsFound = purchasesItems.filter(purchasesItem => purchasesItem["licensedItemId"] === licensedItem["licensedItemId"]);
230+
if (purchasesItemsFound.length) {
231+
purchasesItemsFound.forEach(purchasesItemFound => {
232+
anatomicalModel["purchases"].push({
233+
expiresAt: new Date(purchasesItemFound["expireAt"]),
234+
numberOfSeats: purchasesItemFound["numOfSeats"],
235235
})
236236
});
237237
}
@@ -275,7 +275,7 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
275275
if (found) {
276276
const expirationDate = new Date();
277277
expirationDate.setMonth(expirationDate.getMonth() + 1)
278-
found["purchased"].push({
278+
found["purchases"].push({
279279
expiresAt: expirationDate, // get this info from the response
280280
numberOfSeats, // get this info from the response
281281
});
@@ -307,9 +307,9 @@ qx.Class.define("osparc.vipMarket.VipMarket", {
307307
const sortModel = sortBy => {
308308
models.sort((a, b) => {
309309
// first criteria
310-
if (b["purchased"].length !== a["purchased"].length) {
310+
if (b["purchases"].length !== a["purchases"].length) {
311311
// leased first
312-
return b["purchased"].length - a["purchased"].length;
312+
return b["purchases"].length - a["purchases"].length;
313313
}
314314
// second criteria
315315
if (sortBy) {

0 commit comments

Comments
 (0)