mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
Add help text to JT and WJT forms.
This commit is contained in:
@@ -25,9 +25,10 @@ import Sparkline from 'components/Sparkline';
|
|||||||
import { toTitleCase } from 'util/strings';
|
import { toTitleCase } from 'util/strings';
|
||||||
import { relatedResourceDeleteRequests } from 'util/getRelatedResourceDeleteDetails';
|
import { relatedResourceDeleteRequests } from 'util/getRelatedResourceDeleteDetails';
|
||||||
import useRequest, { useDismissableError } from 'hooks/useRequest';
|
import useRequest, { useDismissableError } from 'hooks/useRequest';
|
||||||
import jtHelpTextStrings from '../shared/JobTemplate.helptext';
|
import wfHelpTextStrings from '../shared/WorkflowJobTemplate.helptext';
|
||||||
|
|
||||||
|
const helpText = wfHelpTextStrings();
|
||||||
|
|
||||||
const helpText = jtHelpTextStrings();
|
|
||||||
function WorkflowJobTemplateDetail({ template }) {
|
function WorkflowJobTemplateDetail({ template }) {
|
||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
@@ -137,11 +138,7 @@ function WorkflowJobTemplateDetail({ template }) {
|
|||||||
helpText={helpText.sourceControlBranch}
|
helpText={helpText.sourceControlBranch}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Detail
|
<Detail label={t`Job Type`} value={toTitleCase(type)} />
|
||||||
label={t`Job Type`}
|
|
||||||
value={toTitleCase(type)}
|
|
||||||
helpText={helpText.jobType}
|
|
||||||
/>
|
|
||||||
{summary_fields.inventory && (
|
{summary_fields.inventory && (
|
||||||
<Detail
|
<Detail
|
||||||
label={t`Inventory`}
|
label={t`Inventory`}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { t } from '@lingui/macro';
|
import { t } from '@lingui/macro';
|
||||||
|
|
||||||
const jtHelpTextStrings = () => ({
|
const jtHelpTextStrings = (brandName = '') => ({
|
||||||
jobType: t`For job templates, select run to execute the playbook. Select check to only check playbook syntax, test environment setup, and report problems without executing the playbook.`,
|
jobType: t`For job templates, select run to execute the playbook. Select check to only check playbook syntax, test environment setup, and report problems without executing the playbook.`,
|
||||||
inventory: t`Select the inventory containing the hosts you want this job to manage.`,
|
inventory: t`Select the inventory containing the hosts you want this job to manage.`,
|
||||||
project: t`Select the project containing the playbook you want this job to execute.`,
|
project: t`Select the project containing the playbook you want this job to execute.`,
|
||||||
@@ -10,7 +10,6 @@ const jtHelpTextStrings = () => ({
|
|||||||
credentials: t`Select credentials for accessing the nodes this job will be ran against. You can only select one credential of each type. For machine credentials (SSH), checking "Prompt on launch" without selecting credentials will require you to select a machine credential at run time. If you select credentials and check "Prompt on launch", the selected credential(s) become the defaults that can be updated at run time.`,
|
credentials: t`Select credentials for accessing the nodes this job will be ran against. You can only select one credential of each type. For machine credentials (SSH), checking "Prompt on launch" without selecting credentials will require you to select a machine credential at run time. If you select credentials and check "Prompt on launch", the selected credential(s) become the defaults that can be updated at run time.`,
|
||||||
labels: t`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.`,
|
labels: t`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.`,
|
||||||
variables: t`Pass extra command line variables to the playbook. This is the -e or --extra-vars command line parameter for ansible-playbook. Provide key/value pairs using either YAML or JSON. Refer to the documentation for example syntax.`,
|
variables: t`Pass extra command line variables to the playbook. This is the -e or --extra-vars command line parameter for ansible-playbook. Provide key/value pairs using either YAML or JSON. Refer to the documentation for example syntax.`,
|
||||||
forks: t`The number of parallel or simultaneous processes to use while executing the playbook. An empty value, or a value less than 1 will use the Ansible default which is usually 5. The default number of forks can be overwritten with a change to ansible.cfg. Refer to the Ansible documentation for details about the configuration file.`,
|
|
||||||
limit: t`Provide a host pattern to further constrain the list of hosts that will be managed or affected by the playbook. Multiple patterns are allowed. Refer to Ansible documentation for more information and examples on patterns.`,
|
limit: t`Provide a host pattern to further constrain the list of hosts that will be managed or affected by the playbook. Multiple patterns are allowed. Refer to Ansible documentation for more information and examples on patterns.`,
|
||||||
verbosity: t`Control the level of output ansible will produce as the playbook executes.`,
|
verbosity: t`Control the level of output ansible will produce as the playbook executes.`,
|
||||||
jobSlicing: t`Divide the work done by this job template into the specified number of job slices, each running the same tasks against a portion of the inventory.`,
|
jobSlicing: t`Divide the work done by this job template into the specified number of job slices, each running the same tasks against a portion of the inventory.`,
|
||||||
@@ -24,6 +23,11 @@ const jtHelpTextStrings = () => ({
|
|||||||
webhookKey: t`Webhook services can use this as a shared secret.`,
|
webhookKey: t`Webhook services can use this as a shared secret.`,
|
||||||
webhookCredential: t`Optionally select the credential to use to send status updates back to the webhook service.`,
|
webhookCredential: t`Optionally select the credential to use to send status updates back to the webhook service.`,
|
||||||
sourceControlBranch: t`Select a branch for the workflow. This branch is applied to all job template nodes that prompt for a branch.`,
|
sourceControlBranch: t`Select a branch for the workflow. This branch is applied to all job template nodes that prompt for a branch.`,
|
||||||
|
provisioningCallbacks: t`Enables creation of a provisioning callback URL. Using the URL a host can contact ${brandName} and request a configuration update using this job template.`,
|
||||||
|
privilegeEscalation: t`If enabled, run this playbook as an administrator.`,
|
||||||
|
enableWebhook: t`Enable webhook for this template.`,
|
||||||
|
concurrentJobs: t`If enabled, simultaneous runs of this job template will be allowed.`,
|
||||||
|
enableFactStorage: t`If enabled, this will store gathered facts so they can be viewed at the host level. Facts are persisted and injected into the fact cache at runtime.`,
|
||||||
enabledOptions: (
|
enabledOptions: (
|
||||||
<>
|
<>
|
||||||
<p>{t`Concurrent jobs: If enabled, simultaneous runs of this job template will be allowed.`}</p>
|
<p>{t`Concurrent jobs: If enabled, simultaneous runs of this job template will be allowed.`}</p>
|
||||||
@@ -33,6 +37,13 @@ const jtHelpTextStrings = () => ({
|
|||||||
<p>{t`Webhooks: Enable webhook for this template.`}</p>
|
<p>{t`Webhooks: Enable webhook for this template.`}</p>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
|
forks: (
|
||||||
|
<span>
|
||||||
|
{t`The number of parallel or simultaneous processes to use while executing the playbook. An empty value, or a value less than 1 will use the Ansible default which is usually 5. The default number of forks can be overwritten with a change to`}{' '}
|
||||||
|
<code>ansible.cfg</code>.{' '}
|
||||||
|
{t`Refer to the Ansible documentation for details about the configuration file.`}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default jtHelpTextStrings;
|
export default jtHelpTextStrings;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import useIsMounted from 'hooks/useIsMounted';
|
|||||||
import LabelSelect from 'components/LabelSelect';
|
import LabelSelect from 'components/LabelSelect';
|
||||||
import PlaybookSelect from './PlaybookSelect';
|
import PlaybookSelect from './PlaybookSelect';
|
||||||
import WebhookSubForm from './WebhookSubForm';
|
import WebhookSubForm from './WebhookSubForm';
|
||||||
|
import jtHelpTextStrings from './JobTemplate.helptext';
|
||||||
|
|
||||||
const { origin } = document.location;
|
const { origin } = document.location;
|
||||||
|
|
||||||
@@ -67,6 +68,7 @@ function JobTemplateForm({
|
|||||||
);
|
);
|
||||||
const isMounted = useIsMounted();
|
const isMounted = useIsMounted();
|
||||||
const brandName = useBrandName();
|
const brandName = useBrandName();
|
||||||
|
const helpText = jtHelpTextStrings(brandName);
|
||||||
|
|
||||||
const [askInventoryOnLaunchField] = useField('ask_inventory_on_launch');
|
const [askInventoryOnLaunchField] = useField('ask_inventory_on_launch');
|
||||||
const [jobTypeField, jobTypeMeta, jobTypeHelpers] = useField({
|
const [jobTypeField, jobTypeMeta, jobTypeHelpers] = useField({
|
||||||
@@ -258,10 +260,7 @@ function JobTemplateForm({
|
|||||||
label={t`Job Type`}
|
label={t`Job Type`}
|
||||||
promptId="template-ask-job-type-on-launch"
|
promptId="template-ask-job-type-on-launch"
|
||||||
promptName="ask_job_type_on_launch"
|
promptName="ask_job_type_on_launch"
|
||||||
tooltip={t`For job templates, select run to execute
|
tooltip={helpText.jobType}
|
||||||
the playbook. Select check to only check playbook syntax,
|
|
||||||
test environment setup, and report problems without
|
|
||||||
executing the playbook.`}
|
|
||||||
>
|
>
|
||||||
<AnsibleSelect
|
<AnsibleSelect
|
||||||
{...jobTypeField}
|
{...jobTypeField}
|
||||||
@@ -290,8 +289,7 @@ function JobTemplateForm({
|
|||||||
promptId="template-ask-inventory-on-launch"
|
promptId="template-ask-inventory-on-launch"
|
||||||
promptName="ask_inventory_on_launch"
|
promptName="ask_inventory_on_launch"
|
||||||
isPromptableField
|
isPromptableField
|
||||||
tooltip={t`Select the inventory containing the hosts
|
tooltip={helpText.inventory}
|
||||||
you want this job to manage.`}
|
|
||||||
onBlur={() => inventoryHelpers.setTouched()}
|
onBlur={() => inventoryHelpers.setTouched()}
|
||||||
onChange={handleInventoryUpdate}
|
onChange={handleInventoryUpdate}
|
||||||
required={!askInventoryOnLaunchField.value}
|
required={!askInventoryOnLaunchField.value}
|
||||||
@@ -305,8 +303,7 @@ function JobTemplateForm({
|
|||||||
<ProjectLookup
|
<ProjectLookup
|
||||||
value={projectField.value}
|
value={projectField.value}
|
||||||
onBlur={() => projectHelpers.setTouched()}
|
onBlur={() => projectHelpers.setTouched()}
|
||||||
tooltip={t`Select the project containing the playbook
|
tooltip={helpText.project}
|
||||||
you want this job to execute.`}
|
|
||||||
isValid={Boolean(
|
isValid={Boolean(
|
||||||
!projectMeta.touched || (!projectMeta.error && projectField.value)
|
!projectMeta.touched || (!projectMeta.error && projectField.value)
|
||||||
)}
|
)}
|
||||||
@@ -326,7 +323,7 @@ function JobTemplateForm({
|
|||||||
onBlur={() => executionEnvironmentHelpers.setTouched()}
|
onBlur={() => executionEnvironmentHelpers.setTouched()}
|
||||||
value={executionEnvironmentField.value}
|
value={executionEnvironmentField.value}
|
||||||
onChange={handleExecutionEnvironmentUpdate}
|
onChange={handleExecutionEnvironmentUpdate}
|
||||||
popoverContent={t`Select the execution environment for this job template.`}
|
popoverContent={helpText.executionEnvironment}
|
||||||
tooltip={t`Select a project before editing the execution environment.`}
|
tooltip={t`Select a project before editing the execution environment.`}
|
||||||
globallyAvailable
|
globallyAvailable
|
||||||
isDisabled={!projectField.value?.id}
|
isDisabled={!projectField.value?.id}
|
||||||
@@ -339,8 +336,7 @@ function JobTemplateForm({
|
|||||||
label={t`Source Control Branch`}
|
label={t`Source Control Branch`}
|
||||||
promptId="template-ask-scm-branch-on-launch"
|
promptId="template-ask-scm-branch-on-launch"
|
||||||
promptName="ask_scm_branch_on_launch"
|
promptName="ask_scm_branch_on_launch"
|
||||||
tooltip={t`Select a branch for the job template. This branch is applied to
|
tooltip={helpText.sourceControlBranch}
|
||||||
all job template nodes that prompt for a branch.`}
|
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
id="template-scm-branch"
|
id="template-scm-branch"
|
||||||
@@ -360,11 +356,7 @@ function JobTemplateForm({
|
|||||||
}
|
}
|
||||||
isRequired
|
isRequired
|
||||||
label={t`Playbook`}
|
label={t`Playbook`}
|
||||||
labelIcon={
|
labelIcon={<Popover content={helpText.playbook} />}
|
||||||
<Popover
|
|
||||||
content={t`Select the playbook to be executed by this job.`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<PlaybookSelect
|
<PlaybookSelect
|
||||||
onChange={handlePlaybookUpdate}
|
onChange={handlePlaybookUpdate}
|
||||||
@@ -381,11 +373,7 @@ function JobTemplateForm({
|
|||||||
label={t`Credentials`}
|
label={t`Credentials`}
|
||||||
promptId="template-ask-credential-on-launch"
|
promptId="template-ask-credential-on-launch"
|
||||||
promptName="ask_credential_on_launch"
|
promptName="ask_credential_on_launch"
|
||||||
tooltip={t`Select credentials for accessing the nodes this job will be ran
|
tooltip={helpText.credentials}
|
||||||
against. You can only select one credential of each type. For machine credentials (SSH),
|
|
||||||
checking "Prompt on launch" without selecting credentials will require you to select a machine
|
|
||||||
credential at run time. If you select credentials and check "Prompt on launch", the selected
|
|
||||||
credential(s) become the defaults that can be updated at run time.`}
|
|
||||||
>
|
>
|
||||||
<MultiCredentialsLookup
|
<MultiCredentialsLookup
|
||||||
value={credentialField.value}
|
value={credentialField.value}
|
||||||
@@ -397,13 +385,7 @@ function JobTemplateForm({
|
|||||||
</FieldWithPrompt>
|
</FieldWithPrompt>
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={t`Labels`}
|
label={t`Labels`}
|
||||||
labelIcon={
|
labelIcon={<Popover content={helpText.labels} />}
|
||||||
<Popover
|
|
||||||
content={t`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.`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
fieldId="template-labels"
|
fieldId="template-labels"
|
||||||
>
|
>
|
||||||
<LabelSelect
|
<LabelSelect
|
||||||
@@ -418,10 +400,7 @@ function JobTemplateForm({
|
|||||||
name="extra_vars"
|
name="extra_vars"
|
||||||
label={t`Variables`}
|
label={t`Variables`}
|
||||||
promptId="template-ask-variables-on-launch"
|
promptId="template-ask-variables-on-launch"
|
||||||
tooltip={t`Pass extra command line variables to the playbook. This is the
|
tooltip={helpText.variables}
|
||||||
-e or --extra-vars command line parameter for ansible-playbook.
|
|
||||||
Provide key/value pairs using either YAML or JSON. Refer to the
|
|
||||||
documentation for example syntax.`}
|
|
||||||
/>
|
/>
|
||||||
<FormColumnLayout>
|
<FormColumnLayout>
|
||||||
<FormField
|
<FormField
|
||||||
@@ -430,28 +409,14 @@ function JobTemplateForm({
|
|||||||
type="number"
|
type="number"
|
||||||
min="0"
|
min="0"
|
||||||
label={t`Forks`}
|
label={t`Forks`}
|
||||||
tooltip={
|
tooltip={helpText.forks}
|
||||||
<span>
|
|
||||||
{t`The number of parallel or simultaneous
|
|
||||||
processes to use while executing the playbook. An empty value,
|
|
||||||
or a value less than 1 will use the Ansible default which is
|
|
||||||
usually 5. The default number of forks can be overwritten
|
|
||||||
with a change to`}{' '}
|
|
||||||
<code>ansible.cfg</code>.{' '}
|
|
||||||
{t`Refer to the Ansible documentation for details
|
|
||||||
about the configuration file.`}
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<FieldWithPrompt
|
<FieldWithPrompt
|
||||||
fieldId="template-limit"
|
fieldId="template-limit"
|
||||||
label={t`Limit`}
|
label={t`Limit`}
|
||||||
promptId="template-ask-limit-on-launch"
|
promptId="template-ask-limit-on-launch"
|
||||||
promptName="ask_limit_on_launch"
|
promptName="ask_limit_on_launch"
|
||||||
tooltip={t`Provide a host pattern to further constrain
|
tooltip={helpText.limit}
|
||||||
the list of hosts that will be managed or affected by the
|
|
||||||
playbook. Multiple patterns are allowed. Refer to Ansible
|
|
||||||
documentation for more information and examples on patterns.`}
|
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
id="template-limit"
|
id="template-limit"
|
||||||
@@ -469,8 +434,7 @@ function JobTemplateForm({
|
|||||||
label={t`Verbosity`}
|
label={t`Verbosity`}
|
||||||
promptId="template-ask-verbosity-on-launch"
|
promptId="template-ask-verbosity-on-launch"
|
||||||
promptName="ask_verbosity_on_launch"
|
promptName="ask_verbosity_on_launch"
|
||||||
tooltip={t`Control the level of output ansible will
|
tooltip={helpText.verbosity}
|
||||||
produce as the playbook executes.`}
|
|
||||||
>
|
>
|
||||||
<AnsibleSelect
|
<AnsibleSelect
|
||||||
id="template-verbosity"
|
id="template-verbosity"
|
||||||
@@ -484,9 +448,7 @@ function JobTemplateForm({
|
|||||||
type="number"
|
type="number"
|
||||||
min="1"
|
min="1"
|
||||||
label={t`Job Slicing`}
|
label={t`Job Slicing`}
|
||||||
tooltip={t`Divide the work done by this job template
|
tooltip={helpText.jobSlicing}
|
||||||
into the specified number of job slices, each running the
|
|
||||||
same tasks against a portion of the inventory.`}
|
|
||||||
/>
|
/>
|
||||||
<FormField
|
<FormField
|
||||||
id="template-timeout"
|
id="template-timeout"
|
||||||
@@ -494,18 +456,14 @@ function JobTemplateForm({
|
|||||||
type="number"
|
type="number"
|
||||||
min="0"
|
min="0"
|
||||||
label={t`Timeout`}
|
label={t`Timeout`}
|
||||||
tooltip={t`The amount of time (in seconds) to run
|
tooltip={helpText.timeout}
|
||||||
before the job is canceled. Defaults to 0 for no job
|
|
||||||
timeout.`}
|
|
||||||
/>
|
/>
|
||||||
<FieldWithPrompt
|
<FieldWithPrompt
|
||||||
fieldId="template-diff-mode"
|
fieldId="template-diff-mode"
|
||||||
label={t`Show Changes`}
|
label={t`Show Changes`}
|
||||||
promptId="template-ask-diff-mode-on-launch"
|
promptId="template-ask-diff-mode-on-launch"
|
||||||
promptName="ask_diff_mode_on_launch"
|
promptName="ask_diff_mode_on_launch"
|
||||||
tooltip={t`If enabled, show the changes made by
|
tooltip={helpText.showChanges}
|
||||||
Ansible tasks, where supported. This is equivalent
|
|
||||||
to Ansible's --diff mode.`}
|
|
||||||
>
|
>
|
||||||
<Switch
|
<Switch
|
||||||
id="template-show-changes"
|
id="template-show-changes"
|
||||||
@@ -518,8 +476,7 @@ function JobTemplateForm({
|
|||||||
<InstanceGroupsLookup
|
<InstanceGroupsLookup
|
||||||
value={instanceGroupsField.value}
|
value={instanceGroupsField.value}
|
||||||
onChange={(value) => instanceGroupsHelpers.setValue(value)}
|
onChange={(value) => instanceGroupsHelpers.setValue(value)}
|
||||||
tooltip={t`Select the Instance Groups for this Job Template
|
tooltip={helpText.instanceGroups}
|
||||||
to run on.`}
|
|
||||||
fieldName="instanceGroups"
|
fieldName="instanceGroups"
|
||||||
/>
|
/>
|
||||||
<FieldWithPrompt
|
<FieldWithPrompt
|
||||||
@@ -527,11 +484,7 @@ function JobTemplateForm({
|
|||||||
label={t`Job Tags`}
|
label={t`Job Tags`}
|
||||||
promptId="template-ask-tags-on-launch"
|
promptId="template-ask-tags-on-launch"
|
||||||
promptName="ask_tags_on_launch"
|
promptName="ask_tags_on_launch"
|
||||||
tooltip={t`Tags are useful when you have a large
|
tooltip={helpText.jobTags}
|
||||||
playbook, and you want to run a specific part of a
|
|
||||||
play or task. Use commas to separate multiple tags.
|
|
||||||
Refer to the documentation for details on
|
|
||||||
the usage of tags.`}
|
|
||||||
>
|
>
|
||||||
<TagMultiSelect
|
<TagMultiSelect
|
||||||
value={jobTagsField.value}
|
value={jobTagsField.value}
|
||||||
@@ -543,11 +496,7 @@ function JobTemplateForm({
|
|||||||
label={t`Skip Tags`}
|
label={t`Skip Tags`}
|
||||||
promptId="template-ask-skip-tags-on-launch"
|
promptId="template-ask-skip-tags-on-launch"
|
||||||
promptName="ask_skip_tags_on_launch"
|
promptName="ask_skip_tags_on_launch"
|
||||||
tooltip={t`Skip tags are useful when you have a
|
tooltip={helpText.skipTags}
|
||||||
large playbook, and you want to skip specific parts of a
|
|
||||||
play or task. Use commas to separate multiple tags. Refer
|
|
||||||
to the documentation for details on the usage
|
|
||||||
of tags.`}
|
|
||||||
>
|
>
|
||||||
<TagMultiSelect
|
<TagMultiSelect
|
||||||
value={skipTagsField.value}
|
value={skipTagsField.value}
|
||||||
@@ -563,8 +512,7 @@ function JobTemplateForm({
|
|||||||
id="option-privilege-escalation"
|
id="option-privilege-escalation"
|
||||||
name="become_enabled"
|
name="become_enabled"
|
||||||
label={t`Privilege Escalation`}
|
label={t`Privilege Escalation`}
|
||||||
tooltip={t`If enabled, run this playbook as an
|
tooltip={helpText.privilegeEscalation}
|
||||||
administrator.`}
|
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
aria-label={t`Provisioning Callbacks`}
|
aria-label={t`Provisioning Callbacks`}
|
||||||
@@ -572,12 +520,7 @@ function JobTemplateForm({
|
|||||||
<span>
|
<span>
|
||||||
{t`Provisioning Callbacks`}
|
{t`Provisioning Callbacks`}
|
||||||
|
|
||||||
<Popover
|
<Popover content={helpText.provisioningCallbacks} />
|
||||||
content={t`Enables creation of a provisioning
|
|
||||||
callback URL. Using the URL a host can contact ${brandName}
|
|
||||||
and request a configuration update using this job
|
|
||||||
template.`}
|
|
||||||
/>
|
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
id="option-callbacks"
|
id="option-callbacks"
|
||||||
@@ -593,9 +536,7 @@ function JobTemplateForm({
|
|||||||
<span>
|
<span>
|
||||||
{t`Enable Webhook`}
|
{t`Enable Webhook`}
|
||||||
|
|
||||||
<Popover
|
<Popover content={helpText.enableWebhook} />
|
||||||
content={t`Enable webhook for this template.`}
|
|
||||||
/>
|
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
id="wfjt-enabled-webhooks"
|
id="wfjt-enabled-webhooks"
|
||||||
@@ -609,16 +550,13 @@ function JobTemplateForm({
|
|||||||
id="option-concurrent"
|
id="option-concurrent"
|
||||||
name="allow_simultaneous"
|
name="allow_simultaneous"
|
||||||
label={t`Concurrent Jobs`}
|
label={t`Concurrent Jobs`}
|
||||||
tooltip={t`If enabled, simultaneous runs of this job
|
tooltip={helpText.concurrentJobs}
|
||||||
template will be allowed.`}
|
|
||||||
/>
|
/>
|
||||||
<CheckboxField
|
<CheckboxField
|
||||||
id="option-fact-cache"
|
id="option-fact-cache"
|
||||||
name="use_fact_cache"
|
name="use_fact_cache"
|
||||||
label={t`Enable Fact Storage`}
|
label={t`Enable Fact Storage`}
|
||||||
tooltip={t`If enabled, this will store gathered facts so they can
|
tooltip={helpText.enableFactStorage}
|
||||||
be viewed at the host level. Facts are persisted and
|
|
||||||
injected into the fact cache at runtime.`}
|
|
||||||
/>
|
/>
|
||||||
</FormCheckboxLayout>
|
</FormCheckboxLayout>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ import {
|
|||||||
WorkflowJobTemplatesAPI,
|
WorkflowJobTemplatesAPI,
|
||||||
CredentialTypesAPI,
|
CredentialTypesAPI,
|
||||||
} from 'api';
|
} from 'api';
|
||||||
|
import wfHelpTextStrings from './WorkflowJobTemplate.helptext';
|
||||||
|
|
||||||
|
const helpText = wfHelpTextStrings();
|
||||||
|
|
||||||
function WebhookSubForm({ templateType }) {
|
function WebhookSubForm({ templateType }) {
|
||||||
const { setFieldValue } = useFormikContext();
|
const { setFieldValue } = useFormikContext();
|
||||||
@@ -125,7 +128,7 @@ function WebhookSubForm({ templateType }) {
|
|||||||
fieldId="webhook_service"
|
fieldId="webhook_service"
|
||||||
helperTextInvalid={webhookServiceMeta.error}
|
helperTextInvalid={webhookServiceMeta.error}
|
||||||
label={t`Webhook Service`}
|
label={t`Webhook Service`}
|
||||||
labelIcon={<Popover content={t`Select a webhook service.`} />}
|
labelIcon={<Popover content={helpText.webhookService} />}
|
||||||
>
|
>
|
||||||
<AnsibleSelect
|
<AnsibleSelect
|
||||||
{...webhookServiceField}
|
{...webhookServiceField}
|
||||||
@@ -157,11 +160,7 @@ function WebhookSubForm({ templateType }) {
|
|||||||
type="text"
|
type="text"
|
||||||
fieldId="jt-webhookURL"
|
fieldId="jt-webhookURL"
|
||||||
label={t`Webhook URL`}
|
label={t`Webhook URL`}
|
||||||
labelIcon={
|
labelIcon={<Popover content={helpText.webhookURL} />}
|
||||||
<Popover
|
|
||||||
content={t`Webhook services can launch jobs with this workflow job template by making a POST request to this URL.`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
name="webhook_url"
|
name="webhook_url"
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
@@ -173,11 +172,7 @@ function WebhookSubForm({ templateType }) {
|
|||||||
</FormGroup>
|
</FormGroup>
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={t`Webhook Key`}
|
label={t`Webhook Key`}
|
||||||
labelIcon={
|
labelIcon={<Popover content={helpText.webhookKey} />}
|
||||||
<Popover
|
|
||||||
content={t`Webhook services can use this as a shared secret.`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
fieldId="template-webhook_key"
|
fieldId="template-webhook_key"
|
||||||
>
|
>
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
@@ -203,7 +198,7 @@ function WebhookSubForm({ templateType }) {
|
|||||||
{credTypeId && (
|
{credTypeId && (
|
||||||
<CredentialLookup
|
<CredentialLookup
|
||||||
label={t`Webhook Credential`}
|
label={t`Webhook Credential`}
|
||||||
tooltip={t`Optionally select the credential to use to send status updates back to the webhook service.`}
|
tooltip={helpText.webhookCredential}
|
||||||
credentialTypeId={credTypeId}
|
credentialTypeId={credTypeId}
|
||||||
onChange={onCredentialChange}
|
onChange={onCredentialChange}
|
||||||
isValid={!webhookCredentialMeta.error}
|
isValid={!webhookCredentialMeta.error}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { t } from '@lingui/macro';
|
||||||
|
|
||||||
|
const wfHelpTextStrings = () => ({
|
||||||
|
inventory: t`Select an inventory for the workflow. This inventory is applied to all workflow nodes that prompt for an inventory.`,
|
||||||
|
limit: t`Provide a host pattern to further constrain
|
||||||
|
the list of hosts that will be managed or affected by the
|
||||||
|
playbook. Multiple patterns are allowed. Refer to Ansible
|
||||||
|
documentation for more information and examples on patterns.`,
|
||||||
|
sourceControlBranch: t`Select a branch for the workflow. This branch is applied to all job template nodes that prompt for a branch.`,
|
||||||
|
labels: t`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.`,
|
||||||
|
variables: t`Pass extra command line variables to the playbook. This is the -e or --extra-vars command line parameter for ansible-playbook. Provide key/value pairs using either YAML or JSON. Refer to the Ansible Tower documentation for example syntax.`,
|
||||||
|
enableWebhook: t`Enable Webhook for this workflow job template.`,
|
||||||
|
enableConcurrentJobs: t`If enabled, simultaneous runs of this workflow job template will be allowed.`,
|
||||||
|
webhookURL: t`Webhook services can launch jobs with this workflow job template by making a POST request to this URL.`,
|
||||||
|
webhookKey: t`Webhook services can use this as a shared secret.`,
|
||||||
|
webhookCredential: t`Optionally select the credential to use to send status updates back to the webhook service.`,
|
||||||
|
webhookService: t`Select a webhook service.`,
|
||||||
|
enabledOptions: (
|
||||||
|
<>
|
||||||
|
<p>{t`Concurrent jobs: If enabled, simultaneous runs of this workflow job template will be allowed.`}</p>
|
||||||
|
<p>{t`Webhooks: Enable Webhook for this workflow job template.`}</p>
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default wfHelpTextStrings;
|
||||||
@@ -28,7 +28,9 @@ import Popover from 'components/Popover';
|
|||||||
import { WorkFlowJobTemplate } from 'types';
|
import { WorkFlowJobTemplate } from 'types';
|
||||||
import LabelSelect from 'components/LabelSelect';
|
import LabelSelect from 'components/LabelSelect';
|
||||||
import WebhookSubForm from './WebhookSubForm';
|
import WebhookSubForm from './WebhookSubForm';
|
||||||
|
import wfHelpTextStrings from './WorkflowJobTemplate.helptext';
|
||||||
|
|
||||||
|
const helpText = wfHelpTextStrings();
|
||||||
const urlOrigin = window.location.origin;
|
const urlOrigin = window.location.origin;
|
||||||
|
|
||||||
function WorkflowJobTemplateForm({
|
function WorkflowJobTemplateForm({
|
||||||
@@ -137,7 +139,7 @@ function WorkflowJobTemplateForm({
|
|||||||
<InventoryLookup
|
<InventoryLookup
|
||||||
promptId="wfjt-ask-inventory-on-launch"
|
promptId="wfjt-ask-inventory-on-launch"
|
||||||
promptName="ask_inventory_on_launch"
|
promptName="ask_inventory_on_launch"
|
||||||
tooltip={t`Select an inventory for the workflow. This inventory is applied to all workflow nodes that prompt for an inventory.`}
|
tooltip={helpText.inventory}
|
||||||
fieldId="wfjt-inventory"
|
fieldId="wfjt-inventory"
|
||||||
isPromptableField
|
isPromptableField
|
||||||
value={inventoryField.value}
|
value={inventoryField.value}
|
||||||
@@ -152,10 +154,7 @@ function WorkflowJobTemplateForm({
|
|||||||
label={t`Limit`}
|
label={t`Limit`}
|
||||||
promptId="template-ask-limit-on-launch"
|
promptId="template-ask-limit-on-launch"
|
||||||
promptName="ask_limit_on_launch"
|
promptName="ask_limit_on_launch"
|
||||||
tooltip={t`Provide a host pattern to further constrain
|
tooltip={helpText.limit}
|
||||||
the list of hosts that will be managed or affected by the
|
|
||||||
playbook. Multiple patterns are allowed. Refer to Ansible
|
|
||||||
documentation for more information and examples on patterns.`}
|
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
id="wfjt-limit"
|
id="wfjt-limit"
|
||||||
@@ -174,7 +173,7 @@ function WorkflowJobTemplateForm({
|
|||||||
label={t`Source control branch`}
|
label={t`Source control branch`}
|
||||||
promptId="wfjt-ask-scm-branch-on-launch"
|
promptId="wfjt-ask-scm-branch-on-launch"
|
||||||
promptName="ask_scm_branch_on_launch"
|
promptName="ask_scm_branch_on_launch"
|
||||||
tooltip={t`Select a branch for the workflow. This branch is applied to all job template nodes that prompt for a branch.`}
|
tooltip={helpText.sourceControlBranch}
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
id="wfjt-scm-branch"
|
id="wfjt-scm-branch"
|
||||||
@@ -189,13 +188,7 @@ function WorkflowJobTemplateForm({
|
|||||||
<FormFullWidthLayout>
|
<FormFullWidthLayout>
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={t`Labels`}
|
label={t`Labels`}
|
||||||
labelIcon={
|
labelIcon={<Popover content={helpText.labels} />}
|
||||||
<Popover
|
|
||||||
content={t`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.`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
fieldId="template-labels"
|
fieldId="template-labels"
|
||||||
>
|
>
|
||||||
<LabelSelect
|
<LabelSelect
|
||||||
@@ -212,7 +205,7 @@ function WorkflowJobTemplateForm({
|
|||||||
name="extra_vars"
|
name="extra_vars"
|
||||||
label={t`Variables`}
|
label={t`Variables`}
|
||||||
promptId="template-ask-variables-on-launch"
|
promptId="template-ask-variables-on-launch"
|
||||||
tooltip={t`Pass extra command line variables to the playbook. This is the -e or --extra-vars command line parameter for ansible-playbook. Provide key/value pairs using either YAML or JSON. Refer to the Ansible Tower documentation for example syntax.`}
|
tooltip={helpText.variables}
|
||||||
/>
|
/>
|
||||||
</FormFullWidthLayout>
|
</FormFullWidthLayout>
|
||||||
<FormGroup fieldId="options" label={t`Options`}>
|
<FormGroup fieldId="options" label={t`Options`}>
|
||||||
@@ -223,9 +216,7 @@ function WorkflowJobTemplateForm({
|
|||||||
<span>
|
<span>
|
||||||
{t`Enable Webhook`}
|
{t`Enable Webhook`}
|
||||||
|
|
||||||
<Popover
|
<Popover content={helpText.enableWebhook} />
|
||||||
content={t`Enable Webhook for this workflow job template.`}
|
|
||||||
/>
|
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
id="wfjt-enabled-webhooks"
|
id="wfjt-enabled-webhooks"
|
||||||
@@ -238,7 +229,7 @@ function WorkflowJobTemplateForm({
|
|||||||
<CheckboxField
|
<CheckboxField
|
||||||
name="allow_simultaneous"
|
name="allow_simultaneous"
|
||||||
id="allow_simultaneous"
|
id="allow_simultaneous"
|
||||||
tooltip={t`If enabled, simultaneous runs of this workflow job template will be allowed.`}
|
tooltip={helpText.enableConcurrentJobs}
|
||||||
label={t`Enable Concurrent Jobs`}
|
label={t`Enable Concurrent Jobs`}
|
||||||
/>
|
/>
|
||||||
</FormCheckboxLayout>
|
</FormCheckboxLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user