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 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

View File

@@ -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 () => {

View File

@@ -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