mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-19 23:28:20 +01:00
updates for reload action when editing project-member.
This commit is contained in:
parent
bab38f2514
commit
8d30879fc2
@ -31,9 +31,6 @@
|
||||
AddProjectMemberService(vm.projectId, vm.optRole, pm.username)
|
||||
.success(addProjectMemberComplete)
|
||||
.error(addProjectMemberFailed);
|
||||
vm.username = '';
|
||||
vm.optRole = 1;
|
||||
vm.reload();
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,6 +45,7 @@
|
||||
|
||||
function addProjectMemberComplete(data, status, header) {
|
||||
console.log('addProjectMemberComplete: status:' + status + ', data:' + data);
|
||||
vm.reload();
|
||||
}
|
||||
|
||||
function addProjectMemberFailed(data, status, headers) {
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
function updateProjectMember(e) {
|
||||
if(vm.editMode) {
|
||||
vm.editMode = false;
|
||||
console.log('update project member, roleId:' + e.roleId);
|
||||
EditProjectMemberService(e.projectId, e.userId, e.roleId)
|
||||
.success(editProjectMemberComplete)
|
||||
@ -42,12 +41,13 @@
|
||||
DeleteProjectMemberService(e.projectId, e.userId)
|
||||
.success(editProjectMemberComplete)
|
||||
.error(editProjectMemberFailed);
|
||||
vm.reload();
|
||||
}
|
||||
|
||||
function editProjectMemberComplete(data, status, headers) {
|
||||
console.log('edit project member complete: ' + status);
|
||||
vm.lastRoleName = vm.roleName;
|
||||
vm.editMode = false;
|
||||
vm.reload();
|
||||
}
|
||||
|
||||
function editProjectMemberFailed(e) {
|
||||
@ -56,7 +56,6 @@
|
||||
|
||||
function cancelUpdate() {
|
||||
vm.editMode = false;
|
||||
console.log('lastRoleName:' + vm.lastRoleName);
|
||||
vm.roleName = vm.lastRoleName;
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
vm.currentRole = getRole({'key': 'roleName', 'value': current});
|
||||
}
|
||||
});
|
||||
|
||||
vm.selectRole = selectRole;
|
||||
|
||||
function selectRole(role) {
|
||||
|
@ -38,22 +38,23 @@
|
||||
|
||||
function link(scope, element, attrs, ctrl) {
|
||||
|
||||
var visited = ctrl.url.substring(1);
|
||||
|
||||
var visited = ctrl.url.substring(1);
|
||||
if(visited.indexOf('?') >= 0) {
|
||||
visited = ctrl.url.substring(1, ctrl.url.indexOf('?') - 1);
|
||||
visited = ctrl.url.substring(1, ctrl.url.indexOf('?'));
|
||||
}
|
||||
|
||||
scope.$watch('vm.selectedProject', function(current) {
|
||||
if(current) {
|
||||
element.find('a').removeClass('active');
|
||||
element.find('a:first').addClass('active');
|
||||
if(visited) {
|
||||
element.find('a[tag="' + visited + '"]').addClass('active');
|
||||
}else{
|
||||
element.find('a:first').addClass('active');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
element.find('a[tag*="' + visited + '"]').addClass('active');
|
||||
element.find('a').on('click', click);
|
||||
|
||||
element.find('a').on('click', click);
|
||||
|
||||
function click(event) {
|
||||
element.find('a').removeClass('active');
|
||||
$(event.target).addClass('active');
|
||||
|
Loading…
Reference in New Issue
Block a user