-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show confirmation dialog when deleting workflow run
- Loading branch information
1 parent
60e46f1
commit 26d0b16
Showing
3 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
rodan-client/code/src/js/Views/Master/Dialog/ViewConfirmationDialog.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import $ from 'jquery'; | ||
import _ from 'underscore'; | ||
import RODAN_EVENTS from 'js/Shared/RODAN_EVENTS'; | ||
import Marionette from 'backbone.marionette'; | ||
import Radio from 'backbone.radio'; | ||
|
||
/** | ||
* Password view. | ||
*/ | ||
export default class ViewConfirmationDialog extends Marionette.CollectionView | ||
{ | ||
initialize(options) | ||
{ | ||
this._message = options.message; | ||
this._onConfirm = options.onConfirm; | ||
} | ||
|
||
templateContext() | ||
{ | ||
return { | ||
message: this._message | ||
}; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////////////// | ||
// PRIVATE METHODS | ||
/////////////////////////////////////////////////////////////////////////////////////// | ||
_handleButtonConfirm() | ||
{ | ||
this._onConfirm(); | ||
} | ||
|
||
_handleButtonCancel() | ||
{ | ||
Radio.channel("rodan").request(RODAN_EVENTS.REQUEST__MODAL_HIDE); | ||
} | ||
|
||
} | ||
|
||
ViewConfirmationDialog.prototype.modelEvents = { | ||
'all': 'render' | ||
}; | ||
|
||
ViewConfirmationDialog.prototype.ui = { | ||
buttonConfirm: '#button-confirm', | ||
buttonCancel: '#button-cancel' | ||
}; | ||
|
||
ViewConfirmationDialog.prototype.events = { | ||
'click @ui.buttonConfirm': '_handleButtonConfirm', | ||
'click @ui.buttonCancel': '_handleButtonCancel' | ||
}; | ||
|
||
ViewConfirmationDialog.prototype.template = _.template($('#template-dialog_confirm').text()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
rodan-client/code/templates/Views/Master/Main/Dialog/template-dialog_confirm.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="fixed_individual"> | ||
<p><%- message %></p> | ||
<br> | ||
<button class="btn btn-xs btn-warning" id="button-cancel">Cancel</button> | ||
<button class="btn btn-xs btn-danger" id="button-confirm">Confirm</button> | ||
</div> |