mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 10:11:05 -03:30
Merge pull request #1518 from leigh-johnson/UserTeamsEdit
Populate fields in users.edit & teams.edit, fix Organization lookup in team.edit
This commit is contained in:
@@ -166,7 +166,7 @@ export function TeamsAdd($scope, $rootScope, $compile, $location, $log,
|
|||||||
Wait('stop');
|
Wait('stop');
|
||||||
$rootScope.flashMessage = "New team successfully created!";
|
$rootScope.flashMessage = "New team successfully created!";
|
||||||
$rootScope.$broadcast("EditIndicatorChange", "users", data.id);
|
$rootScope.$broadcast("EditIndicatorChange", "users", data.id);
|
||||||
$location.path('/teams/' + data.id);
|
$state.go('teams.edit', {team_id: data.id}, {reload: true});
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
@@ -188,11 +188,10 @@ TeamsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log',
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
export function TeamsEdit($scope, $rootScope, $compile, $location, $log,
|
export function TeamsEdit($scope, $rootScope, $location,
|
||||||
$stateParams, TeamForm, GenerateForm, Rest, Alert, ProcessErrors,
|
$stateParams, TeamForm, GenerateForm, Rest, ProcessErrors,
|
||||||
RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope,
|
RelatedSearchInit, RelatedPaginateInit, ClearScope,
|
||||||
LookUpInit, Prompt, GetBasePath, CheckAccess, OrganizationList, Wait,
|
LookUpInit, GetBasePath, OrganizationList, Wait, $state) {
|
||||||
fieldChoices, fieldLabels, permissionsSearchSelect, $state) {
|
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
@@ -204,238 +203,109 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log,
|
|||||||
id = $stateParams.team_id,
|
id = $stateParams.team_id,
|
||||||
relatedSets = {};
|
relatedSets = {};
|
||||||
|
|
||||||
$scope.permission_label = {};
|
|
||||||
$scope.permission_search_select = [];
|
|
||||||
|
|
||||||
$scope.$emit("RefreshTeamsList");
|
|
||||||
|
|
||||||
// return a promise from the options request with the permission type choices (including adhoc) as a param
|
|
||||||
// var permissionsChoice = fieldChoices({
|
|
||||||
// scope: $scope,
|
|
||||||
// url: 'api/v1/' + base + '/' + id + '/permissions/',
|
|
||||||
// field: 'permission_type'
|
|
||||||
// });
|
|
||||||
|
|
||||||
// // manipulate the choices from the options request to be set on
|
|
||||||
// // scope and be usable by the list form
|
|
||||||
// permissionsChoice.then(function (choices) {
|
|
||||||
// choices =
|
|
||||||
// fieldLabels({
|
|
||||||
// choices: choices
|
|
||||||
// });
|
|
||||||
// _.map(choices, function(n, key) {
|
|
||||||
// $scope.permission_label[key] = n;
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// manipulate the choices from the options request to be usable
|
|
||||||
// by the search option for permission_type, you can't inject the
|
|
||||||
// list until this is done!
|
|
||||||
// permissionsChoice.then(function (choices) {
|
|
||||||
// form.related.permissions.fields.permission_type.searchOptions =
|
|
||||||
// permissionsSearchSelect({
|
|
||||||
// choices: choices
|
|
||||||
// });
|
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
|
||||||
generator.reset();
|
|
||||||
$scope.$emit('loadTeam');
|
|
||||||
// });
|
|
||||||
|
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
|
||||||
generator.reset();
|
|
||||||
$scope.$emit('loadTeam');
|
|
||||||
|
|
||||||
$scope.team_id = id;
|
$scope.team_id = id;
|
||||||
|
|
||||||
$scope.PermissionAddAllowed = false;
|
|
||||||
|
|
||||||
// Retrieve each related set and any lookups
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
if ($scope.loadTeamRemove) {
|
generator.reset()
|
||||||
$scope.loadTeamRemove();
|
|
||||||
}
|
var setScopeFields = function(data){
|
||||||
$scope.loadTeamRemove = $scope.$on('loadTeam', function () {
|
_(data)
|
||||||
// Retrieve detail record and prepopulate the form
|
.pick(function(value, key){
|
||||||
Wait('start');
|
return form.fields.hasOwnProperty(key) === true;
|
||||||
Rest.setUrl(defaultUrl + ':id/');
|
|
||||||
Rest.get({
|
|
||||||
params: {
|
|
||||||
id: id
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.success(function (data) {
|
.forEach(function(value, key){
|
||||||
var fld, related, set;
|
$scope[key] = value;
|
||||||
$scope.team_name = data.name;
|
})
|
||||||
for (fld in form.fields) {
|
.value();
|
||||||
if (data[fld]) {
|
return
|
||||||
$scope[fld] = data[fld];
|
};
|
||||||
master[fld] = $scope[fld];
|
var setScopeRelated = function(data, related){
|
||||||
}
|
_(related)
|
||||||
}
|
.pick(function(value, key){
|
||||||
related = data.related;
|
return data.related.hasOwnProperty(key) === true;
|
||||||
for (set in form.related) {
|
})
|
||||||
if (related[set]) {
|
.forEach(function(value, key){
|
||||||
relatedSets[set] = {
|
relatedSets[key] = {
|
||||||
url: related[set],
|
url: data.related[key],
|
||||||
iterator: form.related[set].iterator
|
iterator: value.iterator
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
}
|
.value();
|
||||||
// Initialize related search functions. Doing it here to make sure relatedSets object is populated.
|
|
||||||
RelatedSearchInit({
|
|
||||||
scope: $scope,
|
|
||||||
form: form,
|
|
||||||
relatedSets: relatedSets
|
|
||||||
});
|
|
||||||
RelatedPaginateInit({
|
|
||||||
scope: $scope,
|
|
||||||
relatedSets: relatedSets
|
|
||||||
});
|
|
||||||
|
|
||||||
LookUpInit({
|
|
||||||
scope: $scope,
|
|
||||||
form: form,
|
|
||||||
current_item: data.organization,
|
|
||||||
list: OrganizationList,
|
|
||||||
field: 'organization',
|
|
||||||
input_type: 'radio'
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.organization_url = data.related.organization;
|
|
||||||
$scope.organization_name = data.summary_fields.organization.name;
|
|
||||||
master.organization_name = data.summary_fields.organization.name;
|
|
||||||
|
|
||||||
// get related object values and populate
|
|
||||||
for (var relatedValues in relatedSets) {
|
|
||||||
$scope.search(relatedSets[relatedValues].iterator);
|
|
||||||
}
|
|
||||||
CheckAccess({ scope: $scope }); //Does the user have access to add/edit Permissions?
|
|
||||||
Wait('stop');
|
|
||||||
})
|
|
||||||
.error(function (data, status) {
|
|
||||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to retrieve team: ' + $stateParams.team_id +
|
|
||||||
'. GET status: ' + status });
|
|
||||||
Wait('stop');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.getPermissionText = function () {
|
|
||||||
if (this.permission.permission_type !== "admin" && this.permission.run_ad_hoc_commands) {
|
|
||||||
return $scope.permission_label[this.permission.permission_type] +
|
|
||||||
" and " + $scope.permission_label.adhoc;
|
|
||||||
} else {
|
|
||||||
return $scope.permission_label[this.permission.permission_type];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Save changes to the parent
|
// prepares a data payload for a PUT request to the API
|
||||||
$scope.formSave = function () {
|
var processNewData = function(fields){
|
||||||
var data = {}, fld;
|
var data = {};
|
||||||
generator.clearApiErrors();
|
_.forEach(fields, function(value, key){
|
||||||
Wait('start');
|
if ($scope[key] !== '' && $scope[key] !== null && $scope[key] !== undefined){
|
||||||
$rootScope.flashMessage = null;
|
data[key] = $scope[key];
|
||||||
Rest.setUrl(defaultUrl + $stateParams.team_id + '/');
|
|
||||||
for (fld in form.fields) {
|
|
||||||
data[fld] = $scope[fld];
|
|
||||||
}
|
|
||||||
Rest.put(data)
|
|
||||||
.success(function () {
|
|
||||||
Wait('stop');
|
|
||||||
var base = $location.path().replace(/^\//, '').split('/')[0];
|
|
||||||
$scope.team_name = $scope.name;
|
|
||||||
if (base === 'teams') {
|
|
||||||
ReturnToCaller();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ReturnToCaller(1);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.error(function (data, status) {
|
|
||||||
Wait('stop');
|
|
||||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
|
||||||
msg: 'Failed to update team: ' + $stateParams.team_id + '. PUT status: ' + status });
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.formCancel = function () {
|
|
||||||
$state.transitionTo('teams');
|
|
||||||
};
|
|
||||||
|
|
||||||
// Related set: Add button
|
|
||||||
$scope.add = function (set) {
|
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
if (set === 'permissions') {
|
|
||||||
if ($scope.PermissionAddAllowed) {
|
|
||||||
$location.path('/' + base + '/' + $stateParams.team_id + '/' + set + '/add');
|
|
||||||
} else {
|
|
||||||
Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.');
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$location.path('/' + base + '/' + $stateParams.team_id + '/' + set);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Related set: Edit button
|
|
||||||
$scope.edit = function (set, id) {
|
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
if (set === 'permissions') {
|
|
||||||
$location.path('/' + base + '/' + $stateParams.team_id + '/' + set + '/' + id);
|
|
||||||
} else {
|
|
||||||
$location.path('/' + set + '/' + id);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Related set: Delete button
|
|
||||||
$scope['delete'] = function (set, itm_id, name, title) {
|
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
|
|
||||||
var action = function () {
|
|
||||||
var url;
|
|
||||||
if (set === 'permissions') {
|
|
||||||
if ($scope.PermissionAddAllowed) {
|
|
||||||
url = GetBasePath('base') + 'permissions/' + itm_id + '/';
|
|
||||||
Rest.setUrl(url);
|
|
||||||
Rest.destroy()
|
|
||||||
.success(function () {
|
|
||||||
$('#prompt-modal').modal('hide');
|
|
||||||
$scope.search(form.related[set].iterator);
|
|
||||||
})
|
|
||||||
.error(function (data, status) {
|
|
||||||
$('#prompt-modal').modal('hide');
|
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url +
|
|
||||||
' failed. DELETE returned status: ' + status });
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
url = defaultUrl + $stateParams.team_id + '/' + set + '/';
|
|
||||||
Rest.setUrl(url);
|
|
||||||
Rest.post({ id: itm_id, disassociate: 1 })
|
|
||||||
.success(function () {
|
|
||||||
$('#prompt-modal').modal('hide');
|
|
||||||
$scope.search(form.related[set].iterator);
|
|
||||||
})
|
|
||||||
.error(function (data, status) {
|
|
||||||
$('#prompt-modal').modal('hide');
|
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url +
|
|
||||||
' failed. POST returned status: ' + status });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Prompt({
|
|
||||||
hdr: 'Delete',
|
|
||||||
body: '<div class="Prompt-bodyQuery">Are you sure you want to remove the ' + title + ' below from ' + $scope.name + '?</div><div class="Prompt-bodyTarget">' + name + '</div>',
|
|
||||||
action: action,
|
|
||||||
actionText: 'DELETE'
|
|
||||||
});
|
});
|
||||||
|
return data
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var init = function(){
|
||||||
|
var url = defaultUrl + id;
|
||||||
|
Rest.setUrl(url);
|
||||||
|
Wait('start');
|
||||||
|
Rest.get(url).success(function(data){
|
||||||
|
setScopeFields(data);
|
||||||
|
setScopeRelated(data, form.related)
|
||||||
|
$scope.organization_name = data.summary_fields.organization.name;
|
||||||
|
|
||||||
|
RelatedSearchInit({
|
||||||
|
scope: $scope,
|
||||||
|
form: form,
|
||||||
|
relatedSets: relatedSets
|
||||||
|
});
|
||||||
|
|
||||||
|
RelatedPaginateInit({
|
||||||
|
scope: $scope,
|
||||||
|
relatedSets: relatedSets
|
||||||
|
});
|
||||||
|
|
||||||
|
LookUpInit({
|
||||||
|
url: GetBasePath('organizations'),
|
||||||
|
scope: $scope,
|
||||||
|
form: form,
|
||||||
|
current_item: $scope.organization,
|
||||||
|
list: OrganizationList,
|
||||||
|
field: 'organization',
|
||||||
|
input_type: 'radio'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.formCancel = function(){
|
||||||
|
$state.go('teams', null, {reload: true});
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.formSave = function(){
|
||||||
|
generator.clearApiErrors();
|
||||||
|
generator.checkAutoFill();
|
||||||
|
$rootScope.flashMessage = null;
|
||||||
|
if ($scope[form.name + '_form'].$valid){
|
||||||
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
|
var data = processNewData(form.fields);
|
||||||
|
Rest.put(data).success(function(res){
|
||||||
|
$state.go('teams', null, {reload: true});
|
||||||
|
})
|
||||||
|
.error(function (data, status) {
|
||||||
|
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
|
||||||
|
$stateParams.id + '. GET status: ' + status });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
|
/* Related Set implementation TDB */
|
||||||
}
|
}
|
||||||
|
|
||||||
TeamsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log',
|
TeamsEdit.$inject = ['$scope', '$rootScope', '$location',
|
||||||
'$stateParams', 'TeamForm', 'GenerateForm', 'Rest', 'Alert',
|
'$stateParams', 'TeamForm', 'GenerateForm', 'Rest',
|
||||||
'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit',
|
'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit',
|
||||||
'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt', 'GetBasePath',
|
'ClearScope', 'LookUpInit', 'GetBasePath',
|
||||||
'CheckAccess', 'OrganizationList', 'Wait', 'fieldChoices',
|
'OrganizationList', 'Wait', '$state'
|
||||||
'fieldLabels', 'permissionsSearchSelect', '$state'
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ export function UsersAdd($scope, $rootScope, $compile, $location, $log,
|
|||||||
if (base === 'users') {
|
if (base === 'users') {
|
||||||
$rootScope.flashMessage = 'New user successfully created!';
|
$rootScope.flashMessage = 'New user successfully created!';
|
||||||
$rootScope.$broadcast("EditIndicatorChange", "users", data.id);
|
$rootScope.$broadcast("EditIndicatorChange", "users", data.id);
|
||||||
$location.path('/users/' + data.id);
|
$state.go('users.edit', {user_id: data.id}, {reload: true});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ReturnToCaller(1);
|
ReturnToCaller(1);
|
||||||
@@ -219,11 +219,10 @@ UsersAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log',
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
export function UsersEdit($scope, $rootScope, $compile, $location, $log,
|
export function UsersEdit($scope, $rootScope, $location,
|
||||||
$stateParams, UserForm, GenerateForm, Rest, Alert, ProcessErrors,
|
$stateParams, UserForm, GenerateForm, Rest, ProcessErrors,
|
||||||
RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope,
|
RelatedSearchInit, RelatedPaginateInit, ClearScope,
|
||||||
GetBasePath, Prompt, CheckAccess, ResetForm, Wait, fieldChoices,
|
GetBasePath, ResetForm, Wait, $state) {
|
||||||
fieldLabels, permissionsSearchSelect, $state) {
|
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
@@ -235,315 +234,111 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log,
|
|||||||
id = $stateParams.user_id,
|
id = $stateParams.user_id,
|
||||||
relatedSets = {};
|
relatedSets = {};
|
||||||
|
|
||||||
$scope.permission_label = {};
|
|
||||||
$scope.permission_search_select = [];
|
|
||||||
|
|
||||||
$scope.$emit("RefreshUsersList");
|
|
||||||
|
|
||||||
// // return a promise from the options request with the permission type choices (including adhoc) as a param
|
|
||||||
// var permissionsChoice = fieldChoices({
|
|
||||||
// scope: $scope,
|
|
||||||
// url: 'api/v1/' + base + '/' + id + '/permissions/',
|
|
||||||
// field: 'permission_type'
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// // manipulate the choices from the options request to be set on
|
|
||||||
// // scope and be usable by the list form
|
|
||||||
// permissionsChoice.then(function (choices) {
|
|
||||||
// choices =
|
|
||||||
// fieldLabels({
|
|
||||||
// choices: choices
|
|
||||||
// });
|
|
||||||
// _.map(choices, function(n, key) {
|
|
||||||
// $scope.permission_label[key] = n;
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// manipulate the choices from the options request to be usable
|
|
||||||
// by the search option for permission_type, you can't inject the
|
|
||||||
// list until this is done!
|
|
||||||
// permissionsChoice.then(function (choices) {
|
|
||||||
// form.related.permissions.fields.permission_type.searchOptions =
|
|
||||||
// permissionsSearchSelect({
|
|
||||||
// choices: choices
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
$scope.$emit("loadForm");
|
|
||||||
|
|
||||||
if ($scope.removeFormReady) {
|
var setScopeFields = function(data){
|
||||||
$scope.removeFormReady();
|
_(data)
|
||||||
}
|
.pick(function(value, key){
|
||||||
$scope.removeFormReady = $scope.$on('formReady', function () {
|
return form.fields.hasOwnProperty(key) === true;
|
||||||
if ($scope.removePostRefresh) {
|
})
|
||||||
$scope.removePostRefresh();
|
.forEach(function(value, key){
|
||||||
}
|
$scope[key] = value;
|
||||||
$scope.removePostRefresh = $scope.$on('PostRefresh', function () {
|
})
|
||||||
// Cleanup after a delete
|
.value();
|
||||||
Wait('stop');
|
return
|
||||||
$('#prompt-modal').modal('hide');
|
};
|
||||||
});
|
|
||||||
|
|
||||||
$scope.PermissionAddAllowed = false;
|
var setScopeRelated = function(data, related){
|
||||||
|
_(related)
|
||||||
// After the Organization is loaded, retrieve each related set
|
.pick(function(value, key){
|
||||||
if ($scope.removeUserLoaded) {
|
return data.related.hasOwnProperty(key) === true;
|
||||||
$scope.removeUserLoaded();
|
})
|
||||||
}
|
.forEach(function(value, key){
|
||||||
$scope.removeUserLoaded = $scope.$on('userLoaded', function () {
|
relatedSets[key] = {
|
||||||
for (var set in relatedSets) {
|
url: data.related[key],
|
||||||
$scope.search(relatedSets[set].iterator);
|
iterator: value.iterator
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.value();
|
||||||
|
};
|
||||||
|
// prepares a data payload for a PUT request to the API
|
||||||
|
var processNewData = function(fields){
|
||||||
|
var data = {};
|
||||||
|
_.forEach(fields, function(value, key){
|
||||||
|
if ($scope[key] !== '' && $scope[key] !== null && $scope[key] !== undefined){
|
||||||
|
data[key] = $scope[key];
|
||||||
}
|
}
|
||||||
CheckAccess({ scope: $scope }); //Does the user have access to add/edit Permissions?
|
|
||||||
Wait('stop');
|
|
||||||
});
|
});
|
||||||
|
return data
|
||||||
|
};
|
||||||
|
|
||||||
// Retrieve detail record and prepopulate the form
|
var init = function(){
|
||||||
Rest.setUrl(defaultUrl + ':id/');
|
var url = defaultUrl + id;
|
||||||
Rest.get({ params: { id: id } })
|
Rest.setUrl(url);
|
||||||
.success(function (data) {
|
Wait('start');
|
||||||
$scope.user_id = id;
|
Rest.get(url).success(function(data){
|
||||||
$scope.username_title = data.username;
|
$scope.user_id = id;
|
||||||
var fld, related, set;
|
$scope.ldap_user = (data.ldap_dn !== null && data.ldap_dn !== undefined && data.ldap_dn !== '') ? true : false;
|
||||||
for (fld in form.fields) {
|
$scope.not_ldap_user = !$scope.ldap_user;
|
||||||
if (data[fld]) {
|
master.ldap_user = $scope.ldap_user;
|
||||||
if (fld === 'is_superuser') {
|
$scope.socialAuthUser = (data.auth.length > 0) ? true : false;
|
||||||
$scope[fld] = (data[fld] === 'true' || data[fld] === true) ? 'true' : 'false';
|
|
||||||
} else {
|
|
||||||
$scope[fld] = data[fld];
|
|
||||||
}
|
|
||||||
master[fld] = $scope[fld];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
related = data.related;
|
|
||||||
for (set in form.related) {
|
|
||||||
if (related[set]) {
|
|
||||||
relatedSets[set] = {
|
|
||||||
url: related[set],
|
|
||||||
iterator: form.related[set].iterator
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$scope.ldap_user = (data.ldap_dn !== null && data.ldap_dn !== undefined && data.ldap_dn !== '') ? true : false;
|
setScopeFields(data);
|
||||||
$scope.not_ldap_user = !$scope.ldap_user;
|
setScopeRelated(data, form.related);
|
||||||
master.ldap_user = $scope.ldap_user;
|
|
||||||
$scope.socialAuthUser = (data.auth.length > 0) ? true : false;
|
|
||||||
|
|
||||||
// Initialize related search functions. Doing it here to make sure relatedSets object is populated.
|
RelatedSearchInit({
|
||||||
RelatedSearchInit({
|
scope: $scope,
|
||||||
scope: $scope,
|
form: form,
|
||||||
form: form,
|
relatedSets: relatedSets
|
||||||
relatedSets: relatedSets
|
});
|
||||||
});
|
RelatedPaginateInit({
|
||||||
RelatedPaginateInit({
|
scope: $scope,
|
||||||
scope: $scope,
|
relatedSets: relatedSets
|
||||||
relatedSets: relatedSets
|
});
|
||||||
});
|
Wait('stop');
|
||||||
$scope.$emit('userLoaded');
|
})
|
||||||
|
.error(function (data, status) {
|
||||||
|
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
|
||||||
|
$stateParams.id + '. GET status: ' + status });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.formCancel = function(){
|
||||||
|
$state.go('users', null, {reload: true});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.formSave = function(){
|
||||||
|
generator.clearApiErrors();
|
||||||
|
generator.checkAutoFill();
|
||||||
|
$rootScope.flashMessage = null;
|
||||||
|
if ($scope[form.name + '_form'].$valid){
|
||||||
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
|
var data = processNewData(form.fields);
|
||||||
|
Rest.put(data).success(function(res){
|
||||||
|
$state.go('users', null, {reload: true})
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
|
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
|
||||||
$stateParams.id + '. GET status: ' + status });
|
$stateParams.id + '. GET status: ' + status });
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.getPermissionText = function () {
|
|
||||||
if (this.permission.permission_type !== "admin" && this.permission.run_ad_hoc_commands) {
|
|
||||||
return $scope.permission_label[this.permission.permission_type] +
|
|
||||||
" and " + $scope.permission_label.adhoc;
|
|
||||||
} else {
|
|
||||||
return $scope.permission_label[this.permission.permission_type];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Save changes to the parent
|
|
||||||
$scope.formSave = function () {
|
|
||||||
var data = {}, fld;
|
|
||||||
generator.clearApiErrors();
|
|
||||||
generator.checkAutoFill();
|
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
if ($scope[form.name + '_form'].$valid) {
|
|
||||||
Rest.setUrl(defaultUrl + id + '/');
|
|
||||||
for (fld in form.fields) {
|
|
||||||
if (form.fields[fld].realName) {
|
|
||||||
data[form.fields[fld].realName] = $scope[fld];
|
|
||||||
} else {
|
|
||||||
data[fld] = $scope[fld];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data.is_superuser = data.is_superuser || false;
|
|
||||||
|
|
||||||
Wait('start');
|
|
||||||
Rest.put(data)
|
|
||||||
.success(function () {
|
|
||||||
Wait('stop');
|
|
||||||
$scope.username_title = $scope.username;
|
|
||||||
var base = $location.path().replace(/^\//, '').split('/')[0];
|
|
||||||
if (base === 'users') {
|
|
||||||
ReturnToCaller();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ReturnToCaller(1);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.error(function (data, status) {
|
|
||||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to update users: ' + $stateParams.id +
|
|
||||||
'. PUT status: ' + status });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.formCancel = function () {
|
|
||||||
$state.transitionTo('users');
|
|
||||||
};
|
|
||||||
|
|
||||||
// Password change
|
|
||||||
$scope.clearPWConfirm = function (fld) {
|
|
||||||
// If password value changes, make sure password_confirm must be re-entered
|
|
||||||
$scope[fld] = '';
|
|
||||||
$scope[form.name + '_form'][fld].$setValidity('awpassmatch', false);
|
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Related set: Add button
|
|
||||||
$scope.add = function (set) {
|
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
if (set === 'permissions') {
|
|
||||||
if ($scope.PermissionAddAllowed) {
|
|
||||||
$location.path('/' + base + '/' + $stateParams.user_id + '/' + set + '/add');
|
|
||||||
} else {
|
|
||||||
Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$location.path('/' + base + '/' + $stateParams.user_id + '/' + set);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Related set: Edit button
|
|
||||||
$scope.edit = function (set, id) {
|
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
if (set === 'permissions') {
|
|
||||||
$location.path('/users/' + $stateParams.user_id + '/permissions/' + id);
|
|
||||||
} else {
|
|
||||||
$location.path('/' + set + '/' + id);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Related set: Delete button
|
|
||||||
$scope['delete'] = function (set, itm_id, name, title) {
|
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
|
|
||||||
var action = function () {
|
|
||||||
var url;
|
|
||||||
if (set === 'permissions') {
|
|
||||||
if ($scope.PermissionAddAllowed) {
|
|
||||||
url = GetBasePath('base') + 'permissions/' + itm_id + '/';
|
|
||||||
Rest.setUrl(url);
|
|
||||||
Rest.destroy()
|
|
||||||
.success(function () {
|
|
||||||
$('#prompt-modal').modal('hide');
|
|
||||||
$scope.search(form.related[set].iterator);
|
|
||||||
})
|
|
||||||
.error(function (data, status) {
|
|
||||||
$('#prompt-modal').modal('hide');
|
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
|
||||||
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
url = defaultUrl + $stateParams.user_id + '/' + set + '/';
|
|
||||||
Rest.setUrl(url);
|
|
||||||
Rest.post({
|
|
||||||
id: itm_id,
|
|
||||||
disassociate: 1
|
|
||||||
})
|
|
||||||
.success(function () {
|
|
||||||
$('#prompt-modal').modal('hide');
|
|
||||||
$scope.search(form.related[set].iterator);
|
|
||||||
})
|
|
||||||
.error(function (data, status) {
|
|
||||||
$('#prompt-modal').modal('hide');
|
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
|
||||||
msg: 'Call to ' + url + ' failed. POST returned status: ' + status });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Prompt({
|
|
||||||
hdr: 'Delete',
|
|
||||||
body: '<div class="Prompt-bodyQuery">Are you sure you want to remove the ' + title + ' below from ' + $scope.username + '?</div><div class="Prompt-bodyTarget">' + name + '</div>',
|
|
||||||
action: action,
|
|
||||||
actionText: 'DELETE'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}); // $scope.$on
|
|
||||||
|
|
||||||
// Put form back to its original state
|
|
||||||
ResetForm();
|
|
||||||
|
|
||||||
if ($scope.removeLoadForm) {
|
|
||||||
$scope.removeLoadForm();
|
|
||||||
}
|
|
||||||
$scope.removeLoadForm = $scope.$on('loadForm', function () {
|
|
||||||
|
|
||||||
|
|
||||||
if ($scope.removeModifyForm) {
|
|
||||||
$scope.removeModifyForm();
|
|
||||||
}
|
}
|
||||||
$scope.removeModifyForm = $scope.$on('modifyForm', function () {
|
};
|
||||||
// Modify form based on LDAP settings
|
|
||||||
Rest.setUrl(GetBasePath('config'));
|
|
||||||
Rest.get()
|
|
||||||
.success(function (data) {
|
|
||||||
var i, fld;
|
|
||||||
if (data.user_ldap_fields) {
|
|
||||||
for (i = 0; i < data.user_ldap_fields.length; i++) {
|
|
||||||
fld = data.user_ldap_fields[i];
|
|
||||||
if (form.fields[fld]) {
|
|
||||||
form.fields[fld].readonly = true;
|
|
||||||
form.fields[fld].editRequired = false;
|
|
||||||
if (form.fields[fld].awRequiredWhen) {
|
|
||||||
delete form.fields[fld].awRequiredWhen;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$scope.$emit('formReady');
|
|
||||||
})
|
|
||||||
.error(function (data, status) {
|
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
|
||||||
msg: 'Failed to retrieve application config. GET status: ' + status });
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
Wait('start');
|
$scope.clearPWConfirm = function (fld) {
|
||||||
Rest.setUrl(defaultUrl + id + '/');
|
// If password value changes, make sure password_confirm must be re-entered
|
||||||
Rest.get()
|
$scope[fld] = '';
|
||||||
.success(function (data) {
|
$scope[form.name + '_form'][fld].$setValidity('awpassmatch', false);
|
||||||
if (data.ldap_dn !== null && data.ldap_dn !== undefined && data.ldap_dn !== '') {
|
$rootScope.flashMessage = null;
|
||||||
//this is an LDAP user
|
};
|
||||||
$scope.$emit('modifyForm');
|
|
||||||
} else {
|
init();
|
||||||
$scope.$emit('formReady');
|
|
||||||
}
|
/* Related Set implementation TDB */
|
||||||
})
|
|
||||||
.error(function (data, status) {
|
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
|
||||||
msg: 'Failed to retrieve user: ' + id + '. GET status: ' + status });
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UsersEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log',
|
UsersEdit.$inject = ['$scope', '$rootScope', '$location',
|
||||||
'$stateParams', 'UserForm', 'GenerateForm', 'Rest', 'Alert',
|
'$stateParams', 'UserForm', 'GenerateForm', 'Rest', 'ProcessErrors',
|
||||||
'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit',
|
'RelatedSearchInit', 'RelatedPaginateInit', 'ClearScope', 'GetBasePath',
|
||||||
'ReturnToCaller', 'ClearScope', 'GetBasePath', 'Prompt', 'CheckAccess',
|
'ResetForm', 'Wait', '$state'
|
||||||
'ResetForm', 'Wait', 'fieldChoices', 'fieldLabels',
|
|
||||||
'permissionsSearchSelect', '$state'
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -38,10 +38,12 @@ export default
|
|||||||
type: 'lookup',
|
type: 'lookup',
|
||||||
sourceModel: 'organization',
|
sourceModel: 'organization',
|
||||||
sourceField: 'name',
|
sourceField: 'name',
|
||||||
|
addRequired: true,
|
||||||
|
editRequire: false,
|
||||||
ngClick: 'lookUpOrganization()',
|
ngClick: 'lookUpOrganization()',
|
||||||
awRequiredWhen: {
|
awRequiredWhen: {
|
||||||
variable: "teamrequired",
|
variable: "orgrequired",
|
||||||
init: "true"
|
init: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -57,6 +59,27 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
related: {
|
related: {
|
||||||
|
/*
|
||||||
|
permissions: {
|
||||||
|
basePath: 'teams/:id/access_list/',
|
||||||
|
type: 'collection',
|
||||||
|
title: 'Permissions',
|
||||||
|
iterator: 'permission',
|
||||||
|
index: false,
|
||||||
|
open: false,
|
||||||
|
searchType: 'select',
|
||||||
|
actions: {
|
||||||
|
add: {
|
||||||
|
ngClick: "addPermission",
|
||||||
|
label: 'Add',
|
||||||
|
awToolTip: 'Add a permission',
|
||||||
|
actionClass: 'btn List-buttonSubmit',
|
||||||
|
buttonContent: '+ ADD'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
credentials: {
|
credentials: {
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
@@ -103,70 +126,6 @@ export default
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
permissions: {
|
|
||||||
type: 'collection',
|
|
||||||
title: 'Permissions',
|
|
||||||
iterator: 'permission',
|
|
||||||
open: false,
|
|
||||||
index: false,
|
|
||||||
|
|
||||||
actions: {
|
|
||||||
add: {
|
|
||||||
ngClick: "add('permissions')",
|
|
||||||
label: 'Add',
|
|
||||||
awToolTip: 'Add a permission for this user',
|
|
||||||
ngShow: 'PermissionAddAllowed',
|
|
||||||
actionClass: 'btn List-buttonSubmit',
|
|
||||||
buttonContent: '+ ADD'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
fields: {
|
|
||||||
name: {
|
|
||||||
key: true,
|
|
||||||
label: 'Name',
|
|
||||||
ngClick: "edit('permissions', permission.id, permission.name)"
|
|
||||||
},
|
|
||||||
inventory: {
|
|
||||||
label: 'Inventory',
|
|
||||||
sourceModel: 'inventory',
|
|
||||||
sourceField: 'name',
|
|
||||||
ngBind: 'permission.summary_fields.inventory.name'
|
|
||||||
},
|
|
||||||
project: {
|
|
||||||
label: 'Project',
|
|
||||||
sourceModel: 'project',
|
|
||||||
sourceField: 'name',
|
|
||||||
ngBind: 'permission.summary_fields.project.name'
|
|
||||||
},
|
|
||||||
permission_type: {
|
|
||||||
label: 'Permission',
|
|
||||||
ngBind: 'getPermissionText()',
|
|
||||||
searchType: 'select'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
fieldActions: {
|
|
||||||
edit: {
|
|
||||||
label: 'Edit',
|
|
||||||
ngClick: "edit('permissions', permission.id, permission.name)",
|
|
||||||
icon: 'icon-edit',
|
|
||||||
awToolTip: 'Edit the permission',
|
|
||||||
'class': 'btn btn-default'
|
|
||||||
},
|
|
||||||
|
|
||||||
"delete": {
|
|
||||||
label: 'Delete',
|
|
||||||
ngClick: "delete('permissions', permission.id, permission.name, 'permission')",
|
|
||||||
icon: 'icon-trash',
|
|
||||||
"class": 'btn-danger',
|
|
||||||
awToolTip: 'Delete the permission',
|
|
||||||
ngShow: 'PermissionAddAllowed'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
projects: {
|
projects: {
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Projects',
|
title: 'Projects',
|
||||||
|
|||||||
@@ -42,18 +42,6 @@ export default
|
|||||||
editRequired: true,
|
editRequired: true,
|
||||||
autocomplete: false
|
autocomplete: false
|
||||||
},
|
},
|
||||||
organization: {
|
|
||||||
label: 'Organization',
|
|
||||||
type: 'lookup',
|
|
||||||
sourceModel: 'organization',
|
|
||||||
sourceField: 'name',
|
|
||||||
ngClick: 'lookUpOrganization()',
|
|
||||||
excludeMode: 'edit',
|
|
||||||
awRequiredWhen: {
|
|
||||||
variable: "orgrequired",
|
|
||||||
init: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
username: {
|
username: {
|
||||||
label: 'Username',
|
label: 'Username',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
@@ -63,6 +51,20 @@ export default
|
|||||||
},
|
},
|
||||||
autocomplete: false
|
autocomplete: false
|
||||||
},
|
},
|
||||||
|
organization: {
|
||||||
|
label: 'Organization',
|
||||||
|
type: 'lookup',
|
||||||
|
sourceModel: 'organization',
|
||||||
|
sourceField: 'name',
|
||||||
|
addRequired: true,
|
||||||
|
editRequired: false,
|
||||||
|
excludeMode: 'edit',
|
||||||
|
ngClick: 'lookUpOrganization()',
|
||||||
|
awRequiredWhen: {
|
||||||
|
variable: "orgrequired",
|
||||||
|
init: true
|
||||||
|
}
|
||||||
|
},
|
||||||
password: {
|
password: {
|
||||||
label: 'Password',
|
label: 'Password',
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
@@ -86,12 +88,13 @@ export default
|
|||||||
autocomplete: false
|
autocomplete: false
|
||||||
},
|
},
|
||||||
is_superuser: {
|
is_superuser: {
|
||||||
label: 'Superuser (User has full system administration privileges.)',
|
label: 'Superuser <span style="text-transform:none;">(User has full system administration privileges)</span>',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
trueValue: 'true',
|
trueValue: 'true',
|
||||||
falseValue: 'false',
|
falseValue: 'false',
|
||||||
"default": 'false',
|
"default": 'false',
|
||||||
ngShow: "current_user['is_superuser'] == true"
|
ngShow: "current_user['is_superuser'] == true",
|
||||||
|
ngModel: 'is_superuser'
|
||||||
},
|
},
|
||||||
ldap_user: {
|
ldap_user: {
|
||||||
label: 'Created by LDAP',
|
label: 'Created by LDAP',
|
||||||
@@ -112,6 +115,26 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
related: {
|
related: {
|
||||||
|
/*
|
||||||
|
permissions: {
|
||||||
|
basePath: 'teams/:id/access_list/',
|
||||||
|
type: 'collection',
|
||||||
|
title: 'Permissions',
|
||||||
|
iterator: 'permission',
|
||||||
|
index: false,
|
||||||
|
open: false,
|
||||||
|
searchType: 'select',
|
||||||
|
actions: {
|
||||||
|
add: {
|
||||||
|
ngClick: "addPermission",
|
||||||
|
label: 'Add',
|
||||||
|
awToolTip: 'Add a permission',
|
||||||
|
actionClass: 'btn List-buttonSubmit',
|
||||||
|
buttonContent: '+ ADD'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
*/
|
||||||
|
|
||||||
credentials: {
|
credentials: {
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
@@ -157,92 +180,6 @@ export default
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// permissions: {
|
|
||||||
// type: 'collection',
|
|
||||||
// title: 'Permissions',
|
|
||||||
// iterator: 'permission',
|
|
||||||
// open: false,
|
|
||||||
// index: false,
|
|
||||||
//
|
|
||||||
// actions: {
|
|
||||||
// add: {
|
|
||||||
// ngClick: "add('permissions')",
|
|
||||||
// label: 'Add',
|
|
||||||
// awToolTip: 'Add a permission for this user',
|
|
||||||
// ngShow: 'PermissionAddAllowed',
|
|
||||||
// actionClass: 'btn List-buttonSubmit',
|
|
||||||
// buttonContent: '+ ADD'
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
//
|
|
||||||
// fields: {
|
|
||||||
// name: {
|
|
||||||
// key: true,
|
|
||||||
// label: 'Name',
|
|
||||||
// ngClick: "edit('permissions', permission.id, permission.name)"
|
|
||||||
// },
|
|
||||||
// inventory: {
|
|
||||||
// label: 'Inventory',
|
|
||||||
// sourceModel: 'inventory',
|
|
||||||
// sourceField: 'name',
|
|
||||||
// ngBind: 'permission.summary_fields.inventory.name'
|
|
||||||
// },
|
|
||||||
// project: {
|
|
||||||
// label: 'Project',
|
|
||||||
// sourceModel: 'project',
|
|
||||||
// sourceField: 'name',
|
|
||||||
// ngBind: 'permission.summary_fields.project.name'
|
|
||||||
// },
|
|
||||||
// permission_type: {
|
|
||||||
// label: 'Permission',
|
|
||||||
// ngBind: 'getPermissionText()',
|
|
||||||
// searchType: 'select'
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
//
|
|
||||||
// fieldActions: {
|
|
||||||
// edit: {
|
|
||||||
// label: 'Edit',
|
|
||||||
// ngClick: "edit('permissions', permission.id, permission.name)",
|
|
||||||
// icon: 'icon-edit',
|
|
||||||
// awToolTip: 'Edit the permission',
|
|
||||||
// 'class': 'btn btn-default'
|
|
||||||
// },
|
|
||||||
//
|
|
||||||
// "delete": {
|
|
||||||
// label: 'Delete',
|
|
||||||
// ngClick: "delete('permissions', permission.id, permission.name, 'permission')",
|
|
||||||
// icon: 'icon-trash',
|
|
||||||
// "class": 'btn-danger',
|
|
||||||
// awToolTip: 'Delete the permission',
|
|
||||||
// ngShow: 'PermissionAddAllowed'
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// },
|
|
||||||
|
|
||||||
admin_of_organizations: { // Assumes a plural name (e.g. things)
|
|
||||||
type: 'collection',
|
|
||||||
title: 'Admin of Organizations',
|
|
||||||
iterator: 'adminof', // Singular form of name (e.g. thing)
|
|
||||||
open: false, // Open accordion on load?
|
|
||||||
index: false,
|
|
||||||
base: '/organizations',
|
|
||||||
|
|
||||||
actions: {},
|
|
||||||
|
|
||||||
fields: {
|
|
||||||
name: {
|
|
||||||
key: true,
|
|
||||||
label: 'Name'
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
label: 'Description'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
organizations: {
|
organizations: {
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Organizations',
|
title: 'Organizations',
|
||||||
|
|||||||
Reference in New Issue
Block a user