Skip to content

Commit a0ec134

Browse files
authored
Merge branch 'master' into add_funccoll_filter
2 parents 47cf30e + e5ef303 commit a0ec134

File tree

5 files changed

+36
-14
lines changed

5 files changed

+36
-14
lines changed

services/static-webserver/client/source/class/osparc/jobs/SubRunsTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ qx.Class.define("osparc.jobs.SubRunsTable", {
173173
}
174174
const logDownloadLink = subJob.getLogDownloadLink()
175175
if (logDownloadLink) {
176-
osparc.utils.Utils.downloadLink(logDownloadLink, "GET", rowData["nodeName"] + ".logs");
176+
osparc.utils.Utils.downloadLink(logDownloadLink, "GET", rowData["nodeName"] + ".zip");
177177
} else {
178178
osparc.FlashMessenger.logAs(this.tr("No logs available"), "WARNING");
179179
}

services/static-webserver/client/source/class/osparc/notification/NotificationUI.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,13 @@ qx.Class.define("osparc.notification.NotificationUI", {
169169
case "TEMPLATE_SHARED":
170170
icon.setSource("@FontAwesome5Solid/copy/14");
171171
if (resourceId) {
172-
const template = osparc.store.Templates.getTemplate(resourceId);
173-
if (template) {
174-
const templateAlias = osparc.product.Utils.getTemplateAlias({
175-
firstUpperCase: true
176-
});
177-
titleLabel.setValue(`${templateAlias} '${template["name"]}'`);
178-
} else {
179-
this.setEnabled(false);
180-
}
172+
osparc.store.Templates.fetchTemplate(resourceId)
173+
.then(templateData => {
174+
if (templateData) {
175+
titleLabel.setValue(templateData["name"]);
176+
}
177+
})
178+
.catch(() => this.setEnabled(false));
181179
}
182180
if (userFromId) {
183181
const user = osparc.store.Groups.getInstance().getUserByUserId(userFromId);

services/static-webserver/client/source/class/osparc/pricing/UnitEditor.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,8 @@ qx.Class.define("osparc.pricing.UnitEditor", {
388388
__updatePricingUnit: function() {
389389
const data = {
390390
"unitName": this.getUnitName(),
391-
"pricingUnitCostUpdate": {
392-
"costPerUnit": this.getCostPerUnit(),
393-
"comment": this.getComment(),
394-
},
391+
"costPerUnit": this.getCostPerUnit(),
392+
"comment": this.getComment(),
395393
"default": this.getDefault(),
396394
};
397395

services/static-webserver/client/source/class/osparc/store/Templates.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ qx.Class.define("osparc.store.Templates", {
4343
return this.__fetchTemplatesPaginated(params, options);
4444
},
4545

46+
fetchTemplate: function(templateId) {
47+
const params = {
48+
url: {
49+
"studyId": templateId,
50+
}
51+
};
52+
return osparc.data.Resources.fetch("studies", "getOne", params)
53+
.catch(err => console.error(err));
54+
},
55+
4656
__fetchAllTutorials: function() {
4757
const params = {
4858
url: {

services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,22 @@ qx.Class.define("osparc.widget.PersistentIframe", {
328328
}
329329
break;
330330
}
331+
case "openFunction": {
332+
// this is the MetaModeling service trying to show function/template information
333+
if (data["message"] && data["message"]["functionId"]) {
334+
const templateId = data["message"]["functionId"];
335+
osparc.store.Templates.fetchTemplate(templateId)
336+
.then(templateData => {
337+
templateData["resourceType"] = "template";
338+
const resourceDetails = new osparc.dashboard.ResourceDetails(templateData).set({
339+
showOpenButton: false,
340+
});
341+
osparc.dashboard.ResourceDetails.popUpInWindow(resourceDetails);
342+
})
343+
.catch(() => osparc.FlashMessenger.logError(this.tr("Function not found")));
344+
}
345+
break;
346+
}
331347
}
332348
}
333349
},

0 commit comments

Comments
 (0)