Skip to content

Commit 9b6ab50

Browse files
committed
Confirmation
1 parent 25a5e7d commit 9b6ab50

File tree

1 file changed

+24
-7
lines changed
  • services/static-webserver/client/source/class/osparc/jobs

1 file changed

+24
-7
lines changed

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

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,22 +150,39 @@ qx.Class.define("osparc.jobs.RunsTable", {
150150
break;
151151
}
152152
case "cancel": {
153+
this.__cancelRun(rowData);
154+
break;
155+
}
156+
default:
157+
console.warn(`Unknown action: ${action}`);
158+
}
159+
},
160+
161+
__cancelRun: function(rowData) {
162+
const msg = this.tr("Are you sure you want to cancel") + " <b>" + rowData["projectName"] + "</b>?";
163+
const confirmationWin = new osparc.ui.window.Confirmation(msg).set({
164+
caption: this.tr("Cancel Run"),
165+
confirmText: this.tr("Cancel"),
166+
confirmAction: "delete",
167+
});
168+
confirmationWin.getChildControl("cancel-button").set({
169+
label: this.tr("Close"),
170+
});
171+
confirmationWin.center();
172+
confirmationWin.open();
173+
confirmationWin.addListener("close", () => {
174+
if (confirmationWin.getConfirmed()) {
153175
const params = {
154176
url: {
155177
"studyId": rowData["projectUuid"],
156178
},
157179
};
158180
osparc.data.Resources.fetch("runPipeline", "stopPipeline", params)
159-
.then(() => {
160-
const msg = this.tr("Stopping pipeline");
161-
osparc.FlashMessenger.logAs(msg, "INFO");
162-
})
181+
.then(() => osparc.FlashMessenger.logAs(this.tr("Stopping pipeline"), "INFO"))
163182
.catch(err => osparc.FlashMessenger.logError(err));
164-
break;
165183
}
166-
default:
167-
console.warn(`Unknown action: ${action}`);
168184
}
185+
, this);
169186
},
170187
}
171188
});

0 commit comments

Comments
 (0)