Removed ScanJobs list - no longer used.

This commit is contained in:
Michael Abashian 2017-01-19 14:43:34 -05:00
parent 9550564d5d
commit bfa099d80a
6 changed files with 7 additions and 149 deletions

View File

@ -149,7 +149,6 @@ var tower = angular.module('Tower', [
'InventoryHostsDefinition',
'HostsHelper',
'AWFilters',
'ScanJobsListDefinition',
'HostFormDefinition',
'HostListDefinition',
'GroupFormDefinition',

View File

@ -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;
};
}
]);
};}]);

View File

@ -34,7 +34,7 @@ function InventoriesAdd($scope, $rootScope, $compile, $location, $log,
// Inject dynamic view
var defaultUrl = GetBasePath('inventory'),
form = InventoryForm();
form = InventoryForm;
init();

View File

@ -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: '<div class="Prompt-bodyQuery">Are you sure you want to delete the job template below?</div><div class="Prompt-bodyTarget">' + $filter('sanitize')(this.scan_job_template.name) + '</div>',
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,
];

View File

@ -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,

View File

@ -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: '&#43; 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',
}
}
});