From faff3120943aaa197528a2f6e589bdb46074f4f1 Mon Sep 17 00:00:00 2001 From: Bipul Adhikari Date: Thu, 19 Dec 2024 21:02:51 +0545 Subject: [PATCH] Revert "[release-4.16-compatibility] DFBUGS-713: Block creation of external mode when Provider mode is already present" --- .../backing-storage-step/backing-storage-step.tsx | 13 +++---------- .../backing-storage-step/select-deployment.tsx | 8 +------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/packages/odf/components/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage-step.tsx b/packages/odf/components/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage-step.tsx index 119c8ac4e..2a4711924 100644 --- a/packages/odf/components/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage-step.tsx +++ b/packages/odf/components/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage-step.tsx @@ -3,7 +3,6 @@ import { STORAGE_CLUSTER_SYSTEM_KIND, NO_PROVISIONER, } from '@odf/core/constants'; -import { PROVIDER_MODE } from '@odf/core/features'; import { useSafeK8sGet } from '@odf/core/hooks'; import { useODFNamespaceSelector } from '@odf/core/redux'; import { scResource } from '@odf/core/resources'; @@ -26,7 +25,6 @@ import { } from '@odf/shared/types'; import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook'; import { isDefaultClass, getODFCsv, getGVKLabel } from '@odf/shared/utils'; -import { useFlag } from '@openshift-console/dynamic-plugin-sdk'; import * as _ from 'lodash-es'; import { Form, @@ -215,7 +213,6 @@ export const BackingStorage: React.FC = ({ const isFullDeployment = deployment === DeploymentType.FULL; const isProviderMode = deployment === DeploymentType.PROVIDER_MODE; - const isProviderModePresent = useFlag(PROVIDER_MODE) && hasInternal; const isNonRHCSExternalType = type === BackingStorageType.EXTERNAL && externalStorage !== OCSStorageClusterModel.kind; @@ -272,7 +269,7 @@ export const BackingStorage: React.FC = ({ * Allow pre selecting the "external connection" option instead of the "existing" option * if an OCS Storage System is already created. */ - if (hasOCS && allowedExternalStorage.length && !isProviderModePresent) { + if (hasOCS && allowedExternalStorage.length) { dispatch({ type: 'backingStorage/setType', payload: BackingStorageType.EXTERNAL, @@ -285,7 +282,7 @@ export const BackingStorage: React.FC = ({ }, }); } - }, [dispatch, allowedExternalStorage.length, hasOCS, isProviderModePresent]); + }, [dispatch, allowedExternalStorage.length, hasOCS]); React.useEffect(() => { /* @@ -387,11 +384,7 @@ export const BackingStorage: React.FC = ({ value={BackingStorageType.EXTERNAL} isChecked={type === BackingStorageType.EXTERNAL} onChange={(event, _unused) => onRadioSelect(_unused, event)} - isDisabled={ - allowedExternalStorage.length === 0 || - isProviderMode || - isProviderModePresent - } + isDisabled={allowedExternalStorage.length === 0 || isProviderMode} body={ showExternalStorageSelection && ( = ({ // 'value' on SelectProps['onSelect'] is string hence does not match with payload of type "DeploymentType" payload: value as DeploymentType, }); - if (value === DeploymentType.PROVIDER_MODE) { - dispatch({ - type: 'backingStorage/setType', - payload: BackingStorageType.EXISTING, - }); - } setIsSelectOpen(false); };