Skip to content

Commit

Permalink
Reset radio button when Provider mode is selected from dropdown
Browse files Browse the repository at this point in the history
Signed-off-by: Bipul Adhikari <[email protected]>
  • Loading branch information
bipuladh committed Oct 7, 2024
1 parent abb8239 commit c27a9c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
},
});
}
}, [dispatch, allowedExternalStorage.length, hasOCS]);
}, [dispatch, allowedExternalStorage.length, hasOCS, isProviderModePresent]);

React.useEffect(() => {
/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { FDF_FLAG } from '@odf/core/redux';
import { DeploymentType } from '@odf/core/types';
import { BackingStorageType, DeploymentType } from '@odf/core/types';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { useFlag } from '@openshift-console/dynamic-plugin-sdk';
import {
Expand Down Expand Up @@ -49,6 +49,12 @@ export const SelectDeployment: React.FC<SelectDeploymentProps> = ({
// '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);
};

Expand Down

0 comments on commit c27a9c5

Please sign in to comment.