mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 02:35:56 +08:00
* fix: issue #3034, add columns to end of the list * fix: #3033 replace columns
This commit is contained in:
parent
197ccca30f
commit
c1664dde6a
@ -1,11 +1,11 @@
|
|||||||
import { DEFAULT_PER_PAGE_OPTIONS } from 'hooks/queryPagination';
|
import { DEFAULT_PER_PAGE_OPTIONS } from 'hooks/queryPagination';
|
||||||
|
|
||||||
export const defaultSelectedColumns: string[] = [
|
export const defaultSelectedColumns: string[] = [
|
||||||
'name',
|
|
||||||
'serviceName',
|
'serviceName',
|
||||||
'responseStatusCode',
|
'name',
|
||||||
'httpMethod',
|
|
||||||
'durationNano',
|
'durationNano',
|
||||||
|
'httpMethod',
|
||||||
|
'responseStatusCode',
|
||||||
];
|
];
|
||||||
|
|
||||||
export const PER_PAGE_OPTIONS: number[] = [10, ...DEFAULT_PER_PAGE_OPTIONS];
|
export const PER_PAGE_OPTIONS: number[] = [10, ...DEFAULT_PER_PAGE_OPTIONS];
|
||||||
|
@ -28,21 +28,18 @@ export const modifyColumns = (
|
|||||||
columns: ColumnsType<RowData>,
|
columns: ColumnsType<RowData>,
|
||||||
selectedColumns: BaseAutocompleteData[],
|
selectedColumns: BaseAutocompleteData[],
|
||||||
): ColumnsType<RowData> => {
|
): ColumnsType<RowData> => {
|
||||||
const initialColumns = columns.filter(({ key }) => {
|
const initialColumns = selectedColumns.reduce(
|
||||||
let isValidColumn = true;
|
(acc, { key: selectedColumnKey }) => {
|
||||||
|
const column = columns.find(({ key }) => selectedColumnKey === key);
|
||||||
|
|
||||||
const checkIsExistColumnByKey = (attributeKey: string): boolean =>
|
if (column) {
|
||||||
!selectedColumns.find(({ key }) => key === attributeKey) &&
|
return [...acc, column];
|
||||||
attributeKey === key;
|
}
|
||||||
|
|
||||||
const isSelectedSpanId = checkIsExistColumnByKey('spanID');
|
return acc;
|
||||||
const isSelectedTraceId = checkIsExistColumnByKey('traceID');
|
},
|
||||||
|
[] as ColumnsType<RowData>,
|
||||||
if (isSelectedSpanId || isSelectedTraceId || key === 'date')
|
);
|
||||||
isValidColumn = false;
|
|
||||||
|
|
||||||
return isValidColumn;
|
|
||||||
});
|
|
||||||
|
|
||||||
const dateColumn = columns.find(({ key }) => key === 'date');
|
const dateColumn = columns.find(({ key }) => key === 'date');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user