Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ interface SearchResult {
const searchResultsTableColumns: NonNullable<TableProps<SearchResult>["columns"]> = [
{
dataIndex: "timestamp",
defaultSortOrder: "ascend",
key: "timestamp",
render: (timestamp: number) => dayjs(timestamp).format(DATETIME_FORMAT_TEMPLATE),
sorter: true,
sorter: (a, b) => a.timestamp - b.timestamp,

// Specifying a third sort direction removes ability for user to cancel sorting.
sortDirections: [
"ascend",
"descend",
"ascend",
],
title: "Timestamp",
width: 15,
},
Comment on lines 27 to 42

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(optional: utterly nit-picking) since there're many fields already, i'd probably group the fields:

Suggested change
{
dataIndex: "timestamp",
defaultSortOrder: "ascend",
key: "timestamp",
render: (timestamp: number) => dayjs(timestamp).format(DATETIME_FORMAT_TEMPLATE),
sorter: true,
sorter: (a, b) => a.timestamp - b.timestamp,
// Specifying a third sort direction removes ability for user to cancel sorting.
sortDirections: [
"ascend",
"descend",
"ascend",
],
title: "Timestamp",
width: 15,
},
{
dataIndex: "timestamp",
key: "timestamp",
title: "Timestamp",
render: (timestamp: number) => dayjs(timestamp).format(DATETIME_FORMAT_TEMPLATE),
width: 15,
// Specifying a third sort direction removes ability for user to cancel sorting.
defaultSortOrder: "ascend",
sortDirections: [
"ascend",
"descend",
"ascend",
],
sorter: (a, b) => a.timestamp - b.timestamp,
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be happy to do this, but the linter will complain about sort keys

Expand Down