Skip to content

Commit

Permalink
Update locales
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Jul 3, 2024
1 parent 7baf02e commit 22f41a1
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 76 deletions.
16 changes: 13 additions & 3 deletions app/static/app/js/components/TaskListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class TaskListItem extends React.Component {
return items;
}

genRestartAction(rerunFrom = null){
genRestartAction(rerunFrom = null, options = {}){
const { task } = this.state;

const restartAction = this.genActionApiCall("restart", {
Expand Down Expand Up @@ -388,10 +388,20 @@ class TaskListItem extends React.Component {
});
};

return () => {
let doAction = () => {
setTaskRerunFrom(rerunFrom)
.then(restartAction);
};

return () => {
if (options.confirm){
if (window.confirm(options.confirm)){
doAction();
}
}else{
doAction();
}
};
}

moveTaskAction = (formData) => {
Expand Down Expand Up @@ -485,7 +495,7 @@ class TaskListItem extends React.Component {
task.can_rerun_from[1] :
null;

addActionButton(_("Restart"), "btn-primary", "glyphicon glyphicon-repeat", this.genRestartAction(rerunFrom), {
addActionButton(_("Restart"), "btn-primary", "glyphicon glyphicon-repeat", this.genRestartAction(rerunFrom, {confirm: _("Are you sure you want to restart this task?")}), {
subItems: this.getRestartSubmenuItems()
});
}
Expand Down
Loading

0 comments on commit 22f41a1

Please sign in to comment.