Skip to content

Commit

Permalink
fixed sorting in threat activity table
Browse files Browse the repository at this point in the history
  • Loading branch information
ag060 committed Jan 9, 2025
1 parent 44c632a commit 6fb6536
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public String fetchSampleData() {
{
put("skip", skip);
put("limit", LIMIT);
put("sort", sort);
}
};
String msg = objectMapper.valueToTree(body).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,22 @@ const headers = [
title: "Source IP",
value: "sourceIPComponent",
},
{
title: "",
type: CellType.ACTION,
},
];

const sortOptions = [
{
label: "Discovered time",
value: "discovered asc",
value: "detectedAt asc",
directionLabel: "Newest",
sortKey: "discovered",
columnIndex: 3,
sortKey: "detectedAt",
columnIndex: 5,
},
{
label: "Discovered time",
value: "discovered desc",
value: "detectedAt desc",
directionLabel: "Oldest",
sortKey: "discovered",
columnIndex: 3,
sortKey: "detectedAt",
columnIndex: 5,
},
];

Expand Down Expand Up @@ -187,24 +183,6 @@ function SusDataTable({ currDateRange, rowClicked }) {
}
}

const getActions = (item) => {
return [
{
items: [
{
content: "View in collection",
onAction: () => {
window.open(
`/dashboard/observe/inventory/${item.apiCollectionId}`,
"_blank"
);
},
},
],
},
];
};

const key = startTimestamp + endTimestamp;
return (
<GithubServerTable
Expand All @@ -215,12 +193,11 @@ function SusDataTable({ currDateRange, rowClicked }) {
sortOptions={sortOptions}
disambiguateLabel={disambiguateLabel}
loading={loading}
// onRowClick={(data) => rowClicked(data)} [For now removing on row click functionality]
fetchData={fetchData}
filters={filters}
selectable={false}
hasRowActions={true}
getActions={getActions}
getActions={() => []}
hideQueryField={true}
headings={headers}
useNewRow={true}
Expand Down

0 comments on commit 6fb6536

Please sign in to comment.