Skip to content

Commit

Permalink
Sort function doesn't work on ns operator details
Browse files Browse the repository at this point in the history
  • Loading branch information
cyril-ui-developer committed Aug 16, 2022
1 parent 64e232b commit 01367d8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import {
useExtensions,
isClusterServiceVersionAction,
} from '@console/plugin-sdk';
import { Status, SuccessStatus } from '@console/shared';
import { Status, SuccessStatus, getNamespace } from '@console/shared';
import ErrorAlert from '@console/shared/src/components/alerts/error';
import { useK8sModel } from '@console/shared/src/hooks/useK8sModel';
import { useK8sModels } from '@console/shared/src/hooks/useK8sModels';
Expand All @@ -85,6 +85,7 @@ import ModelStatusBox from '../model-status-box';
import { csvNameFromWindow, OperandLink } from './operand-link';
import { ShowOperandsInAllNamespacesRadioGroup } from './ShowOperandsInAllNamespacesRadioGroup';
import { useShowOperandsInAllNamespaces } from './useShowOperandsInAllNamespaces';

/**
* @depricated these actions has been converted to Action extension, src/actions/csv-actions.ts
*/
Expand Down Expand Up @@ -282,6 +283,8 @@ export const OperandTableRow: React.FC<OperandTableRowProps> = ({ obj, showNames
);
};

const getOperandNamespace = (obj: ClusterServiceVersionKind): string | null => getNamespace(obj);

export const OperandList: React.FC<OperandListProps> = (props) => {
const { t } = useTranslation();
const { noAPIsFound, showNamespace } = props;
Expand All @@ -300,7 +303,7 @@ export const OperandList: React.FC<OperandListProps> = (props) => {
};
const namespaceHeader: Header = {
title: t('public~Namespace'),
sortFunc: 'metadata.namespace',
sortFunc: 'getOperandNamespace',
transforms: [sortable],
props: { className: tableColumnClasses[2] },
};
Expand Down Expand Up @@ -366,6 +369,7 @@ export const OperandList: React.FC<OperandListProps> = (props) => {
{...props}
customSorts={{
operandStatus: getOperandStatusText,
getOperandNamespace,
}}
data={data}
EmptyMsg={() =>
Expand Down

0 comments on commit 01367d8

Please sign in to comment.