Skip to content

Commit

Permalink
updation of donut chart on device type change
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayashree-panda committed Jan 26, 2021
1 parent 1cec25f commit 0dbb0d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Expand Up @@ -16,7 +16,7 @@ export const initialState: State = {
showNodesListOnLVS: false,
diskType: 'All',
diskMode: diskModeDropdownItems.BLOCK,
deviceType: [],
deviceType: ['Disk', 'Part'],
maxDiskLimit: '',
nodeNames: [], // nodes selected on the LVS step
minDiskSize: '1',
Expand Down
Expand Up @@ -12,7 +12,10 @@ import { DiskListModal } from './disk-list';
import { State, Action, Discoveries } from '../state';
import { getTotalDeviceCapacity } from '../../../../../utils/install';
import AttachedDevicesNodeTable from '../../sc-node-list';
import { DISK_TYPES } from '@console/local-storage-operator-plugin/src/constants';
import {
DISK_TYPES,
deviceTypeDropdownItems,
} from '@console/local-storage-operator-plugin/src/constants';
import '../../attached-devices.scss';

export const DiscoveryDonutChart: React.FC<DiscoveryDonutChartProps> = ({ state, dispatch }) => {
Expand Down Expand Up @@ -48,7 +51,10 @@ export const DiscoveryDonutChart: React.FC<DiscoveryDonutChartProps> = ({ state,
hasDiskType = DISK_TYPES[state.diskType].property === disk.property;
}

if (isValidSize && hasDiskType) {
const hasDeviceType: boolean = state.deviceType.includes(
deviceTypeDropdownItems[disk.type.toUpperCase()],
);
if (isValidSize && hasDiskType && hasDeviceType) {
return true;
}
}
Expand All @@ -67,6 +73,7 @@ export const DiscoveryDonutChart: React.FC<DiscoveryDonutChartProps> = ({ state,
nodes,
state.nodesDiscoveries,
state.diskType,
state.deviceType,
dispatch,
]);

Expand Down

0 comments on commit 0dbb0d6

Please sign in to comment.