Skip to content

Commit

Permalink
kubevirt: add source and remove type from disks table
Browse files Browse the repository at this point in the history
  • Loading branch information
suomiy committed Nov 26, 2019
1 parent 41bb8cb commit 59627d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
Expand Up @@ -62,12 +62,14 @@ const getStoragesData = (
pvcsLoading: !isLoaded(pvcs),
});

const source = combinedDisk.getSource();

return {
wizardStorageData,
// for sorting
name: combinedDisk.getName(),
source: source && source.getValue(),
diskInterface: combinedDisk.getDiskInterface(),
type: combinedDisk.getTypeValue(),
size: combinedDisk.getReadableSize(),
storageClass: combinedDisk.getStorageClassName(),
};
Expand Down
Expand Up @@ -106,7 +106,7 @@ export type VMDiskSimpleRowProps = {
};

export const DiskSimpleRow: React.FC<VMDiskSimpleRowProps> = ({
data: { name, type, size, diskInterface, storageClass },
data: { name, source, size, diskInterface, storageClass },
validation = {},
columnClasses,
actionsComponent,
Expand All @@ -122,6 +122,9 @@ export const DiskSimpleRow: React.FC<VMDiskSimpleRowProps> = ({
<TableData className={dimensify()}>
<ValidationCell validation={validation.name}>{name}</ValidationCell>
</TableData>
<TableData className={dimensify()}>
<ValidationCell validation={validation.source}>{source || DASH}</ValidationCell>
</TableData>
<TableData className={dimensify()}>
{isSizeLoading && <LoadingInline />}
{!isSizeLoading && (
Expand All @@ -131,9 +134,6 @@ export const DiskSimpleRow: React.FC<VMDiskSimpleRowProps> = ({
<TableData className={dimensify()}>
<ValidationCell validation={validation.diskInterface}>{diskInterface}</ValidationCell>
</TableData>
<TableData className={dimensify()}>
<ValidationCell validation={validation.type}>{type || DASH}</ValidationCell>
</TableData>
<TableData className={dimensify()}>
{isStorageClassLoading && <LoadingInline />}
{!isStorageClassLoading && (
Expand Down
Expand Up @@ -4,15 +4,15 @@ import { CombinedDisk } from '../../k8s/wrapper/vm/combined-disk';

export type StorageSimpleData = {
name?: string;
type?: string;
source?: string;
diskInterface?: string;
size?: string;
storageClass?: string;
};

export type StorageSimpleDataValidation = {
name?: ValidationObject;
type?: ValidationObject;
source?: ValidationObject;
diskInterface?: ValidationObject;
size?: ValidationObject;
storageClass?: ValidationObject;
Expand Down
Expand Up @@ -35,11 +35,12 @@ const getStoragesData = ({
);

return combinedDiskFactory.getCombinedDisks().map((disk) => {
const source = disk.getSource();
return {
disk,
// for sorting
name: disk.getName(),
type: disk.getTypeValue(),
source: source && source.getValue(),
diskInterface: disk.getDiskInterface(),
size: disk.getReadableSize(),
storageClass: disk.getStorageClassName(),
Expand Down Expand Up @@ -72,6 +73,11 @@ export const VMDisksTable: React.FC<VMDisksTableProps> = ({
sortField: 'name',
transforms: [sortable],
},
{
title: 'Source',
sortField: 'source',
transforms: [sortable],
},
{
title: 'Size',
sortField: 'size',
Expand All @@ -82,11 +88,6 @@ export const VMDisksTable: React.FC<VMDisksTableProps> = ({
sortField: 'diskInterface',
transforms: [sortable],
},
{
title: 'Type',
sortField: 'type',
transforms: [sortable],
},
{
title: 'Storage Class',
sortField: 'storageClass',
Expand Down

0 comments on commit 59627d5

Please sign in to comment.