Skip to content

Commit

Permalink
disable sorting on nested columns
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Mar 1, 2021
1 parent f72b23f commit c14794b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export const EventFieldsBrowser = React.memo<Props>(

const columnHeaders = useDeepEqualSelector((state) => {
const { columns } = getTimeline(state, timelineId) ?? timelineDefaults;

return getColumnHeaders(columns, browserFields);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ JsonView.displayName = 'JsonView';

export const buildJsonView = (data: TimelineEventsDetailsItem[]) =>
data
.sort((a, b) => (a.field > b.field ? 1 : b.field > a.field ? -1 : 0))
.sort((a, b) => a.field.localeCompare(b.field))
.reduce(
(accumulator, item) =>
set(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const HeaderComponent: React.FC<Props> = ({
getManageTimelineById,
timelineId,
]);
const showSortingCapability = !isEqlOn && !(header.subType && header.subType.nested);

return (
<>
Expand All @@ -94,7 +95,7 @@ export const HeaderComponent: React.FC<Props> = ({
isLoading={isLoading}
isResizing={false}
onClick={onColumnSort}
showSortingCapability={!isEqlOn}
showSortingCapability={showSortingCapability}
sort={sort}
>
<Actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { Filter } from '../../../../../../../src/plugins/data/public';
import { Filter, IFieldSubType } from '../../../../../../../src/plugins/data/public';

import { DataProvider } from '../../components/timeline/data_providers/data_provider';
import { Sort } from '../../components/timeline/body/sort';
Expand Down Expand Up @@ -43,6 +43,7 @@ export interface ColumnHeaderOptions {
label?: string;
linkField?: string;
placeholder?: string;
subType?: IFieldSubType;
type?: string;
width: number;
}
Expand Down

0 comments on commit c14794b

Please sign in to comment.