Update styling of feedback bar to use the alert styles and string builder
This commit is contained in:
parent
dcf8922799
commit
d74da9a3db
5 changed files with 36 additions and 17 deletions
|
@ -11,11 +11,13 @@ angular.module('quay').directive('feedbackBar', function () {
|
|||
scope: {
|
||||
'feedback': '=feedback'
|
||||
},
|
||||
controller: function($scope, $element, AvatarService, Config, UIService, $timeout) {
|
||||
controller: function($scope, $element, AvatarService, Config, UIService, $timeout, StringBuilderService) {
|
||||
$scope.viewCounter = 0;
|
||||
$scope.formattedMessage = '';
|
||||
|
||||
$scope.$watch('feedback', function(feedback) {
|
||||
if (feedback) {
|
||||
$scope.formattedMessage = StringBuilderService.buildString(feedback.message, feedback.data || {}, 'span');
|
||||
$scope.viewCounter++;
|
||||
} else {
|
||||
$scope.viewCounter = 0;
|
||||
|
|
|
@ -119,8 +119,11 @@ angular.module('quay').directive('robotsManager', function () {
|
|||
created.repositories = [];
|
||||
$scope.robots.push(created);
|
||||
$scope.feedback = {
|
||||
'kind': 'info',
|
||||
'message': 'Robot account ' + name + ' was created'
|
||||
'kind': 'success',
|
||||
'message': 'Robot account {robot} was created',
|
||||
'data': {
|
||||
'robot': name
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
|
@ -132,8 +135,11 @@ angular.module('quay').directive('robotsManager', function () {
|
|||
if (index >= 0) {
|
||||
$scope.robots.splice(index, 1);
|
||||
$scope.feedback = {
|
||||
'kind': 'info',
|
||||
'message': 'Robot account ' + info.name + ' was deleted'
|
||||
'kind': 'success',
|
||||
'message': 'Robot account {robot} was deleted',
|
||||
'data': {
|
||||
'robot': info.name
|
||||
}
|
||||
};
|
||||
}
|
||||
}, ApiService.errorDisplay('Cannot delete robot account'));
|
||||
|
|
Reference in a new issue