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:
parent
b09e82f492
commit
388069ec11
4 changed files with 38 additions and 32 deletions
|
|
@ -2,30 +2,10 @@ import React from 'react';
|
|||
|
||||
import { Skeleton } from '@patternfly/react-core';
|
||||
|
||||
import {
|
||||
ImageTypes,
|
||||
useGetComposeClonesQuery,
|
||||
} from '../../store/imageBuilderApi';
|
||||
import { targetOptions } from '../../constants';
|
||||
import { useGetComposeClonesQuery } from '../../store/imageBuilderApi';
|
||||
import { ComposesResponseItem } from '../../store/imageBuilderApi';
|
||||
|
||||
const targetOptions: { [key in ImageTypes]: string } = {
|
||||
aws: 'Amazon Web Services',
|
||||
azure: 'Microsoft Azure',
|
||||
'edge-commit': 'Edge Commit',
|
||||
'edge-installer': 'Edge Installer',
|
||||
gcp: 'Google Cloud Platform',
|
||||
'guest-image': 'Virtualization - Guest image',
|
||||
'image-installer': 'Bare metal - Installer',
|
||||
vsphere: 'VMware vSphere',
|
||||
'vsphere-ova': 'VMware vSphere',
|
||||
wsl: 'Windows Subsystem for Linux',
|
||||
ami: 'Amazon Web Services',
|
||||
'rhel-edge-commit': 'RHEL Edge Commit',
|
||||
'rhel-edge-installer': 'RHEL Edge Installer',
|
||||
vhd: '',
|
||||
oci: 'Oracle Cloud Infrastructure',
|
||||
};
|
||||
|
||||
type TargetPropTypes = {
|
||||
compose: ComposesResponseItem;
|
||||
};
|
||||
|
|
@ -47,6 +27,6 @@ export const AwsTarget = ({ compose }: AwsTargetPropTypes) => {
|
|||
return <Skeleton />;
|
||||
}
|
||||
|
||||
const text = `Amazon Web Services (${data.data.length + 1})`;
|
||||
const text = `${targetOptions.aws} (${data.data.length + 1})`;
|
||||
return <>{text}</>;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue