V2Wizard: Move targets to a constant

This moves mapping between target short and full names to the const to make it reusable.
This commit is contained in:
regexowl 2024-06-10 14:20:01 +02:00 committed by Klara Simickova
parent b09e82f492
commit 388069ec11
4 changed files with 38 additions and 32 deletions

View file

@ -27,6 +27,7 @@ import {
} from './ReviewStepTextLists';
import isRhel from '../../../../../src/Utilities/isRhel';
import { targetOptions } from '../../../../constants';
import { useAppSelector } from '../../../../store/hooks';
import {
selectBlueprintDescription,
@ -143,20 +144,24 @@ const Review = ({ snapshottingEnabled }: { snapshottingEnabled: boolean }) => {
{environments.includes('oci') && <TargetEnvOciList />}
{environments.includes('vsphere') && (
<TextContent>
<Text component={TextVariants.h3}>VMware vSphere (.vmdk)</Text>
<Text component={TextVariants.h3}>
{targetOptions.vsphere} (.vmdk)
</Text>
<TargetEnvOtherList />
</TextContent>
)}
{environments.includes('vsphere-ova') && (
<TextContent>
<Text component={TextVariants.h3}>VMware vSphere (.ova)</Text>
<Text component={TextVariants.h3}>
{targetOptions['vsphere-ova']} (.ova)
</Text>
<TargetEnvOtherList />
</TextContent>
)}
{environments.includes('guest-image') && (
<TextContent>
<Text component={TextVariants.h3}>
Virtualization - Guest image (.qcow2)
{targetOptions['guest-image']} (.qcow2)
</Text>
<TargetEnvOtherList />
</TextContent>
@ -164,7 +169,7 @@ const Review = ({ snapshottingEnabled }: { snapshottingEnabled: boolean }) => {
{environments.includes('image-installer') && (
<TextContent>
<Text component={TextVariants.h3}>
Bare metal - Installer (.iso)
{targetOptions['image-installer']} (.iso)
</Text>
<TargetEnvOtherList />
</TextContent>
@ -172,7 +177,7 @@ const Review = ({ snapshottingEnabled }: { snapshottingEnabled: boolean }) => {
{environments.includes('wsl') && (
<TextContent>
<Text component={TextVariants.h3}>
WSL - Windows Subsystem for Linux (.tar.gz)
WSL - {targetOptions.wsl} (.tar.gz)
</Text>
<TargetEnvOtherList />
</TextContent>

View file

@ -29,6 +29,7 @@ import {
RHEL_8_FULL_SUPPORT,
RHEL_8_MAINTENANCE_SUPPORT,
RHEL_9,
targetOptions,
UNIT_GIB,
} from '../../../../constants';
import { useListSnapshotsByDateMutation } from '../../../../store/contentSourcesApi';
@ -221,7 +222,7 @@ export const TargetEnvAWSList = () => {
return (
<TextContent>
<Text component={TextVariants.h3}>AWS</Text>
<Text component={TextVariants.h3}>{targetOptions.aws}</Text>
<TextList component={TextListVariants.dl}>
<TextListItem
component={TextListItemVariants.dt}
@ -263,7 +264,7 @@ export const TargetEnvGCPList = () => {
const email = useAppSelector(selectGcpEmail);
return (
<TextContent>
<Text component={TextVariants.h3}>GCP</Text>
<Text component={TextVariants.h3}>{targetOptions.gcp}</Text>
<TextList component={TextListVariants.dl}>
<TextListItem
component={TextListItemVariants.dt}
@ -326,7 +327,7 @@ export const TargetEnvAzureList = () => {
return (
<TextContent>
<Text component={TextVariants.h3}>Microsoft Azure</Text>
<Text component={TextVariants.h3}>{targetOptions.azure}</Text>
<TextList component={TextListVariants.dl}>
<TextListItem
component={TextListItemVariants.dt}
@ -383,7 +384,7 @@ export const TargetEnvAzureList = () => {
export const TargetEnvOciList = () => {
return (
<TextContent>
<Text component={TextVariants.h3}>Oracle Cloud Infrastructure</Text>
<Text component={TextVariants.h3}>{targetOptions.oci}</Text>
<TextList component={TextListVariants.dl}>
<TextListItem
component={TextListItemVariants.dt}