Skip to content

Commit

Permalink
Show all OCP versions in dropdown (maintenance, production, beta, end…
Browse files Browse the repository at this point in the history
…-of-life) (#2552)
  • Loading branch information
ammont82 authored Apr 11, 2024
1 parent e92d35f commit c78b9e3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ const getOpenshiftVersionHelperText =
return null;
}

if (selectedVersion.supportLevel !== 'production') {
if (
selectedVersion.supportLevel !== 'production' &&
selectedVersion.supportLevel !== 'maintenance'
) {
return (
<>
<UiIcon size="sm" status="warning" icon={<ExclamationTriangleIcon />} />
Expand All @@ -55,12 +58,10 @@ type OpenShiftVersionSelectProps = {
const OpenShiftVersionSelect: React.FC<OpenShiftVersionSelectProps> = ({ versions, onChange }) => {
const selectOptions = React.useMemo(
() =>
versions
.filter((version) => version.supportLevel !== 'maintenance')
.map((version) => ({
label: version.label,
value: version.value,
})),
versions.map((version) => ({
label: version.label,
value: version.value,
})),
[versions],
);
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ const getOpenshiftVersionHelperText = (
return null;
}

if (selectedVersion.supportLevel !== 'production') {
if (
selectedVersion.supportLevel !== 'production' &&
selectedVersion.supportLevel !== 'maintenance'
) {
let messageSelectedVersion = t('ai:Please note that this version is not production-ready.');
if (selectedVersion.supportLevel === 'end-of-life') {
messageSelectedVersion = t('ai:Please note that this version is not maintained anymore.');
Expand Down Expand Up @@ -72,17 +75,15 @@ const OcmOpenShiftVersionSelect = ({ versions }: OcmOpenShiftVersionSelectProps)
} = useFormikContext<ClusterDetailsValues>();
const selectOptions = React.useMemo(
() =>
versions
.filter((version) => version.supportLevel !== 'maintenance')
.map((version) => ({
label:
version.supportLevel === 'beta'
? version.label + ' - ' + t('ai:Developer preview release')
: version.label,
// This is the "key" from openshift-versions API response
// It can either be in the long or short (for default versions) form
value: version.value,
})),
versions.map((version) => ({
label:
version.supportLevel === 'beta'
? version.label + ' - ' + t('ai:Developer preview release')
: version.label,
// This is the "key" from openshift-versions API response
// It can either be in the long or short (for default versions) form
value: version.value,
})),
[versions, t],
);
const [isOpenshiftVersionModalOpen, setIsOpenshiftVersionModalOpen] = React.useState(false);
Expand Down

0 comments on commit c78b9e3

Please sign in to comment.