mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
cleanup orgs
This commit is contained in:
parent
9bc217ec8d
commit
b3e7102e02
@ -16,7 +16,6 @@ import JobTemplates from "./forms/JobTemplates";
|
||||
import JobVarsPrompt from "./forms/JobVarsPrompt";
|
||||
import LogViewerOptions from "./forms/LogViewerOptions";
|
||||
import LogViewerStatus from "./forms/LogViewerStatus";
|
||||
import Organizations from "./forms/Organizations";
|
||||
|
||||
export
|
||||
{ EventsViewer,
|
||||
@ -31,5 +30,4 @@ export
|
||||
JobVarsPrompt,
|
||||
LogViewerOptions,
|
||||
LogViewerStatus,
|
||||
Organizations,
|
||||
};
|
||||
|
||||
@ -15,7 +15,6 @@ import InventorySources from "./lists/InventorySources";
|
||||
import JobEvents from "./lists/JobEvents";
|
||||
import JobHosts from "./lists/JobHosts";
|
||||
import Jobs from "./lists/Jobs";
|
||||
import Organizations from "./lists/Organizations";
|
||||
import PortalJobTemplates from "./lists/PortalJobTemplates";
|
||||
import PortalJobs from "./lists/PortalJobs";
|
||||
import ScheduledJobs from "./lists/ScheduledJobs";
|
||||
@ -33,7 +32,6 @@ export
|
||||
JobEvents,
|
||||
JobHosts,
|
||||
Jobs,
|
||||
Organizations,
|
||||
PortalJobTemplates,
|
||||
PortalJobs,
|
||||
ScheduledJobs,
|
||||
|
||||
@ -1,65 +0,0 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
|
||||
export default
|
||||
angular.module('OrganizationListDefinition', [])
|
||||
.value('OrganizationList', {
|
||||
|
||||
name: 'organizations',
|
||||
iterator: 'organization',
|
||||
selectTitle: 'Add Organizations',
|
||||
selectInstructions: '<p>Select existing organizations by clicking each organization or checking the related checkbox. When finished, ' +
|
||||
'click the blue <em>Select</em> button, located bottom right.</p><p>Create a new organization by clicking the ' +
|
||||
'<i class=\"fa fa-plus\"></i> button.</p>',
|
||||
editTitle: 'ORGANIZATIONS',
|
||||
hover: true,
|
||||
index: false,
|
||||
|
||||
fields: {
|
||||
name: {
|
||||
key: true,
|
||||
label: 'Name',
|
||||
columnClass: 'col-lg-4 col-md-6 col-sm-8 col-xs-8'
|
||||
},
|
||||
description: {
|
||||
label: 'Description',
|
||||
columnClass: 'hidden-sm hidden-xs',
|
||||
excludeModal: true
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
add: {
|
||||
mode: 'all', // One of: edit, select, all
|
||||
ngClick: 'addOrganization()',
|
||||
awToolTip: 'Create a new organization',
|
||||
awFeature: 'multiple_organizations',
|
||||
actionClass: 'btn List-buttonSubmit',
|
||||
buttonContent: '+ ADD'
|
||||
}
|
||||
},
|
||||
|
||||
fieldActions: {
|
||||
edit: {
|
||||
label: 'Edit',
|
||||
ngClick: "editOrganization(organization.id)",
|
||||
icon: 'icon-edit',
|
||||
"class": 'btn-xs btn-default',
|
||||
awToolTip: 'Edit organization',
|
||||
dataPlacement: 'top'
|
||||
},
|
||||
|
||||
"delete": {
|
||||
label: 'Delete',
|
||||
ngClick: "deleteOrganization(organization.id, organization.name)",
|
||||
icon: 'icon-trash',
|
||||
"class": 'btn-xs btn-danger',
|
||||
awToolTip: 'Delete organization',
|
||||
dataPlacement: 'top'
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -8,8 +8,8 @@ export default ['$scope', '$rootScope', '$location', '$stateParams',
|
||||
'OrganizationForm', 'GenerateForm', 'Rest', 'Alert',
|
||||
'ProcessErrors', 'ClearScope', 'GetBasePath', 'Wait','$state',
|
||||
function($scope, $rootScope, $location, $stateParams, OrganizationForm,
|
||||
GenerateForm, Rest, Alert, ProcessErrors,
|
||||
ClearScope, GetBasePath, Wait, $state) {
|
||||
GenerateForm, Rest, Alert, ProcessErrors, ClearScope, GetBasePath, Wait,
|
||||
$state) {
|
||||
|
||||
Rest.setUrl(GetBasePath('organizations'));
|
||||
Rest.options()
|
||||
|
||||
@ -4,12 +4,11 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default ['$scope', '$rootScope', '$location', '$log', '$stateParams',
|
||||
'OrganizationForm', 'Rest', 'Alert', 'ProcessErrors', 'Prompt', 'ClearScope',
|
||||
'GetBasePath', 'Wait', '$state', 'ToggleNotification',
|
||||
function($scope, $rootScope, $location, $log, $stateParams,
|
||||
OrganizationForm, Rest, Alert, ProcessErrors, Prompt, ClearScope,
|
||||
GetBasePath, Wait, $state, ToggleNotification) {
|
||||
export default ['$scope', '$location', '$stateParams', 'OrganizationForm',
|
||||
'Rest', 'ProcessErrors', 'Prompt', 'ClearScope', 'GetBasePath', 'Wait',
|
||||
'$state', 'ToggleNotification', function($scope, $location, $stateParams,
|
||||
OrganizationForm, Rest, ProcessErrors, Prompt, ClearScope, GetBasePath,
|
||||
Wait, $state, ToggleNotification) {
|
||||
|
||||
ClearScope();
|
||||
|
||||
|
||||
@ -11,11 +11,13 @@
|
||||
* Controller for handling permissions adding
|
||||
*/
|
||||
|
||||
export default ['$scope', '$rootScope', 'ProcessErrors', 'GetBasePath', 'generateList',
|
||||
'templateUrl', '$state', 'Rest', '$q', 'Wait', '$window', 'QuerySet', 'UserList',
|
||||
function($scope, $rootScope, ProcessErrors, GetBasePath, generateList,
|
||||
templateUrl, $state, Rest, $q, Wait, $window, qs, UserList) {
|
||||
$scope.$on("linkLists", function() {
|
||||
export default ['$scope', '$rootScope', 'ProcessErrors', 'GetBasePath',
|
||||
'generateList', '$state', 'Rest', '$q', 'Wait', '$window', 'QuerySet',
|
||||
'UserList',
|
||||
function($scope, $rootScope, ProcessErrors, GetBasePath, generateList,
|
||||
$state, Rest, $q, Wait, $window, qs, UserList) {
|
||||
|
||||
$scope.$on("linkLists", function() {
|
||||
|
||||
if ($state.current.name.split(".")[1] === "users") {
|
||||
$scope.addType = "Users";
|
||||
|
||||
@ -6,56 +6,56 @@
|
||||
|
||||
/* jshint unused: vars */
|
||||
import addUsers from './addUsers.controller';
|
||||
export default
|
||||
['Wait', 'templateUrl', '$state', '$view', '$compile', function(Wait, templateUrl, $state, $view, $compile) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
addUsersType: '@'
|
||||
},
|
||||
controller: addUsers,
|
||||
templateUrl: templateUrl('organizations/linkout/addUsers/addUsers'),
|
||||
link: function(scope, element, attrs, ctrl) {
|
||||
export default ['Wait', 'templateUrl', '$compile', function(Wait, templateUrl,
|
||||
$compile) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
addUsersType: '@'
|
||||
},
|
||||
controller: addUsers,
|
||||
templateUrl: templateUrl('organizations/linkout/addUsers/addUsers'),
|
||||
link: function(scope, element, attrs, ctrl) {
|
||||
|
||||
$("body").addClass("is-modalOpen");
|
||||
$("body").addClass("is-modalOpen");
|
||||
|
||||
$("body").append(element);
|
||||
$("body").append(element);
|
||||
|
||||
Wait('start');
|
||||
Wait('start');
|
||||
|
||||
scope.$broadcast("linkLists");
|
||||
scope.$broadcast("linkLists");
|
||||
|
||||
setTimeout(function() {
|
||||
$('#add-users-modal').modal("show");
|
||||
}, 200);
|
||||
setTimeout(function() {
|
||||
$('#add-users-modal').modal("show");
|
||||
}, 200);
|
||||
|
||||
$('.modal[aria-hidden=false]').each(function () {
|
||||
if ($(this).attr('id') !== 'add-users-modal') {
|
||||
$(this).modal('hide');
|
||||
}
|
||||
});
|
||||
$('.modal[aria-hidden=false]').each(function () {
|
||||
if ($(this).attr('id') !== 'add-users-modal') {
|
||||
$(this).modal('hide');
|
||||
}
|
||||
});
|
||||
|
||||
scope.closeModal = function() {
|
||||
$("body").removeClass("is-modalOpen");
|
||||
$('#add-users-modal').on('hidden.bs.modal',
|
||||
function () {
|
||||
$('.AddUsers').remove();
|
||||
});
|
||||
$('#add-users-modal').modal('hide');
|
||||
};
|
||||
scope.closeModal = function() {
|
||||
$("body").removeClass("is-modalOpen");
|
||||
$('#add-users-modal').on('hidden.bs.modal',
|
||||
function () {
|
||||
$('.AddUsers').remove();
|
||||
});
|
||||
$('#add-users-modal').modal('hide');
|
||||
};
|
||||
|
||||
scope.$on('closeUsersModal', function() {
|
||||
scope.closeModal();
|
||||
});
|
||||
scope.$on('closeUsersModal', function() {
|
||||
scope.closeModal();
|
||||
});
|
||||
|
||||
scope.compileList = function(html) {
|
||||
$('#add-users-list').append($compile(html)(scope));
|
||||
};
|
||||
scope.compileList = function(html) {
|
||||
$('#add-users-list').append($compile(html)(scope));
|
||||
};
|
||||
|
||||
Wait('stop');
|
||||
Wait('stop');
|
||||
|
||||
window.scrollTo(0,0);
|
||||
}
|
||||
};
|
||||
}
|
||||
];
|
||||
window.scrollTo(0,0);
|
||||
}
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
@ -4,13 +4,11 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default ['$stateParams', '$scope', 'UserList', 'Rest', '$state',
|
||||
'generateList', '$compile', 'Wait', 'OrgAdminList',
|
||||
'OrgAdminsDataset',
|
||||
'Prompt', 'ProcessErrors', 'GetBasePath', '$filter',
|
||||
function($stateParams, $scope, UserList, Rest, $state, GenerateList,
|
||||
$compile, Wait, OrgAdminList, OrgAdminsDataset, Prompt, ProcessErrors,
|
||||
GetBasePath, $filter) {
|
||||
export default ['$stateParams', '$scope', 'Rest', '$state', '$compile', 'Wait',
|
||||
'OrgAdminList', 'OrgAdminsDataset', 'Prompt', 'ProcessErrors',
|
||||
'GetBasePath', '$filter',
|
||||
function($stateParams, $scope, Rest, $state, $compile, Wait, OrgAdminList,
|
||||
OrgAdminsDataset, Prompt, ProcessErrors, GetBasePath, $filter) {
|
||||
|
||||
var orgBase = GetBasePath('organizations');
|
||||
|
||||
|
||||
@ -4,15 +4,12 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default ['$scope', '$rootScope', '$location', '$log',
|
||||
'$stateParams', 'Rest', 'Alert', 'Prompt', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
|
||||
'GetBasePath', 'JobTemplateForm', 'InitiatePlaybookRun', 'Wait', 'TemplateCopyService',
|
||||
'$compile', '$state', 'OrgJobTemplateList', 'OrgJobTemplateDataset', 'QuerySet',
|
||||
function($scope, $rootScope, $location, $log,
|
||||
$stateParams, Rest, Alert, Prompt, ReturnToCaller, ClearScope, ProcessErrors,
|
||||
GetBasePath, JobTemplateForm, InitiatePlaybookRun, Wait, TemplateCopyService,
|
||||
$compile, $state, OrgJobTemplateList, Dataset, qs) {
|
||||
|
||||
export default ['$scope', '$rootScope', '$stateParams', 'Rest', 'ProcessErrors',
|
||||
'GetBasePath', 'InitiatePlaybookRun', 'Wait', 'TemplateCopyService',
|
||||
'$state', 'OrgJobTemplateList', 'OrgJobTemplateDataset', 'QuerySet',
|
||||
function($scope, $rootScope, $stateParams, Rest, ProcessErrors, GetBasePath,
|
||||
InitiatePlaybookRun, Wait, TemplateCopyService, $state, OrgJobTemplateList,
|
||||
Dataset, qs) {
|
||||
var list = OrgJobTemplateList,
|
||||
orgBase = GetBasePath('organizations');
|
||||
|
||||
|
||||
@ -4,15 +4,14 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default ['$scope', '$rootScope', '$location', '$log',
|
||||
'$stateParams', 'Rest', 'Alert', 'Prompt',
|
||||
'ReturnToCaller', 'ClearScope', 'OrgProjectList', 'OrgProjectDataset',
|
||||
'ProcessErrors', 'GetBasePath', 'ProjectUpdate',
|
||||
'Wait', 'GetChoices', 'Empty', 'Find', 'GetProjectIcon', 'GetProjectToolTip', '$filter', '$state',
|
||||
function($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, Prompt,
|
||||
ReturnToCaller, ClearScope, OrgProjectList, Dataset,
|
||||
ProcessErrors, GetBasePath, ProjectUpdate,
|
||||
Wait, GetChoices, Empty, Find, GetProjectIcon, GetProjectToolTip, $filter, $state) {
|
||||
export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
|
||||
'OrgProjectList', 'OrgProjectDataset', 'ProcessErrors', 'GetBasePath',
|
||||
'ProjectUpdate', 'Wait', 'GetChoices', 'Empty', 'Find', 'GetProjectIcon',
|
||||
'GetProjectToolTip', '$filter', '$state',
|
||||
function($scope, $rootScope, $log, $stateParams, Rest, Alert,
|
||||
OrgProjectList, Dataset, ProcessErrors, GetBasePath, ProjectUpdate,
|
||||
Wait, GetChoices, Empty, Find, GetProjectIcon, GetProjectToolTip, $filter,
|
||||
$state) {
|
||||
|
||||
var list = OrgProjectList,
|
||||
projUrl,
|
||||
|
||||
@ -4,15 +4,10 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'OrgTeamList',
|
||||
'Rest', 'Alert', 'Prompt', 'OrgTeamsDataset', 'ReturnToCaller', 'ClearScope',
|
||||
'ProcessErrors', 'GetBasePath',
|
||||
'Wait', '$state',
|
||||
function($scope, $rootScope, $location, $log, $stateParams, OrgTeamList,
|
||||
Rest, Alert, Prompt, Dataset, ReturnToCaller, ClearScope,
|
||||
ProcessErrors, GetBasePath,
|
||||
Wait, $state) {
|
||||
|
||||
export default ['$scope', '$stateParams', 'OrgTeamList', 'Rest',
|
||||
'OrgTeamsDataset', 'GetBasePath', 'Wait', '$state',
|
||||
function($scope, $stateParams, OrgTeamList, Rest, Dataset, GetBasePath,
|
||||
Wait, $state) {
|
||||
var list = OrgTeamList,
|
||||
orgBase = GetBasePath('organizations');
|
||||
|
||||
|
||||
@ -5,11 +5,10 @@
|
||||
*************************************************/
|
||||
|
||||
export default ['$stateParams', '$scope', 'OrgUserList','Rest', '$state',
|
||||
'generateList', '$compile', 'Wait', 'OrgUsersDataset',
|
||||
'Prompt', 'ProcessErrors', 'GetBasePath', '$filter',
|
||||
function($stateParams, $scope, OrgUserList, Rest, $state, GenerateList,
|
||||
$compile, Wait, OrgUsersDataset, Prompt, ProcessErrors,
|
||||
GetBasePath, $filter) {
|
||||
'$compile', 'Wait', 'OrgUsersDataset', 'Prompt', 'ProcessErrors',
|
||||
'GetBasePath', '$filter',
|
||||
function($stateParams, $scope, OrgUserList, Rest, $state, $compile, Wait,
|
||||
OrgUsersDataset, Prompt, ProcessErrors, GetBasePath, $filter) {
|
||||
|
||||
var orgBase = GetBasePath('organizations');
|
||||
|
||||
|
||||
@ -10,6 +10,8 @@ import OrganizationsAdd from './add/organizations-add.controller';
|
||||
import OrganizationsEdit from './edit/organizations-edit.controller';
|
||||
import organizationsLinkout from './linkout/main';
|
||||
import OrganizationsLinkoutStates from './linkout/organizations-linkout.route';
|
||||
import OrganizationForm from './organizations.form';
|
||||
import OrganizationList from './organizations.list';
|
||||
import { N_ } from '../i18n';
|
||||
|
||||
|
||||
@ -20,6 +22,8 @@ angular.module('Organizations', [
|
||||
.controller('OrganizationsList', OrganizationsList)
|
||||
.controller('OrganizationsAdd', OrganizationsAdd)
|
||||
.controller('OrganizationsEdit', OrganizationsEdit)
|
||||
.factory('OrganizationForm', OrganizationForm)
|
||||
.factory('OrganizationList', OrganizationList)
|
||||
.config(['$stateProvider', 'stateDefinitionsProvider', '$stateExtenderProvider',
|
||||
function($stateProvider, stateDefinitionsProvider, $stateExtenderProvider) {
|
||||
let stateExtender = $stateExtenderProvider.$get(),
|
||||
|
||||
@ -10,10 +10,10 @@
|
||||
* @description This form is for adding/editing an organization
|
||||
*/
|
||||
|
||||
export default
|
||||
angular.module('OrganizationFormDefinition', [])
|
||||
.factory('OrganizationFormObject', ['i18n', function(i18n) {
|
||||
return {
|
||||
export default ['NotificationsList', 'i18n',
|
||||
function(NotificationsList, i18n) {
|
||||
return function() {
|
||||
var OrganizationFormObject = {
|
||||
|
||||
addTitle: i18n._('NEW ORGANIZATION'), //Title in add mode
|
||||
editTitle: '{{ name }}', //Title in edit mode
|
||||
@ -98,18 +98,15 @@ export default
|
||||
}
|
||||
|
||||
}
|
||||
};}])
|
||||
};
|
||||
|
||||
.factory('OrganizationForm', ['OrganizationFormObject', 'NotificationsList',
|
||||
function(OrganizationFormObject, NotificationsList) {
|
||||
return function() {
|
||||
var itm;
|
||||
for (itm in OrganizationFormObject.related) {
|
||||
if (OrganizationFormObject.related[itm].include === "NotificationsList") {
|
||||
OrganizationFormObject.related[itm] = NotificationsList;
|
||||
OrganizationFormObject.related[itm].generateList = true; // tell form generator to call list generator and inject a list
|
||||
}
|
||||
}
|
||||
return OrganizationFormObject;
|
||||
};
|
||||
}]);
|
||||
var itm;
|
||||
for (itm in OrganizationFormObject.related) {
|
||||
if (OrganizationFormObject.related[itm].include === "NotificationsList") {
|
||||
OrganizationFormObject.related[itm] = NotificationsList;
|
||||
OrganizationFormObject.related[itm].generateList = true; // tell form generator to call list generator and inject a list
|
||||
}
|
||||
}
|
||||
return OrganizationFormObject;
|
||||
};
|
||||
}];
|
||||
66
awx/ui/client/src/organizations/organizations.list.js
Normal file
66
awx/ui/client/src/organizations/organizations.list.js
Normal file
@ -0,0 +1,66 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
|
||||
export default [function() {
|
||||
return function() {
|
||||
return {
|
||||
name: 'organizations',
|
||||
iterator: 'organization',
|
||||
selectTitle: 'Add Organizations',
|
||||
selectInstructions: '<p>Select existing organizations by clicking each organization or checking the related checkbox. When finished, ' +
|
||||
'click the blue <em>Select</em> button, located bottom right.</p><p>Create a new organization by clicking the ' +
|
||||
'<i class=\"fa fa-plus\"></i> button.</p>',
|
||||
editTitle: 'Organizations',
|
||||
hover: true,
|
||||
index: false,
|
||||
|
||||
fields: {
|
||||
name: {
|
||||
key: true,
|
||||
label: 'Name',
|
||||
columnClass: 'col-lg-4 col-md-6 col-sm-8 col-xs-8'
|
||||
},
|
||||
description: {
|
||||
label: 'Description',
|
||||
columnClass: 'hidden-sm hidden-xs',
|
||||
excludeModal: true
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
add: {
|
||||
mode: 'all', // One of: edit, select, all
|
||||
ngClick: 'addOrganization()',
|
||||
awToolTip: 'Create a new organization',
|
||||
awFeature: 'multiple_organizations',
|
||||
actionClass: 'btn List-buttonSubmit',
|
||||
buttonContent: '+ ADD'
|
||||
}
|
||||
},
|
||||
|
||||
fieldActions: {
|
||||
edit: {
|
||||
label: 'Edit',
|
||||
ngClick: "editOrganization(organization.id)",
|
||||
icon: 'icon-edit',
|
||||
"class": 'btn-xs btn-default',
|
||||
awToolTip: 'Edit organization',
|
||||
dataPlacement: 'top'
|
||||
},
|
||||
|
||||
"delete": {
|
||||
label: 'Delete',
|
||||
ngClick: "deleteOrganization(organization.id, organization.name)",
|
||||
icon: 'icon-trash',
|
||||
"class": 'btn-xs btn-danger',
|
||||
awToolTip: 'Delete organization',
|
||||
dataPlacement: 'top'
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}];
|
||||
Loading…
x
Reference in New Issue
Block a user