Adds resource name and description to launch and schedule prompt wizards

This commit is contained in:
mabashian 2021-05-25 11:48:09 -04:00
parent 4e129d3d04
commit dc64da6f72
3 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,5 @@
import React from 'react';
import { Wizard } from '@patternfly/react-core';
import { t } from '@lingui/macro';
import { Formik, useFormikContext } from 'formik';
import ContentError from '../ContentError';
@ -102,7 +101,8 @@ function PromptModalForm({
validateStep(nextStep.id);
}
}}
title={t`Prompts`}
title={t`Launch | ${resource.name}`}
description={resource.description}
steps={
isReady
? steps

View File

@ -24,6 +24,8 @@ jest.mock('../../api/models/JobTemplates');
let config;
const resource = {
id: 1,
description: 'Foo Description',
name: 'Foobar',
type: 'job_template',
};
const noop = () => {};
@ -147,6 +149,10 @@ describe('LaunchPrompt', () => {
expect(steps[3].name.props.children).toEqual('Other prompts');
expect(steps[4].name.props.children).toEqual('Survey');
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 () => {

View File

@ -1,6 +1,5 @@
import React from 'react';
import { Wizard } from '@patternfly/react-core';
import { t } from '@lingui/macro';
import { useFormikContext } from 'formik';
import AlertModal from '../../AlertModal';
@ -37,7 +36,6 @@ function SchedulePromptableFields({
launchConfig,
schedule,
resource,
credentials,
resourceDefaultCredentials
);
@ -107,7 +105,8 @@ function SchedulePromptableFields({
validateStep(nextStep.id);
}
}}
title={t`Prompts`}
title={t`Prompt | ${resource.name}`}
description={resource.description}
steps={
isReady
? steps