Skip to content

Commit d8616dd

Browse files
committed
minors
1 parent bdfb4c8 commit d8616dd

File tree

2 files changed

+22
-32
lines changed

2 files changed

+22
-32
lines changed

services/static-webserver/client/source/class/osparc/desktop/credits/CheckoutsTableModel.js

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ qx.Class.define("osparc.desktop.credits.CheckoutsTableModel", {
2727
const colIDs = Object.values(checkoutsCols).map(col => col.id);
2828

2929
this.setColumns(colLabels, colIDs);
30-
this.setWalletId(walletId)
30+
this.setWalletId(walletId);
3131
if (filters) {
32-
this.setFilters(filters)
32+
this.setFilters(filters);
3333
}
3434
this.setSortColumnIndexWithoutSortingData(checkoutsCols.START.column);
3535
this.setSortAscendingWithoutSortingData(false);
@@ -41,22 +41,25 @@ qx.Class.define("osparc.desktop.credits.CheckoutsTableModel", {
4141
check: "Number",
4242
nullable: true
4343
},
44+
4445
filters: {
4546
check: "Object",
4647
init: null
4748
},
49+
4850
isFetching: {
4951
check: "Boolean",
5052
init: false,
5153
event: "changeFetching"
5254
},
55+
5356
orderBy: {
5457
check: "Object",
5558
init: {
5659
field: "startAt",
5760
direction: "desc"
5861
}
59-
}
62+
},
6063
},
6164

6265
statics: {
@@ -73,7 +76,7 @@ qx.Class.define("osparc.desktop.credits.CheckoutsTableModel", {
7376
field: this.self().COLUMN_ID_TO_DB_COLUMN_MAP[columnIndex],
7477
direction: ascending ? "asc" : "desc"
7578
})
76-
this.base(arguments, columnIndex, ascending)
79+
this.base(arguments, columnIndex, ascending);
7780
},
7881

7982
// overridden
@@ -93,12 +96,8 @@ qx.Class.define("osparc.desktop.credits.CheckoutsTableModel", {
9396
resolveWResponse: true
9497
};
9598
osparc.store.LicensedItems.getInstance().getCheckedOutLicensedItems(walletId, urlParams, options)
96-
.then(resp => {
97-
this._onRowCountLoaded(resp["_meta"].total)
98-
})
99-
.catch(() => {
100-
this._onRowCountLoaded(null)
101-
});
99+
.then(resp => this._onRowCountLoaded(resp["_meta"].total))
100+
.catch(() => this._onRowCountLoaded(null));
102101
},
103102

104103
// overridden
@@ -167,19 +166,15 @@ qx.Class.define("osparc.desktop.credits.CheckoutsTableModel", {
167166
requests.push(getFetchPromise(i, i > lastRow - this.self().SERVER_MAX_LIMIT + 1 ? reqLimit % this.self().SERVER_MAX_LIMIT : this.self().SERVER_MAX_LIMIT))
168167
}
169168
Promise.all(requests)
170-
.then(responses => {
171-
this._onRowDataLoaded(responses.flat());
172-
})
169+
.then(responses => this._onRowDataLoaded(responses.flat()))
173170
.catch(err => {
174171
console.error(err);
175172
this._onRowDataLoaded(null);
176173
})
177174
.finally(() => this.setIsFetching(false));
178175
} else {
179176
getFetchPromise(firstRow, reqLimit)
180-
.then(data => {
181-
this._onRowDataLoaded(data);
182-
})
177+
.then(data => this._onRowDataLoaded(data))
183178
.catch(err => {
184179
console.error(err)
185180
this._onRowDataLoaded(null);

services/static-webserver/client/source/class/osparc/desktop/credits/PurchasesTableModel.js

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ qx.Class.define("osparc.desktop.credits.PurchasesTableModel", {
2727
const colIDs = Object.values(purchasesCols).map(col => col.id);
2828

2929
this.setColumns(colLabels, colIDs);
30-
this.setWalletId(walletId)
30+
this.setWalletId(walletId);
3131
if (filters) {
32-
this.setFilters(filters)
32+
this.setFilters(filters);
3333
}
3434
this.setSortColumnIndexWithoutSortingData(purchasesCols.START.column);
3535
this.setSortAscendingWithoutSortingData(false);
@@ -40,22 +40,25 @@ qx.Class.define("osparc.desktop.credits.PurchasesTableModel", {
4040
check: "Number",
4141
nullable: true
4242
},
43+
4344
filters: {
4445
check: "Object",
4546
init: null
4647
},
48+
4749
isFetching: {
4850
check: "Boolean",
4951
init: false,
5052
event: "changeFetching"
5153
},
54+
5255
orderBy: {
5356
check: "Object",
5457
init: {
5558
field: "startAt",
5659
direction: "desc"
5760
}
58-
}
61+
},
5962
},
6063

6164
statics: {
@@ -72,7 +75,7 @@ qx.Class.define("osparc.desktop.credits.PurchasesTableModel", {
7275
field: this.self().COLUMN_ID_TO_DB_COLUMN_MAP[columnIndex],
7376
direction: ascending ? "asc" : "desc"
7477
})
75-
this.base(arguments, columnIndex, ascending)
78+
this.base(arguments, columnIndex, ascending);
7679
},
7780

7881
// overridden
@@ -92,12 +95,8 @@ qx.Class.define("osparc.desktop.credits.PurchasesTableModel", {
9295
resolveWResponse: true
9396
};
9497
osparc.store.LicensedItems.getInstance().getPurchasedLicensedItems(walletId, urlParams, options)
95-
.then(resp => {
96-
this._onRowCountLoaded(resp["_meta"].total)
97-
})
98-
.catch(() => {
99-
this._onRowCountLoaded(null)
100-
});
98+
.then(resp => this._onRowCountLoaded(resp["_meta"].total))
99+
.catch(() => this._onRowCountLoaded(null));
101100
},
102101

103102
// overridden
@@ -159,19 +158,15 @@ qx.Class.define("osparc.desktop.credits.PurchasesTableModel", {
159158
requests.push(getFetchPromise(i, i > lastRow - this.self().SERVER_MAX_LIMIT + 1 ? reqLimit % this.self().SERVER_MAX_LIMIT : this.self().SERVER_MAX_LIMIT))
160159
}
161160
Promise.all(requests)
162-
.then(responses => {
163-
this._onRowDataLoaded(responses.flat());
164-
})
161+
.then(responses => this._onRowDataLoaded(responses.flat()))
165162
.catch(err => {
166163
console.error(err);
167164
this._onRowDataLoaded(null);
168165
})
169166
.finally(() => this.setIsFetching(false));
170167
} else {
171168
getFetchPromise(firstRow, reqLimit)
172-
.then(data => {
173-
this._onRowDataLoaded(data);
174-
})
169+
.then(data => this._onRowDataLoaded(data))
175170
.catch(err => {
176171
console.error(err)
177172
this._onRowDataLoaded(null);

0 commit comments

Comments
 (0)