Skip to content

Commit

Permalink
Added Challenge for bulk message retries
Browse files Browse the repository at this point in the history
fixes #171
  • Loading branch information
Pete committed Aug 5, 2015
1 parent b1ea0e2 commit 58f81a9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/ServicePulse.Host/ServicePulse.Host.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<Content Include="app\js\directives\ngClip.js" />
<Content Include="app\js\directives\productVersion.js" />
<Content Include="app\js\directives\productVersion.tpl.html" />
<Content Include="app\js\directives\ui.particular.confirmclick.js" />
<Content Include="app\js\directives\ui.particular.js" />
<Content Include="app\js\event_log_items\eventLogItems.tpl.html" />
<Content Include="app\js\custom_checks\customChecks.js" />
Expand Down
1 change: 1 addition & 0 deletions src/ServicePulse.Host/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ <h4 class="alert-heading">Warning!</h4>
<script src="js/directives/hud.js"></script>
<script src="js/directives/productVersion.js"></script>
<script src="js/directives/ui.particular.js"></script>
<script src="js/directives/ui.particular.confirmclick.js"></script>
<script src="js/directives/eat.click.js"></script>
<script src="js/event_log_items/eventLogItems.js"></script>
<script src="js/dashboard/dashboard.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(function() {
'use strict';

angular
.module('ui.particular.confirmClick',[])
.directive('confirmClick', function confirmClick() {

function link(scope, element, attrs) {
element.bind('click', function (e) {
var message = attrs.confirmClick;
if (message && !confirm(message)) {
e.stopImmediatePropagation();
e.preventDefault();
}
});
}

var directive = {
priority: -1,
link: link,
restrict: 'EA'
};

return directive;
});
})();
2 changes: 1 addition & 1 deletion src/ServicePulse.Host/app/js/directives/ui.particular.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
All our UI Directives will go here
*/
angular.module("ui.particular", []);
angular.module("ui.particular", ['ui.particular.confirmClick']);
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h2><i class="fa fa-envelope"></i><span class="break"></span>Showing {{model.exc

<div class="alert alert-error alert-block">
<p class="pull-right">
<button class="btn btn-danger" type="button" ng-click="retryAll()" ng-disabled="allFailedMessagesGroup.count == 0" tooltip="All failed messages will be Retried"><i class="fa fa-refresh white"></i> Retry {{allFailedMessagesGroup.count}} Failed Messages</button>
<button class="btn btn-danger" type="button" confirm-click="Are you really sure you want to retry {{allFailedMessagesGroup.count}} messages?" ng-click="retryAll()" ng-disabled="allFailedMessagesGroup.count == 0" tooltip="All failed messages will be Retried"><i class="fa fa-refresh white"></i> Retry {{allFailedMessagesGroup.count}} Failed Messages</button>
<button class="btn" type="button" ng-click="selectGroup(allFailedMessagesGroup)" tooltip="Review all Messages"><i class="fa fa-envelope"></i> View All Failed Messages</button>
</p>
<p><H4>Warning!</H4> Retrying all messages can be a time consuming operation. Take care when doing this.</p>
Expand Down

0 comments on commit 58f81a9

Please sign in to comment.