Skip to content

Commit

Permalink
Remove sorting from the system update method col
Browse files Browse the repository at this point in the history
  • Loading branch information
gkarat committed Mar 13, 2023
1 parent 050968c commit 45dd464
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/components/GroupSystems/GroupSystems.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import { fitContent } from '@patternfly/react-table';
import { fitContent, TableVariant } from '@patternfly/react-table';
import PropTypes from 'prop-types';
import React from 'react';
import InventoryTable from '../InventoryTable/InventoryTable';

const prepareColumns = (initialColumns) => {
// hides the "groups" and additionally inserts the "update methods" columns
// hides the "groups" column
const columns = initialColumns.filter(({ key }) => key !== 'groups');

// additionally insert the "update methods" column
columns.splice(columns.length - 1 /* must be penultimate */, 0, {
key: 'update_method',
title: 'Update methods',
sortKey: 'update_method',
transforms: [fitContent],
renderFunc: (value, hostId, systemData) =>
systemData?.system_profile?.system_update_method || 'N/A'
systemData?.system_profile?.system_update_method || 'N/A',
props: {
// TODO: remove isStatic when the sorting is supported by API
isStatic: true,
width: 10
}
});

return columns;
Expand All @@ -30,6 +36,10 @@ const GroupSystems = ({ groupName }) => {
showTags
)
}
tableProps={{
isStickyHeader: true,
variant: TableVariant.compact
}}
/>;
};

Expand Down

0 comments on commit 45dd464

Please sign in to comment.