update to perm ui for rbac branch

This commit is contained in:
John Mitchell 2016-03-31 10:43:29 -04:00
parent 70c7c0242b
commit 064a04cf16
2 changed files with 13 additions and 68 deletions

View File

@ -480,25 +480,7 @@ export function ProjectsAdd(Refresh, $scope, $rootScope, $compile, $location, $l
url: $scope.current_url
});
var id = data.id,
url = GetBasePath('projects') + id + '/organizations/',
org = { id: $scope.organization };
Rest.setUrl(url);
Rest.post(org)
.success(function () {
Wait('stop');
$rootScope.flashMessage = "New project successfully created!";
if (base === 'projects') {
ReturnToCaller();
}
else {
ReturnToCaller(1);
}
})
.error(function (data, status) {
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
msg: 'Failed to add organization to project. POST returned status: ' + status });
});
$state.go("^");
})
.error(function (data, status) {
Wait('stop');

View File

@ -151,6 +151,17 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
editRequired: false,
subForm: 'sourceSubForm'
},
organization: {
label: 'Organization',
type: 'lookup',
sourceModel: 'organization',
sourceField: 'name',
ngClick: 'lookUpOrganization()',
awRequiredWhen: {
variable: "organizationrequired",
init: "true"
}
},
credential: {
label: 'SCM Credential',
type: 'lookup',
@ -234,50 +245,6 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
},
related: {
organizations: {
type: 'collection',
title: 'Organizations',
iterator: 'organization',
index: false,
open: false,
actions: {
add: {
ngClick: "add('organizations')",
label: 'Add',
awToolTip: 'Add an organization',
actionClass: 'btn List-buttonSubmit',
buttonContent: '+ ADD'
}
},
fields: {
name: {
key: true,
label: 'Name'
},
description: {
label: 'Description'
}
},
fieldActions: {
edit: {
label: 'Edit',
ngClick: "edit('organizations', organization.id, organization.name)",
icon: 'icon-edit',
awToolTip: 'Edit the organization',
'class': 'btn btn-default'
},
"delete": {
label: 'Delete',
ngClick: "delete('organizations', organization.id, organization.name, 'organization')",
icon: 'icon-trash',
"class": 'btn-danger',
awToolTip: 'Delete the organization'
}
}
},
permissions: {
type: 'collection',
title: 'Permissions',
@ -314,13 +281,9 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
relatedSets: function(urls) {
return {
organizations: {
iterator: 'organization',
url: urls.organizations
},
permissions: {
iterator: 'permission',
url: urls.resource_access_list
url: urls.access_list
}
};
}