Skip to content

Commit 4548d54

Browse files
committed
hacky-hacky
1 parent abaec30 commit 4548d54

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ qx.Class.define("osparc.jobs.ActivityCenterWindow", {
5858
stack.add(subRunsBrowser);
5959

6060
runsBrowser.addListener("runSelected", e => {
61-
const project = e.getData();
61+
const data = e.getData();
62+
const project = data["rowData"];
6263
subRunsBrowser.setProject(project);
6364
this.getChildControl("title").setValue(this.tr("Tasks"));
6465
stack.setSelection([subRunsBrowser]);

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,22 @@ qx.Class.define("osparc.jobs.ActivityOverview", {
5555
stack.add(tasksLayout);
5656

5757
this.__runsTable.addListener("runSelected", e => {
58-
const project = e.getData();
58+
const data = e.getData();
59+
// Hacky-hacky
60+
if (this.__runsTable.getTableModel().getRowCount() > 1) {
61+
const firstRow = this.__runsTable.getTableModel().getRowData(0);
62+
const secondRow = this.__runsTable.getTableModel().getRowData(1);
63+
if (
64+
data["rowIdx"] !== 0 &&
65+
firstRow["projectUuid"] === secondRow["projectUuid"]
66+
) {
67+
const msg = this.tr("Only the latest run's tasks are available");
68+
osparc.FlashMessenger.logAs(msg, "WARNING");
69+
return;
70+
}
71+
}
72+
73+
const project = data["rowData"];
5974
if (this.__subRunsTable) {
6075
tasksLayout.remove(this.__subRunsTable);
6176
this.__subRunsTable = null;
@@ -69,7 +84,7 @@ qx.Class.define("osparc.jobs.ActivityOverview", {
6984
tasksLayout.addListener("backToRuns", () => {
7085
stack.setSelection([runsHistoryLayout]);
7186
});
72-
});
87+
}, this);
7388
},
7489

7590
__createRunsHistoryView: function(projectData) {

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,19 @@ qx.Class.define("osparc.jobs.RunsTable", {
139139

140140
__attachHandlers: function() {
141141
this.addListener("cellTap", e => {
142-
const row = e.getRow();
142+
const rowIdx = e.getRow();
143143
const target = e.getOriginalTarget();
144144
if (target.closest(".qx-material-button") && (target.tagName === "IMG" || target.tagName === "DIV")) {
145145
const action = target.closest(".qx-material-button").getAttribute("data-action");
146146
if (action) {
147-
this.__handleButtonClick(action, row);
147+
this.__handleButtonClick(action, rowIdx);
148148
}
149149
} else {
150-
const rowData = this.getTableModel().getRowData(row);
151-
this.fireDataEvent("runSelected", rowData);
150+
const rowData = this.getTableModel().getRowData(rowIdx);
151+
this.fireDataEvent("runSelected", {
152+
rowData,
153+
rowIdx,
154+
});
152155
this.resetSelection();
153156
}
154157
});

0 commit comments

Comments
 (0)