mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 09:27:31 -02:30
Adds resource name and description to launch and schedule prompt wizards
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Wizard } from '@patternfly/react-core';
|
import { Wizard } from '@patternfly/react-core';
|
||||||
|
|
||||||
import { t } from '@lingui/macro';
|
import { t } from '@lingui/macro';
|
||||||
import { Formik, useFormikContext } from 'formik';
|
import { Formik, useFormikContext } from 'formik';
|
||||||
import ContentError from '../ContentError';
|
import ContentError from '../ContentError';
|
||||||
@@ -102,7 +101,8 @@ function PromptModalForm({
|
|||||||
validateStep(nextStep.id);
|
validateStep(nextStep.id);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
title={t`Prompts`}
|
title={t`Launch | ${resource.name}`}
|
||||||
|
description={resource.description}
|
||||||
steps={
|
steps={
|
||||||
isReady
|
isReady
|
||||||
? steps
|
? steps
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ jest.mock('../../api/models/JobTemplates');
|
|||||||
let config;
|
let config;
|
||||||
const resource = {
|
const resource = {
|
||||||
id: 1,
|
id: 1,
|
||||||
|
description: 'Foo Description',
|
||||||
|
name: 'Foobar',
|
||||||
type: 'job_template',
|
type: 'job_template',
|
||||||
};
|
};
|
||||||
const noop = () => {};
|
const noop = () => {};
|
||||||
@@ -147,6 +149,10 @@ describe('LaunchPrompt', () => {
|
|||||||
expect(steps[3].name.props.children).toEqual('Other prompts');
|
expect(steps[3].name.props.children).toEqual('Other prompts');
|
||||||
expect(steps[4].name.props.children).toEqual('Survey');
|
expect(steps[4].name.props.children).toEqual('Survey');
|
||||||
expect(steps[5].name.props.children).toEqual('Preview');
|
expect(steps[5].name.props.children).toEqual('Preview');
|
||||||
|
expect(wizard.find('WizardHeader').prop('title')).toBe('Launch | Foobar');
|
||||||
|
expect(wizard.find('WizardHeader').prop('description')).toBe(
|
||||||
|
'Foo Description'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should add inventory step', async () => {
|
test('should add inventory step', async () => {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Wizard } from '@patternfly/react-core';
|
import { Wizard } from '@patternfly/react-core';
|
||||||
|
|
||||||
import { t } from '@lingui/macro';
|
import { t } from '@lingui/macro';
|
||||||
import { useFormikContext } from 'formik';
|
import { useFormikContext } from 'formik';
|
||||||
import AlertModal from '../../AlertModal';
|
import AlertModal from '../../AlertModal';
|
||||||
@@ -37,7 +36,6 @@ function SchedulePromptableFields({
|
|||||||
launchConfig,
|
launchConfig,
|
||||||
schedule,
|
schedule,
|
||||||
resource,
|
resource,
|
||||||
|
|
||||||
credentials,
|
credentials,
|
||||||
resourceDefaultCredentials
|
resourceDefaultCredentials
|
||||||
);
|
);
|
||||||
@@ -107,7 +105,8 @@ function SchedulePromptableFields({
|
|||||||
validateStep(nextStep.id);
|
validateStep(nextStep.id);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
title={t`Prompts`}
|
title={t`Prompt | ${resource.name}`}
|
||||||
|
description={resource.description}
|
||||||
steps={
|
steps={
|
||||||
isReady
|
isReady
|
||||||
? steps
|
? steps
|
||||||
|
|||||||
Reference in New Issue
Block a user