Skip to content

Commit

Permalink
RHIROS-1302 enable group sorting (#294)
Browse files Browse the repository at this point in the history
* RHIROS-1302 enable group sorting

* code refactor - moved groups object to constant file
  • Loading branch information
PreetiW authored Dec 8, 2023
1 parent 2cec84d commit fd14d68
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
16 changes: 1 addition & 15 deletions src/Routes/RosPage/RosPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
import { DownloadExecutivePDFReport } from '../../Components/Reports/ExecutivePDFReport';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
import { conditionalFilterType } from '@redhat-cloud-services/frontend-components';
import { displayGroup } from '../../Components/RosTable/RenderColumn';
import { useLocation } from 'react-router-dom';

/**
Expand Down Expand Up @@ -64,7 +63,7 @@ class RosPage extends React.Component {

this.sortingHeader = {
display_name: 'display_name', /* eslint-disable-line camelcase */
group_name: 'group_name', /* eslint-disable-line camelcase */
groups: 'group_name', /* eslint-disable-line camelcase */
os: 'os',
'performance_utilization.cpu': 'cpu',
'performance_utilization.memory': 'memory',
Expand All @@ -85,19 +84,6 @@ class RosPage extends React.Component {
await this.props.isROSConfigured();
this.processQueryParams();
this.processFilterValues();

SYSTEM_TABLE_COLUMNS.splice(1, 0, {
key: 'groups',
title: 'Group',
modalTitle: 'Group',
dataLabel: 'Group',
renderFunc: (data) => displayGroup(data),
isChecked: true,
isDisabled: false,
isShownByDefault: true,
props: { isStatic: true }
});

}

processQueryParams() {
Expand Down
1 change: 1 addition & 0 deletions src/Utilities/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const fetchSystems = async (fetchParams) => {

const sortingHeader = {
display_name: 'display_name', /* eslint-disable-line camelcase */
groups: 'group_name', /* eslint-disable-line camelcase */
os: 'os',
'performance_utilization.cpu': 'cpu',
'performance_utilization.memory': 'memory',
Expand Down
11 changes: 11 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from './store/entitiesReducer';
import {
diskUsageData,
displayGroup,
displayLastReported,
displayOS
} from './Components/RosTable/RenderColumn';
Expand Down Expand Up @@ -96,6 +97,16 @@ export const SYSTEM_TABLE_COLUMNS = [
isDisabled: true,
isShownByDefault: true
},
{
key: 'groups',
title: 'Group',
modalTitle: 'Group',
dataLabel: 'Group',
renderFunc: (data) => displayGroup(data),
isChecked: true,
isDisabled: false,
isShownByDefault: true
},
{
key: 'os',
title: (
Expand Down

0 comments on commit fd14d68

Please sign in to comment.