mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Merge pull request #10195 from nixocio/ui_issue_9377
Fix null issue for limit Fix null issue for limit. See: #9377 Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
This commit is contained in:
commit
b771929b6e
@ -19,7 +19,6 @@ const StyledCheckboxField = styled(CheckboxField)`
|
||||
function FieldWithPrompt({
|
||||
children,
|
||||
fieldId,
|
||||
|
||||
isRequired,
|
||||
label,
|
||||
promptId,
|
||||
|
||||
@ -118,7 +118,7 @@ function getInitialValues(launchConfig, resource) {
|
||||
initialValues.job_type = resource?.job_type || '';
|
||||
}
|
||||
if (launchConfig.ask_limit_on_launch) {
|
||||
initialValues.limit = resource?.limit || '';
|
||||
initialValues.limit = resource?.limit || null;
|
||||
}
|
||||
if (launchConfig.ask_verbosity_on_launch) {
|
||||
initialValues.verbosity = resource?.verbosity || 0;
|
||||
|
||||
@ -126,7 +126,7 @@ describe('<WorkflowJobTemplateAdd/>', () => {
|
||||
description: '',
|
||||
extra_vars: '---',
|
||||
inventory: undefined,
|
||||
limit: '',
|
||||
limit: null,
|
||||
organization: undefined,
|
||||
scm_branch: '',
|
||||
webhook_credential: undefined,
|
||||
|
||||
@ -45,6 +45,7 @@ function WorkflowJobTemplateDetail({ template }) {
|
||||
webhook_credential,
|
||||
webhook_key,
|
||||
scm_branch: scmBranch,
|
||||
limit,
|
||||
} = template;
|
||||
|
||||
const urlOrigin = window.location.origin;
|
||||
@ -160,6 +161,7 @@ function WorkflowJobTemplateDetail({ template }) {
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
<Detail dataCy="limit" label={t`Limit`} value={limit} />
|
||||
<Detail
|
||||
label={t`Webhook Service`}
|
||||
value={toTitleCase(template.webhook_service)}
|
||||
|
||||
@ -51,6 +51,7 @@ describe('<WorkflowJobTemplateDetail/>', () => {
|
||||
webhook_key: 'Foo webhook key',
|
||||
execution_environment: 4,
|
||||
scm_branch: 'main',
|
||||
limit: 'servers',
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
@ -115,6 +116,11 @@ describe('<WorkflowJobTemplateDetail/>', () => {
|
||||
prop: 'value',
|
||||
value: 'main',
|
||||
},
|
||||
{
|
||||
element: 'Detail[label="Limit"]',
|
||||
prop: 'value',
|
||||
value: 'servers',
|
||||
},
|
||||
{
|
||||
element: "Detail[label='Webhook Service']",
|
||||
prop: 'value',
|
||||
|
||||
@ -40,7 +40,6 @@ function WorkflowJobTemplateForm({
|
||||
template,
|
||||
handleSubmit,
|
||||
handleCancel,
|
||||
|
||||
submitError,
|
||||
isOrgAdmin,
|
||||
}) {
|
||||
@ -167,7 +166,7 @@ function WorkflowJobTemplateForm({
|
||||
>
|
||||
<TextInput
|
||||
id="wfjt-limit"
|
||||
{...limitField}
|
||||
value={limitField.value}
|
||||
validated={
|
||||
!limitMeta.touched || !limitMeta.error ? 'default' : 'error'
|
||||
}
|
||||
@ -306,7 +305,7 @@ const FormikApp = withFormik({
|
||||
organization: template?.summary_fields?.organization || null,
|
||||
labels: template.summary_fields?.labels?.results || [],
|
||||
extra_vars: template.extra_vars || '---',
|
||||
limit: template.limit || '',
|
||||
limit: template.limit || null,
|
||||
scm_branch: template.scm_branch || '',
|
||||
allow_simultaneous: template.allow_simultaneous || false,
|
||||
webhook_credential: template?.summary_fields?.webhook_credential || null,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user