Skip to content

Commit

Permalink
Merge pull request #4544 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…4521-to-release-4.4

[release-4.4] Bug 1807293: Fix sort criteria for capacity on console
  • Loading branch information
openshift-merge-robot committed Feb 28, 2020
2 parents a90192c + 469c780 commit 85786a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion frontend/public/components/factory/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getNodeRoles, getMachinePhase } from '@console/shared';
import * as UIActions from '../../actions/ui';
import { ingressValidHosts } from '../ingress';
import { alertStateOrder, silenceStateOrder } from '../../reducers/monitoring';
import { EmptyBox, StatusBox, WithScrollContainer } from '../utils';
import { convertToBaseValue, EmptyBox, StatusBox, WithScrollContainer } from '../utils';
import {
getClusterOperatorStatus,
getClusterOperatorVersion,
Expand Down Expand Up @@ -111,6 +111,8 @@ const sorts = {
podPhase,
podReadiness: (pod: PodKind): number => podReadiness(pod).readyCount,
podRestarts,
pvStorage: (pv) => _.toInteger(convertToBaseValue(pv?.spec?.capacity?.storage)),
pvcStorage: (pvc) => _.toInteger(convertToBaseValue(pvc?.status?.capacity?.storage)),
serviceClassDisplayName,
silenceStateOrder,
string: (val) => JSON.stringify(val),
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/components/persistent-volume-claim.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const PVCTableHeader = () => {
},
{
title: 'Capacity',
sortField: 'status.capacity.storage',
sortFunc: 'pvcStorage',
transforms: [sortable],
props: { className: tableColumnClasses[4] },
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/components/persistent-volume.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const PVTableHeader = () => {
},
{
title: 'Capacity',
sortField: 'spec.capacity.storage',
sortFunc: 'pvStorage',
transforms: [sortable],
props: { className: tableColumnClasses[3] },
},
Expand Down

0 comments on commit 85786a8

Please sign in to comment.