diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index b2af552581..577ce739b8 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -149,7 +149,6 @@ var tower = angular.module('Tower', [ 'InventoryHostsDefinition', 'HostsHelper', 'AWFilters', - 'ScanJobsListDefinition', 'HostFormDefinition', 'HostListDefinition', 'GroupFormDefinition', diff --git a/awx/ui/client/src/forms/Inventories.js b/awx/ui/client/src/forms/Inventories.js index 5d96ebfaa5..bde0d2d712 100644 --- a/awx/ui/client/src/forms/Inventories.js +++ b/awx/ui/client/src/forms/Inventories.js @@ -11,8 +11,8 @@ */ export default -angular.module('InventoryFormDefinition', ['ScanJobsListDefinition']) - .factory('InventoryFormObject', ['i18n', function(i18n) { +angular.module('InventoryFormDefinition', []) + .factory('InventoryForm', ['i18n', function(i18n) { return { addTitle: i18n._('New Inventory'), @@ -181,19 +181,4 @@ angular.module('InventoryFormDefinition', ['ScanJobsListDefinition']) }; } - };}]) - - .factory('InventoryForm', ['InventoryFormObject', 'ScanJobsList', - function(InventoryFormObject, ScanJobsList) { - return function() { - var itm; - for (itm in InventoryFormObject.related) { - if (InventoryFormObject.related[itm].include === "ScanJobsList") { - InventoryFormObject.related[itm] = ScanJobsList; - InventoryFormObject.related[itm].generateList = true; // tell form generator to call list generator and inject a list - } - } - return InventoryFormObject; - }; - } - ]); + };}]); diff --git a/awx/ui/client/src/inventories/add/inventory-add.controller.js b/awx/ui/client/src/inventories/add/inventory-add.controller.js index e6f9b7e3a3..a20fb44891 100644 --- a/awx/ui/client/src/inventories/add/inventory-add.controller.js +++ b/awx/ui/client/src/inventories/add/inventory-add.controller.js @@ -34,7 +34,7 @@ function InventoriesAdd($scope, $rootScope, $compile, $location, $log, // Inject dynamic view var defaultUrl = GetBasePath('inventory'), - form = InventoryForm(); + form = InventoryForm; init(); diff --git a/awx/ui/client/src/inventories/edit/inventory-edit.controller.js b/awx/ui/client/src/inventories/edit/inventory-edit.controller.js index 3e26dec8dc..d07a865766 100644 --- a/awx/ui/client/src/inventories/edit/inventory-edit.controller.js +++ b/awx/ui/client/src/inventories/edit/inventory-edit.controller.js @@ -14,11 +14,11 @@ function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $stateParams, InventoryForm, Rest, Alert, ProcessErrors, ClearScope, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Prompt, InitiatePlaybookRun, - TemplatesService, $state, $filter) { + TemplatesService, $state) { // Inject dynamic view var defaultUrl = GetBasePath('inventory'), - form = InventoryForm(), + form = InventoryForm, inventory_id = $stateParams.inventory_id, master = {}, fld, json_data, data; @@ -125,54 +125,11 @@ function InventoriesEdit($scope, $rootScope, $compile, $location, $state.go('inventories'); }; - $scope.addScanJob = function() { - $location.path($location.path() + '/job_templates/add'); - }; - - $scope.launchScanJob = function() { - InitiatePlaybookRun({ scope: $scope, id: this.scan_job_template.id }); - }; - - $scope.scheduleScanJob = function() { - $location.path('/job_templates/' + this.scan_job_template.id + '/schedules'); - }; - - $scope.editScanJob = function() { - $location.path($location.path() + '/job_templates/' + this.scan_job_template.id); - }; - - $scope.deleteScanJob = function () { - var id = this.scan_job_template.id , - action = function () { - $('#prompt-modal').modal('hide'); - Wait('start'); - TemplatesService.deleteJobTemplate(id) - .success(function () { - $('#prompt-modal').modal('hide'); - // @issue: OLD SEARCH - // $scope.search(form.related.scan_job_templates.iterator); - }) - .error(function (data) { - Wait('stop'); - ProcessErrors($scope, data, status, null, { hdr: 'Error!', - msg: 'DELETE returned status: ' + status }); - }); - }; - - Prompt({ - hdr: 'Delete', - body: '
Are you sure you want to delete the job template below?
' + $filter('sanitize')(this.scan_job_template.name) + '
', - action: action, - actionText: 'DELETE' - }); - - }; - } export default ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'InventoryForm', 'Rest', 'Alert', 'ProcessErrors', 'ClearScope', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Prompt', 'InitiatePlaybookRun', - 'TemplatesService', '$state', '$filter', InventoriesEdit, + 'TemplatesService', '$state', InventoriesEdit, ]; diff --git a/awx/ui/client/src/lists.js b/awx/ui/client/src/lists.js index 3a02e6a127..18393e27cd 100644 --- a/awx/ui/client/src/lists.js +++ b/awx/ui/client/src/lists.js @@ -21,7 +21,6 @@ import Organizations from "./lists/Organizations"; import PortalJobTemplates from "./lists/PortalJobTemplates"; import PortalJobs from "./lists/PortalJobs"; import Projects from "./lists/Projects"; -import ScanJobsList from "./lists/ScanJobs"; import ScheduledJobs from "./lists/ScheduledJobs"; import Schedules from "./lists/Schedules"; import Streams from "./lists/Streams"; @@ -47,7 +46,6 @@ export PortalJobTemplates, PortalJobs, Projects, - ScanJobsList, ScheduledJobs, Schedules, Streams, diff --git a/awx/ui/client/src/lists/ScanJobs.js b/awx/ui/client/src/lists/ScanJobs.js deleted file mode 100644 index 418f35e23e..0000000000 --- a/awx/ui/client/src/lists/ScanJobs.js +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************* - * Copyright (c) 2015 Ansible, Inc. - * - * All Rights Reserved - *************************************************/ - - -export default - angular.module('ScanJobsListDefinition', []) - .value( 'ScanJobsList', { - - name: 'scan_job_templates', - iterator: 'scan_job_template', - editTitle: 'Scan Jobs', - 'class': 'table-condensed', - index: false, - hover: true, - well: false, - - fields: { - name: { - key: true, - label: 'Name', - // columnClass: 'col-lg-5 col-md-5 col-sm-9 col-xs-8' - }, - description: { - label: 'Description', - // columnClass: 'col-lg-4 col-md-3 hidden-sm hidden-xs' - } - }, - - actions: { - add: { - mode: 'all', // One of: edit, select, all - ngClick: 'addScanJobTemplate()', - basePaths: ['job_templates'], - awToolTip: 'Create a new template', - actionClass: 'btn List-buttonSubmit', - buttonContent: '+ ADD' - } - }, - - fieldActions: { - submit: { - label: 'Launch', - mode: 'all', - ngClick: 'submitJob(job_template.id)', - awToolTip: 'Start a job using this template', - dataPlacement: 'top' - }, - schedule: { - label: 'Schedule', - mode: 'all', - ngClick: 'scheduleJob(job_template.id)', - awToolTip: 'Schedule future job template runs', - dataPlacement: 'top', - }, - copy: { - label: 'Copy', - 'ui-sref': 'jobTemplates.copy({id: job_template.id})', "class": 'btn-danger btn-xs', - awToolTip: 'Copy template', - dataPlacement: 'top', - ngHide: 'job_template.summary_fields.can_copy===false' - - }, - edit: { - label: 'Edit', - ngClick: "editJobTemplate(job_template.id)", - awToolTip: 'Edit template', - "class": 'btn-default btn-xs', - dataPlacement: 'top', - }, - "delete": { - label: 'Delete', - ngClick: "deleteJobTemplate(job_template.id, job_template.name)", - "class": 'btn-danger btn-xs', - awToolTip: 'Delete template', - dataPlacement: 'top', - } - } - });