Add notification actions support
This commit is contained in:
parent
c026782abb
commit
eefb7e1ec9
3 changed files with 40 additions and 1 deletions
|
@ -535,6 +535,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
|||
|
||||
stringBuilderService.buildString = function(value_or_func, metadata) {
|
||||
var fieldIcons = {
|
||||
'adder': 'user',
|
||||
'username': 'user',
|
||||
'activating_username': 'user',
|
||||
'delegate_user': 'user',
|
||||
|
@ -1132,6 +1133,19 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
|||
'page': '/about/',
|
||||
'dismissable': true
|
||||
},
|
||||
'org_team_invite': {
|
||||
'level': 'primary',
|
||||
'message': '{adder} is inviting you to join team {team} under organization {org}',
|
||||
'actions': [
|
||||
{
|
||||
'title': 'Join team',
|
||||
'kind': 'primary',
|
||||
'handler': function(notification) {
|
||||
}
|
||||
},
|
||||
{'title': 'Decline', 'kind': 'default'}
|
||||
]
|
||||
},
|
||||
'password_required': {
|
||||
'level': 'error',
|
||||
'message': 'In order to begin pushing and pulling repositories, a password must be set for your account',
|
||||
|
@ -1224,6 +1238,15 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
|||
}
|
||||
};
|
||||
|
||||
notificationService.getActions = function(notification) {
|
||||
var kindInfo = notificationKinds[notification['kind']];
|
||||
if (!kindInfo) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return kindInfo['actions'] || [];
|
||||
};
|
||||
|
||||
notificationService.canDismiss = function(notification) {
|
||||
var kindInfo = notificationKinds[notification['kind']];
|
||||
if (!kindInfo) {
|
||||
|
@ -5104,6 +5127,10 @@ quayApp.directive('notificationView', function () {
|
|||
$scope.getClass = function(notification) {
|
||||
return NotificationService.getClass(notification);
|
||||
};
|
||||
|
||||
$scope.getActions = function(notification) {
|
||||
return NotificationService.getActions(notification);
|
||||
};
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
|
|
Reference in a new issue