Skip to content

Commit 3132e72

Browse files
committed
minor
1 parent a723a3c commit 3132e72

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

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

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,27 @@ qx.Class.define("osparc.dashboard.TemplateBrowser", {
346346
// MENU //
347347

348348
// TASKS //
349+
__tasksToCards: function() {
350+
const tasks = osparc.store.PollTasks.getInstance().getPublishTemplateTasks();
351+
tasks.forEach(task => {
352+
const studyName = "";
353+
this.taskToTemplateReceived(task, studyName);
354+
});
355+
},
356+
357+
taskToTemplateReceived: function(task, studyName) {
358+
const toTemplateTaskUI = new osparc.task.ToTemplate(studyName);
359+
toTemplateTaskUI.setTask(task);
360+
361+
osparc.task.TasksContainer.getInstance().addTaskUI(toTemplateTaskUI);
362+
363+
const cardTitle = this.tr("Publishing ") + studyName;
364+
const toTemplateCard = this._addTaskCard(task, cardTitle, osparc.task.ToTemplate.ICON);
365+
if (toTemplateCard) {
366+
this.__attachToTemplateEventHandler(task, toTemplateTaskUI, toTemplateCard);
367+
}
368+
},
369+
349370
__attachToTemplateEventHandler: function(task, taskUI, toTemplateCard) {
350371
const finished = (msg, msgLevel) => {
351372
if (msg) {
@@ -372,7 +393,8 @@ qx.Class.define("osparc.dashboard.TemplateBrowser", {
372393
}
373394
}, this);
374395
task.addListener("resultReceived", e => {
375-
finished();
396+
const msg = this.tr("Template created");
397+
finished(msg, "INFO");
376398
this.reloadResources();
377399
});
378400
task.addListener("pollingError", e => {
@@ -381,27 +403,6 @@ qx.Class.define("osparc.dashboard.TemplateBrowser", {
381403
finished(msg, "ERROR");
382404
});
383405
},
384-
385-
__tasksToCards: function() {
386-
const tasks = osparc.store.PollTasks.getInstance().getPublishTemplateTasks();
387-
tasks.forEach(task => {
388-
const studyName = "";
389-
this.taskToTemplateReceived(task, studyName);
390-
});
391-
},
392-
393-
taskToTemplateReceived: function(task, studyName) {
394-
const toTemplateTaskUI = new osparc.task.ToTemplate(studyName);
395-
toTemplateTaskUI.setTask(task);
396-
397-
osparc.task.TasksContainer.getInstance().addTaskUI(toTemplateTaskUI);
398-
399-
const cardTitle = this.tr("Publishing ") + studyName;
400-
const toTemplateCard = this._addTaskCard(task, cardTitle, osparc.task.ToTemplate.ICON);
401-
if (toTemplateCard) {
402-
this.__attachToTemplateEventHandler(task, toTemplateTaskUI, toTemplateCard);
403-
}
404-
},
405406
// TASKS //
406407
}
407408
});

0 commit comments

Comments
 (0)