/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Workflow
* @description This form is for adding/editing a Workflow
*/
export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
return function() {
var WorkflowFormObject = {
addTitle: i18n._('NEW WORKFLOW JOB TEMPLATE'),
editTitle: '{{ name }}',
name: 'workflow_job_template',
breadcrumbName: i18n._('WORKFLOW'),
base: 'workflow',
basePath: 'workflow_job_templates',
// the top-most node of generated state tree
stateTree: 'templates',
activeEditState: 'templates.editWorkflowJobTemplate',
tabs: true,
detailsClick: "$state.go('templates.editWorkflowJobTemplate')",
include: ['/static/partials/survey-maker-modal.html'],
fields: {
name: {
label: i18n._('Name'),
type: 'text',
required: true,
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)',
column: 1
},
description: {
label: i18n._('Description'),
type: 'text',
column: 1,
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
},
organization: {
label: i18n._('Organization'),
type: 'lookup',
sourceModel: 'organization',
basePath: 'organizations',
list: 'OrganizationList',
sourceField: 'name',
dataTitle: i18n._('Organization'),
dataContainer: 'body',
dataPlacement: 'right',
column: 1,
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate) || !canEditOrg',
awLookupWhen: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate) && canEditOrg'
},
labels: {
label: i18n._('Labels'),
type: 'select',
class: 'Form-formGroup--fullWidth',
ngOptions: 'label.label for label in labelOptions track by label.value',
multiSelect: true,
dataTitle: i18n._('Labels'),
dataPlacement: 'right',
awPopOver: "
" + i18n._("Optional labels that describe this job template, such as 'dev' or 'test'. Labels can be used to group and filter job templates and completed jobs in the Tower display.") + "
" + i18n.sprintf(i18n._("Pass extra command line variables to the playbook. This is the %s or %s command line parameter " +
"for %s. Provide key/value pairs using either YAML or JSON."), "-e", "--extra-vars", "ansible-playbook") + "