fix: ignore the sort_by when no data
This commit is contained in:
@@ -15,6 +15,7 @@ import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { message } from 'antd';
|
||||
import { useAtom } from 'jotai';
|
||||
import _ from 'lodash';
|
||||
import { useEffect, useState } from 'react';
|
||||
import NoResult from '../_components/no-result';
|
||||
import PageBox from '../_components/page-box';
|
||||
@@ -343,7 +344,7 @@ const Clusters: React.FC = () => {
|
||||
loadend={dataSource.loadend}
|
||||
dataSource={dataSource.dataList}
|
||||
image={<IconFont type="icon-cluster-outline" />}
|
||||
filters={queryParams}
|
||||
filters={_.omit(queryParams, ['sort_by'])}
|
||||
noFoundText={intl.formatMessage({
|
||||
id: 'noresult.cluster.nofound'
|
||||
})}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { ConfigProvider, Table, message } from 'antd';
|
||||
import { useAtom } from 'jotai';
|
||||
import _ from 'lodash';
|
||||
import { useState } from 'react';
|
||||
import NoResult from '../_components/no-result';
|
||||
import PageBox from '../_components/page-box';
|
||||
@@ -159,7 +160,7 @@ const Credentials: React.FC = () => {
|
||||
loadend={dataSource.loadend}
|
||||
dataSource={[]}
|
||||
image={<IconFont type="icon-credential-outline" />}
|
||||
filters={queryParams}
|
||||
filters={_.omit(queryParams, ['sort_by'])}
|
||||
noFoundText={intl.formatMessage({
|
||||
id: 'noresult.credentials.nofound'
|
||||
})}
|
||||
|
||||
@@ -4,17 +4,13 @@ import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { ColumnsType } from 'antd/es/table';
|
||||
import type { SortOrder } from 'antd/es/table/interface';
|
||||
import dayjs from 'dayjs';
|
||||
import { useMemo } from 'react';
|
||||
import { ProviderLabelMap, credentialActionList } from '../config';
|
||||
import { CredentialListItem as ListItem } from '../config/types';
|
||||
|
||||
const useCredentialColumns = (
|
||||
sortOrder: {
|
||||
order?: SortOrder;
|
||||
columnKey?: string;
|
||||
},
|
||||
sortOrder: string[],
|
||||
handleSelect: (val: string, record: ListItem) => void
|
||||
): ColumnsType<ListItem> => {
|
||||
const intl = useIntl();
|
||||
@@ -76,7 +72,7 @@ const useCredentialColumns = (
|
||||
)
|
||||
}
|
||||
];
|
||||
}, [intl, handleSelect, sortOrder]);
|
||||
}, [intl, handleSelect]);
|
||||
};
|
||||
|
||||
export default useCredentialColumns;
|
||||
|
||||
@@ -25,6 +25,7 @@ const ClusterAdvanceConfig: React.FC<{
|
||||
return editorRef.current?.getValue();
|
||||
},
|
||||
setYamlValue: (values: any) => {
|
||||
console.log('setYamlValue:', values);
|
||||
editorRef.current?.setValue(values || yamlTemplate);
|
||||
}
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user