Files
awx/awx/ui/static/js/lists/ScanJobs.js
Jared Tabor 79b79f0481 initial files for license diff directive
awLicenseFeature with show/hide

changed file locations

changing file location

adjusting controller logic to only return list of features

leveraging $rootScope instead of local storage

adding awFeature directive for lists/forms for activity stream button

Adding route resolvers and service for getting license

In order to get the license info from the API and not from local storage, the UI needs to hit hte API before loading any pages, therefore I've added route resolvers that will ensure that we have the appropriate data (license features) before navigating to a new page. I've also added the awFeature directive to the organizations list -> add-button and the ldap checkbox on the user form page.

adjusting alignment

fixing jshint errors

commting file for testings

adding tests for features service and features controller

adding features controller unit test
2015-05-04 11:34:38 -04:00

96 lines
2.9 KiB
JavaScript

/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*
* Jobs.js
* List view object for job data model.
*
* Used on dashboard to provide a list of all jobs, regardless of
* status.
*
*/
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',
ngHide: 'portalMode===true'
},
stream: {
ngClick: "showActivity()",
awToolTip: "View Activity Stream",
icon: "icon-comments-alt",
mode: 'edit',
ngHide: 'portalMode===true',
awFeature: 'activity_streams'
}
},
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',
ngHref: '#/job_templates/{{ job_template.id }}/schedules',
awToolTip: 'Schedule future job template runs',
dataPlacement: 'top',
},
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',
},
copy: {
label: 'Copy',
ngClick: "copyJobTemplate(job_template.id, job_template.name)",
"class": 'btn-danger btn-xs',
awToolTip: 'Copy template',
dataPlacement: 'top',
ngHide: 'job_template.summary_fields.can_copy===false'
}
}
});