diff --git a/src/Components/ImagesTable/Release.js b/src/Components/ImagesTable/Release.js deleted file mode 100644 index 72028fe6..00000000 --- a/src/Components/ImagesTable/Release.js +++ /dev/null @@ -1,22 +0,0 @@ -import PropTypes from 'prop-types'; - -import { RHEL_8, RHEL_9 } from '../../constants.js'; - -const Release = (props) => { - const releaseOptions = { - [RHEL_8]: 'RHEL 8', - [RHEL_9]: 'RHEL 9', - 'centos-8': 'CentOS Stream 8', - 'centos-9': 'CentOS Stream 9', - }; - const release = releaseOptions[props.release] - ? releaseOptions[props.release] - : props.release; - return release; -}; - -Release.propTypes = { - release: PropTypes.string, -}; - -export default Release; diff --git a/src/Components/ImagesTable/Release.tsx b/src/Components/ImagesTable/Release.tsx new file mode 100644 index 00000000..87e5fc39 --- /dev/null +++ b/src/Components/ImagesTable/Release.tsx @@ -0,0 +1,30 @@ +import { Distributions } from '../../../types'; + +type ReleaseProps = { + release: Distributions; +}; + +const Release = ({ release }: ReleaseProps) => { + const releaseDisplayValue = { + 'rhel-8': 'RHEL 8', + 'rhel-84': 'RHEL 8.4', + 'rhel-85': 'RHEL 8.5', + 'rhel-86': 'RHEL 8.6', + 'rhel-87': 'RHEL 8.7', + 'rhel-88': 'RHEL 8.8', + 'rhel-9': 'RHEL 9', + 'rhel-90': 'RHEL 9.0', + 'rhel-91': 'RHEL 9.1', + 'rhel-92': 'RHEL 9.2', + 'centos-8': 'CentOS Stream 8', + 'centos-9': 'CentOS Stream 9', + 'fedora-35': 'Fedora 35', + 'fedora-36': 'Fedora 36', + 'fedora-37': 'Fedora 37', + 'fedora-38': 'Fedora 38', + }; + + return releaseDisplayValue[release]; +}; + +export default Release; diff --git a/types/api/index.ts b/types/api/index.ts index 8048d8e7..11de02be 100644 --- a/types/api/index.ts +++ b/types/api/index.ts @@ -1,14 +1,20 @@ +import { components as contentSourcesComponents } from './contentSourcesSchema'; import { components as imageBuilderComponents } from './imageBuilderSchema'; import { components as provisioningComponents } from './provisioningSchema'; import { components as rhsmComponents } from './rhsmSchema'; -import { components as contentSourcesComponents } from './contentSourcesSchema'; -export type ActivationKeys = rhsmComponents["schemas"]["ActivationKeys"]; -export type Architectures = imageBuilderComponents["schemas"]["Architectures"]; -export type ClonesResponse = imageBuilderComponents["schemas"]["ClonesResponse"]; -export type ComposeStatus = imageBuilderComponents["schemas"]["ComposeStatus"]; -export type ComposesResponse = imageBuilderComponents["schemas"]["ComposesResponse"]; -export type UploadStatus = imageBuilderComponents["schemas"]["UploadStatus"]; -export type SourceResponse = provisioningComponents["schemas"]["v1.SourceResponse"]; -export type SourceUploadInfoResponse = provisioningComponents["schemas"]["v1.SourceUploadInfoResponse"] -export type RepositoryCollectionResponse = contentSourcesComponents["schemas"]["api.RepositoryCollectionResponse"] +export type ActivationKeys = rhsmComponents['schemas']['ActivationKeys']; +export type Architectures = imageBuilderComponents['schemas']['Architectures']; +export type ClonesResponse = + imageBuilderComponents['schemas']['ClonesResponse']; +export type ComposeStatus = imageBuilderComponents['schemas']['ComposeStatus']; +export type ComposesResponse = + imageBuilderComponents['schemas']['ComposesResponse']; +export type UploadStatus = imageBuilderComponents['schemas']['UploadStatus']; +export type SourceResponse = + provisioningComponents['schemas']['v1.SourceResponse']; +export type SourceUploadInfoResponse = + provisioningComponents['schemas']['v1.SourceUploadInfoResponse']; +export type RepositoryCollectionResponse = + contentSourcesComponents['schemas']['api.RepositoryCollectionResponse']; +export type Distributions = imageBuilderComponents['schemas']['Distributions'];