diff --git a/src/Components/SmartComponents/SystemCves/SystemCveTable.js b/src/Components/SmartComponents/SystemCves/SystemCveTable.js index e1c6f7f60..eefd518c7 100644 --- a/src/Components/SmartComponents/SystemCves/SystemCveTable.js +++ b/src/Components/SmartComponents/SystemCves/SystemCveTable.js @@ -52,6 +52,8 @@ const SystemCvesTableWithContext = ({ context, header, entity, canSelect }) => { return ({ ...cve, isOpen: current && current.isOpen }); }) : []; + const sortingHeader = [{ key: 'collapse' }, ...canSelect ? [{ key: 'checkbox' }] : [], ...header]; + return ( !cves.isLoading ? ( @@ -66,14 +68,14 @@ const SystemCvesTableWithContext = ({ context, header, entity, canSelect }) => { actionResolver={(!isEmpty && canEditPairStatus) && ((rowData, rowIndex) => systemCveTableRowActions(methods, entity, rowIndex.rowIndex))} sortBy={!isEmpty - ? createSortBy([{ key: 'collapse' }, { key: 'checkbox' }, ...header], cves.meta.sort) : undefined} + ? createSortBy(sortingHeader, cves.meta.sort) : undefined} onCollapse={!isEmpty ? (event, rowKey, isOpen) => handleOnCollapse(event, rowKey, isOpen) : undefined} onSort={!isEmpty ? (event, key, direction) => handleSortColumn( key, direction, - [{ key: 'collapse' }, { key: 'checkbox' }, ...header], + sortingHeader, cves.meta.sort, methods.apply ) : undefined