import React from 'react'; import { useFormApi } from '@data-driven-forms/react-form-renderer'; import { Alert, Button, Popover, Spinner, Text, TextContent, TextList, TextListItem, TextListVariants, TextListItemVariants, TextVariants, } from '@patternfly/react-core'; import { ExclamationTriangleIcon, HelpIcon } from '@patternfly/react-icons'; import PropTypes from 'prop-types'; import ActivationKeyInformation from './ActivationKeyInformation'; import { AwsAccountId } from './AwsAccountId'; import ReleaseLifecycle from './ReleaseLifecycle'; import { FSReviewTable, PackagesTable, RepositoriesTable, } from './ReviewStepTables'; import { RELEASES, UNIT_GIB } from '../../../constants'; import { extractProvisioningList } from '../../../store/helpers'; import { useGetSourceListQuery } from '../../../store/provisioningApi'; import { useShowActivationKeyQuery } from '../../../store/rhsmApi'; import { useGetEnvironment } from '../../../Utilities/useGetEnvironment'; import { googleAccType } from '../steps/googleCloud'; const ExpirationWarning = () => { return (
Expires 14 days after creation
); }; export const ImageOutputList = () => { const { getState } = useFormApi(); return ( Release {RELEASES.get(getState()?.values?.release)} Architecture {getState()?.values?.arch}
); }; export const TargetEnvAWSList = () => { const { data: rawAWSSources, isSuccess } = useGetSourceListQuery({ provider: 'aws', }); const awsSources = extractProvisioningList(rawAWSSources); const { isBeta } = useGetEnvironment(); const { getState } = useFormApi(); return ( AWS Image type Red Hat hosted image
Shared to account {!isBeta() && getState()?.values?.['aws-account-id']} {isBeta() && getState()?.values?.['aws-target-type'] === 'aws-target-type-source' && isSuccess && ( )} {isBeta() && getState()?.values?.['aws-target-type'] === 'aws-target-type-account-id' && getState()?.values?.['aws-account-id']} {getState()?.values?.['aws-target-type'] === 'aws-target-type-source' ? 'Source' : null} {isSuccess && getState()?.values?.['aws-target-type'] === 'aws-target-type-source' ? awsSources.find( (source) => source.id === getState()?.values?.['aws-sources-select'] )?.name : null} Default region us-east-1

); }; export const TargetEnvGCPList = () => { const { getState } = useFormApi(); return ( GCP Image type Red Hat hosted image
Account type {googleAccType?.[getState()?.values?.['google-account-type']]} {googleAccType?.[getState()?.values?.['google-account-type']] === 'Domain' ? 'Domain' : 'Principal'} {getState()?.values?.['google-email'] || getState()?.values?.['google-domain']}

); }; export const TargetEnvAzureList = () => { const { getState } = useFormApi(); const { data: rawAzureSources, isSuccess: isSuccessAzureSources } = useGetSourceListQuery({ provider: 'azure' }); const azureSources = extractProvisioningList(rawAzureSources); return ( Microsoft Azure Image type Red Hat hosted image
{getState()?.values?.['azure-type'] === 'azure-type-source' && isSuccessAzureSources && ( <> Azure Source { azureSources.find( (source) => source.id === getState()?.values?.['azure-sources-select'] )?.name } )} {getState()?.values?.['azure-type'] === 'azure-type-manual' && ( <> Azure Tenant ID {getState()?.values?.['azure-tenant-id']} Subscription ID {getState()?.values?.['azure-subscription-id']} )} Resource group {getState()?.values?.['azure-resource-group']}

); }; export const TargetEnvOciList = () => { return ( Oracle Cloud Infrastructure Object Storage URL The URL for the built image will be ready to copy

); }; export const TargetEnvOtherList = () => { return ( <> Image type Built image will be available for download
); }; export const FSCList = () => { const { getState } = useFormApi(); const isManual = getState()?.values?.['file-system-config-radio'] === 'manual'; const partitions = getState()?.values?.['file-system-configuration']; return ( Configuration type {isManual ? 'Manual' : 'Automatic'} {isManual && ( <> {' '} } > )} {isManual && ( <> Image size (minimum) Image Builder may extend this size based on requirements, selected packages, and configurations. } > )}
); }; export const MinSize = ({ isManual, partitions }) => { let minSize = ''; if (isManual && partitions) { let size = 0; for (const partition of partitions) { size += partition.size * partition.unit; } size = (size / UNIT_GIB).toFixed(1); if (size < 1) { minSize = `Less than 1 GiB`; } else { minSize = `${size} GiB`; } } return ( {minSize} ); }; MinSize.propTypes = { isManual: PropTypes.bool, partitions: PropTypes.arrayOf(PropTypes.object), }; export const ContentList = () => { const { getState } = useFormApi(); return ( Additional Red Hat
and 3rd party packages
{getState()?.values?.['selected-packages']?.length > 0 ? ( } > ) : ( 0 )} Custom repositories {getState()?.values?.['payload-repositories']?.length > 0 ? ( } > ) : ( 0 )}

); }; export const RegisterLaterList = () => { return ( Registration type Register the system later
); }; export const RegisterNowList = () => { const { getState } = useFormApi(); const activationKey = getState()?.values?.['subscription-activation-key']; const { isError } = useShowActivationKeyQuery( { name: activationKey }, { skip: !activationKey, } ); return ( <> Registration type {getState()?.values?.['register-system']?.startsWith( 'register-now' ) && ( Register with Red Hat Subscription Manager (RHSM)
)} {(getState()?.values?.['register-system'] === 'register-now-insights' || getState()?.values?.['register-system'] === 'register-now-rhc') && ( Connect to Red Hat Insights
)} {getState()?.values?.['register-system'] === 'register-now-rhc' && ( Use remote host configuration (rhc) utility
)}
Activation key Activation keys enable you to register a system with appropriate subscriptions, system purpose, and repositories attached.

If using an activation key with command line registration, you must provide your organization's ID. Your organization's ID is{' '} {getState()?.values?.['subscription-organization-id'] !== undefined ? ( getState()?.values?.['subscription-organization-id'] ) : ( )}
} >
{isError && ( Information about the activation key cannot be loaded. Please check the key was not removed and try again later. )} ); }; export const ImageDetailsList = () => { const { getState } = useFormApi(); const imageName = getState()?.values?.['image-name']; const imageDescription = getState()?.values?.['image-description']; return ( {imageName && ( <> Image name {imageName} )} {imageDescription && ( <> Description {imageDescription} )}
); };