Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #66 from 18F/fixes
Browse files Browse the repository at this point in the history
Added confirmation dialogs for destructive app actions
  • Loading branch information
jcscottiii committed Aug 13, 2015
2 parents bcd0b9b + 61b0c90 commit 9c135e2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
4 changes: 3 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"angular-route": "~1.4.3",
"angular-mocks": "~1.4.3",
"angularjs": "~1.4.3",
"bootstrap": "~3.3.5"
"bootstrap": "~3.3.5",
"angular-bootstrap-confirm": "~0.3.0",
"angular-sanitize": "~1.4.3"
}
}
3 changes: 3 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module.exports = function(config) {
'static/bower_components/ladda/dist/spin.min.js',
'static/bower_components/ladda/dist/ladda.min.js',
'static/bower_components/angular-ladda/dist/angular-ladda.min.js',
'static/bower_components/angular-sanitize/angular-sanitize.js',
'static/bower_components/angular-bootstrap-confirm/src/ui-bootstrap-position.js',
'static/bower_components/angular-bootstrap-confirm/dist/angular-bootstrap-confirm.min.js',
'static/app/main.js',
'static/app/filters.js',
'static/app/cloudfoundry.js',
Expand Down
2 changes: 1 addition & 1 deletion static/app/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function() {
var app = angular.module('cfdeck', ['ngRoute', 'angular-ladda']);
var app = angular.module('cfdeck', ['ngRoute', 'angular-ladda', 'ngSanitize', 'mwl.confirm']);

app.config(function($routeProvider) {
$routeProvider
Expand Down
10 changes: 8 additions & 2 deletions static/app/views/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ <h3 class="panel-title">Actions</h3>
<div ng-switch="appSummary.state">
<div ng-switch-when='STARTED'>
<button type="button" ladda="restarting" class="btn btn-warning" ng-disabled="stopping"
ng-click="restartApp(appSummary)">Restart</button>
mwl-confirm title="Warning!" message="Are you sure you want to interrupt connectivity to the application?"
on-confirm="restartApp(appSummary)" confirm-button-type="danger" cancel-button-type="default">
Restart
</button>
<button type="button" ladda="stopping" class="btn btn-danger" ng-disabled="restarting"
ng-click="stopApp(appSummary)">Stop</button>
mwl-confirm title="Warning!" message="Are you sure you want to stop connectivity to the application?"
on-confirm="stopApp(appSummary)" confirm-button-type="danger" cancel-button-type="default">
Stop
</button>
</div>
<div ng-switch-when='STOPPED'>
<button type="button" ladda="starting" class="btn btn-success" ng-disabled="restarting"
Expand Down
3 changes: 3 additions & 0 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<script src="bower_components/ladda/dist/spin.min.js"></script>
<script src="bower_components/ladda/dist/ladda.min.js"></script>
<script src="bower_components/angular-ladda/dist/angular-ladda.min.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-bootstrap-confirm/src/ui-bootstrap-position.js"></script>
<script src="bower_components/angular-bootstrap-confirm/dist/angular-bootstrap-confirm.min.js"></script>

<script src="app/main.js"></script>
<script src="app/cloudfoundry.js"></script>
Expand Down

0 comments on commit 9c135e2

Please sign in to comment.