Add feedback to the teams manager
This commit is contained in:
parent
d74da9a3db
commit
fd354469da
2 changed files with 34 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
<div class="teams-manager-element">
|
||||
<div class="feedback-bar" feedback="feedback"></div>
|
||||
<div class="manager-header" header-title="Teams and Membership">
|
||||
<div class="tab-header-controls hidden-xs">
|
||||
<div class="btn-group btn-group-sm" ng-show="organization.is_admin">
|
||||
|
|
|
@ -26,6 +26,7 @@ angular.module('quay').directive('teamsManager', function () {
|
|||
$scope.orderedTeams = [];
|
||||
$scope.showingMembers = false;
|
||||
$scope.fullMemberList = null;
|
||||
$scope.feedback = null;
|
||||
|
||||
var loadTeamMembers = function() {
|
||||
if (!$scope.organization || !$scope.isEnabled) { return; }
|
||||
|
@ -95,6 +96,14 @@ angular.module('quay').directive('teamsManager', function () {
|
|||
});
|
||||
|
||||
ApiService.updateOrganizationTeam(data, params).then(function(resp) {
|
||||
$scope.feedback = {
|
||||
'kind': 'success',
|
||||
'message': 'Team {team} role changed to {role}',
|
||||
'data': {
|
||||
'team': teamname,
|
||||
'role': role
|
||||
}
|
||||
};
|
||||
}, errorHandler);
|
||||
};
|
||||
|
||||
|
@ -118,6 +127,14 @@ angular.module('quay').directive('teamsManager', function () {
|
|||
$scope.members[teamname].members = [];
|
||||
$scope.organization.ordered_teams.push(teamname);
|
||||
$scope.orderedTeams.push(created);
|
||||
|
||||
$scope.feedback = {
|
||||
'kind': 'success',
|
||||
'message': 'Team {team} created',
|
||||
'data': {
|
||||
'team': teamname
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -143,6 +160,14 @@ angular.module('quay').directive('teamsManager', function () {
|
|||
|
||||
loadOrderedTeams();
|
||||
delete $scope.organization.teams[teamname];
|
||||
|
||||
$scope.feedback = {
|
||||
'kind': 'success',
|
||||
'message': 'Team {team} deleted',
|
||||
'data': {
|
||||
'team': teamname
|
||||
}
|
||||
};
|
||||
}, ApiService.errorDisplay('Cannot delete team'));
|
||||
};
|
||||
|
||||
|
@ -180,6 +205,14 @@ angular.module('quay').directive('teamsManager', function () {
|
|||
$scope.showMembers(true);
|
||||
|
||||
callback(true);
|
||||
|
||||
$scope.feedback = {
|
||||
'kind': 'success',
|
||||
'message': 'User {user} removed from the organization',
|
||||
'data': {
|
||||
'user': memberInfo.name
|
||||
}
|
||||
};
|
||||
}, errorHandler)
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue