feat(full-stack): disable notifications after 3 failures
This stops notifications from firing over and over again if they are repeatedly failing. [TESTING -> locally with docker compose, DATABASE MIGRATION -> there is a single migration] Issue: https://www.pivotaltracker.com/story/show/b144646649n - [ ] It works! - [ ] Comments provide sufficient explanations for the next contributor - [ ] Tests cover changes and corner cases - [ ] Follows Quay syntax patterns and format
This commit is contained in:
parent
2282af2619
commit
993f2a174c
13 changed files with 140 additions and 20 deletions
|
@ -93,6 +93,20 @@ angular.module('quay').directive('repositoryEventsTable', function () {
|
|||
}, ApiService.errorDisplay('Cannot delete notification'));
|
||||
};
|
||||
|
||||
$scope.reenableNotification = function(notification) {
|
||||
var params = {
|
||||
'repository': $scope.repository.namespace + '/' + $scope.repository.name,
|
||||
'uuid': notification.uuid
|
||||
};
|
||||
|
||||
ApiService.resetRepositoryNotificationFailures(null, params).then(function() {
|
||||
var index = $.inArray(notification, $scope.notifications);
|
||||
if (index < 0) { return; }
|
||||
$scope.notifications[index].number_of_failures = 0
|
||||
}, ApiService.errorDisplay('Cannot re-enable notification'));
|
||||
};
|
||||
|
||||
|
||||
$scope.showNotifyInfo = function(notification, field) {
|
||||
var dom = document.createElement('input');
|
||||
dom.setAttribute('type', 'text');
|
||||
|
|
Reference in a new issue