Skip to content

Commit 5dd8efa

Browse files
Merge branch 'master' into introduce-vip-models-pricing-6-part
2 parents 68068fb + 95d208b commit 5dd8efa

File tree

16 files changed

+71
-115
lines changed

16 files changed

+71
-115
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
8585

8686
filterText: function(checks, text) {
8787
if (text) {
88-
const includesSome = checks.some(check => check.toLowerCase().trim().includes(text.toLowerCase()));
88+
const includesSome = checks.some(check => check && check.toLowerCase().trim().includes(text.toLowerCase()));
8989
return !includesSome;
9090
}
9191
return false;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,11 @@ qx.Class.define("osparc.data.Resources", {
418418
},
419419
getWithWallet: {
420420
method: "GET",
421-
url: statics.API + "/services/-/resource-usages?wallet_id={walletId}&offset={offset}&limit={limit}&filters={filters}&order_by={orderBy}"
421+
url: statics.API + "/services/-/resource-usages?wallet_id={walletId}&offset={offset}&limit={limit}"
422422
},
423-
getWithWallet2: {
423+
getWithWalletFiltered: {
424424
method: "GET",
425-
url: statics.API + "/services/-/resource-usages?wallet_id={walletId}&offset={offset}&limit={limit}"
425+
url: statics.API + "/services/-/resource-usages?wallet_id={walletId}&offset={offset}&limit={limit}&filters={filters}&order_by={orderBy}"
426426
},
427427
getUsagePerService: {
428428
method: "GET",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ qx.Class.define("osparc.data.model.IframeHandler", {
378378
const node = this.getNode();
379379
if (node.getServiceUrl() !== null) {
380380
// restart button pushed
381-
if (this.getIFrame().getSource().includes(node.getServiceUrl())) {
381+
if (this.getIFrame() && this.getIFrame().getSource().includes(node.getServiceUrl())) {
382382
this.__loadIframe();
383383
}
384384

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ qx.Class.define("osparc.data.model.Service", {
4343
bootOptions: serviceData.bootOptions,
4444
classifiers: serviceData.classifiers || [],
4545
quality: serviceData.quality || null,
46-
hits: serviceData.hits || 0
46+
xType: serviceData.xType || null,
47+
hits: serviceData.hits || 0,
4748
});
4849
},
4950

@@ -147,6 +148,13 @@ qx.Class.define("osparc.data.model.Service", {
147148
},
148149

149150
// ------ ignore for serializing ------
151+
xType: {
152+
check: "String",
153+
nullable: true,
154+
init: null,
155+
event: "changeXType",
156+
},
157+
150158
hits: {
151159
check: "Number",
152160
init: 0,
@@ -158,7 +166,8 @@ qx.Class.define("osparc.data.model.Service", {
158166

159167
statics: {
160168
IgnoreSerializationProps: [
161-
"hits"
169+
"xType",
170+
"hits",
162171
]
163172
},
164173

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,6 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
356356
this.__workbenchUI.openServiceCatalog({
357357
x: 50,
358358
y: 50
359-
}, {
360-
x: 50,
361-
y: 50
362359
});
363360
});
364361
homeAndNodesTree.add(addNewNodeBtn);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ qx.Class.define("osparc.desktop.credits.CurrentUsage", {
6666
limit: 10
6767
}
6868
};
69-
osparc.data.Resources.fetch("resourceUsage", "getWithWallet2", params)
69+
osparc.data.Resources.fetch("resourceUsage", "getWithWallet", params)
7070
.then(data => {
7171
const currentTasks = data.filter(d => (d.project_id === currentStudy.getUuid()) && d.service_run_status === "RUNNING");
7272
let cost = 0;

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ qx.Class.define("osparc.desktop.credits.UsageTable", {
114114
column: 7,
115115
label: qx.locale.Manager.tr("User"),
116116
width: 140
117-
}
117+
},
118+
TAGS: {
119+
id: "tags",
120+
column: 7,
121+
label: qx.locale.Manager.tr("Tags"),
122+
width: 140
123+
},
118124
}
119125
}
120126
});

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ qx.Class.define("osparc.desktop.credits.UsageTableModel", {
6060
// 4: (not used) SORTING BY DURATION
6161
5: "service_run_status",
6262
6: "credit_cost",
63-
7: "user_email"
63+
7: "user_email",
64+
8: "projects_tags",
6465
}
6566
},
6667

@@ -76,7 +77,7 @@ qx.Class.define("osparc.desktop.credits.UsageTableModel", {
7677

7778
// overridden
7879
_loadRowCount() {
79-
const endpoint = this.getWalletId() == null ? "get" : "getWithWallet"
80+
const endpoint = this.getWalletId() == null ? "get" : "getWithWalletFiltered"
8081
const params = {
8182
url: {
8283
walletId: this.getWalletId(),
@@ -109,7 +110,7 @@ qx.Class.define("osparc.desktop.credits.UsageTableModel", {
109110
const lastRow = Math.min(qxLastRow, this._rowCount - 1)
110111
// Returns a request promise with given offset and limit
111112
const getFetchPromise = (offset, limit=this.self().SERVER_MAX_LIMIT) => {
112-
const endpoint = this.getWalletId() == null ? "get" : "getWithWallet"
113+
const endpoint = this.getWalletId() == null ? "get" : "getWithWalletFiltered"
113114
return osparc.data.Resources.fetch("resourceUsage", endpoint, {
114115
url: {
115116
walletId: this.getWalletId(),
@@ -149,7 +150,8 @@ qx.Class.define("osparc.desktop.credits.UsageTableModel", {
149150
[usageCols.DURATION.id]: duration,
150151
[usageCols.STATUS.id]: qx.lang.String.firstUp(rawRow["service_run_status"].toLowerCase()),
151152
[usageCols.COST.id]: rawRow["credit_cost"] ? parseFloat(rawRow["credit_cost"]).toFixed(2) : "",
152-
[usageCols.USER.id]: rawRow["user_email"]
153+
[usageCols.USER.id]: rawRow["user_email"],
154+
[usageCols.TAGS.id]: rawRow["project_tags"],
153155
})
154156
})
155157
return data

services/static-webserver/client/source/class/osparc/filter/NodeTypeFilter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ qx.Class.define("osparc.filter.NodeTypeFilter", {
2727
* @extends osparc.filter.TagsFilter
2828
*/
2929
construct: function(filterId, filterGroupId) {
30-
this.base(arguments, this.tr("Service types"), filterId, filterGroupId);
30+
this.base(arguments, this.tr("Type"), filterId, filterGroupId);
3131
this._setLayout(new qx.ui.layout.HBox());
3232

3333
this.__buildMenu();

services/static-webserver/client/source/class/osparc/filter/group/ServiceFilterGroup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ qx.Class.define("osparc.filter.group.ServiceFilterGroup", {
2727
*/
2828
construct: function(filterGroupId) {
2929
this.base(arguments);
30-
this._setLayout(new qx.ui.layout.HBox(5));
30+
this._setLayout(new qx.ui.layout.HBox(10));
3131
this.__filterGroupId = filterGroupId;
3232
const textFilter = this.__textFilter = new osparc.filter.TextFilter("text", filterGroupId);
3333
osparc.utils.Utils.setIdToWidget(textFilter, "serviceFiltersTextFld");

0 commit comments

Comments
 (0)