mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
update to perm ui for rbac branch
This commit is contained in:
@@ -480,25 +480,7 @@ export function ProjectsAdd(Refresh, $scope, $rootScope, $compile, $location, $l
|
|||||||
url: $scope.current_url
|
url: $scope.current_url
|
||||||
});
|
});
|
||||||
|
|
||||||
var id = data.id,
|
$state.go("^");
|
||||||
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 });
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
|
|||||||
@@ -151,6 +151,17 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
editRequired: false,
|
editRequired: false,
|
||||||
subForm: 'sourceSubForm'
|
subForm: 'sourceSubForm'
|
||||||
},
|
},
|
||||||
|
organization: {
|
||||||
|
label: 'Organization',
|
||||||
|
type: 'lookup',
|
||||||
|
sourceModel: 'organization',
|
||||||
|
sourceField: 'name',
|
||||||
|
ngClick: 'lookUpOrganization()',
|
||||||
|
awRequiredWhen: {
|
||||||
|
variable: "organizationrequired",
|
||||||
|
init: "true"
|
||||||
|
}
|
||||||
|
},
|
||||||
credential: {
|
credential: {
|
||||||
label: 'SCM Credential',
|
label: 'SCM Credential',
|
||||||
type: 'lookup',
|
type: 'lookup',
|
||||||
@@ -234,50 +245,6 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
},
|
},
|
||||||
|
|
||||||
related: {
|
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: {
|
permissions: {
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Permissions',
|
title: 'Permissions',
|
||||||
@@ -314,13 +281,9 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
|
|
||||||
relatedSets: function(urls) {
|
relatedSets: function(urls) {
|
||||||
return {
|
return {
|
||||||
organizations: {
|
|
||||||
iterator: 'organization',
|
|
||||||
url: urls.organizations
|
|
||||||
},
|
|
||||||
permissions: {
|
permissions: {
|
||||||
iterator: 'permission',
|
iterator: 'permission',
|
||||||
url: urls.resource_access_list
|
url: urls.access_list
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user