Skip to content

Commit 6fb6536

Browse files
committed
fixed sorting in threat activity table
1 parent 44c632a commit 6fb6536

File tree

2 files changed

+8
-30
lines changed

2 files changed

+8
-30
lines changed

apps/dashboard/src/main/java/com/akto/action/threat_detection/SuspectSampleDataAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public String fetchSampleData() {
5353
{
5454
put("skip", skip);
5555
put("limit", LIMIT);
56+
put("sort", sort);
5657
}
5758
};
5859
String msg = objectMapper.valueToTree(body).toString();

apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/threat_detection/components/SusDataTable.jsx

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,22 @@ const headers = [
4646
title: "Source IP",
4747
value: "sourceIPComponent",
4848
},
49-
{
50-
title: "",
51-
type: CellType.ACTION,
52-
},
5349
];
5450

5551
const sortOptions = [
5652
{
5753
label: "Discovered time",
58-
value: "discovered asc",
54+
value: "detectedAt asc",
5955
directionLabel: "Newest",
60-
sortKey: "discovered",
61-
columnIndex: 3,
56+
sortKey: "detectedAt",
57+
columnIndex: 5,
6258
},
6359
{
6460
label: "Discovered time",
65-
value: "discovered desc",
61+
value: "detectedAt desc",
6662
directionLabel: "Oldest",
67-
sortKey: "discovered",
68-
columnIndex: 3,
63+
sortKey: "detectedAt",
64+
columnIndex: 5,
6965
},
7066
];
7167

@@ -187,24 +183,6 @@ function SusDataTable({ currDateRange, rowClicked }) {
187183
}
188184
}
189185

190-
const getActions = (item) => {
191-
return [
192-
{
193-
items: [
194-
{
195-
content: "View in collection",
196-
onAction: () => {
197-
window.open(
198-
`/dashboard/observe/inventory/${item.apiCollectionId}`,
199-
"_blank"
200-
);
201-
},
202-
},
203-
],
204-
},
205-
];
206-
};
207-
208186
const key = startTimestamp + endTimestamp;
209187
return (
210188
<GithubServerTable
@@ -215,12 +193,11 @@ function SusDataTable({ currDateRange, rowClicked }) {
215193
sortOptions={sortOptions}
216194
disambiguateLabel={disambiguateLabel}
217195
loading={loading}
218-
// onRowClick={(data) => rowClicked(data)} [For now removing on row click functionality]
219196
fetchData={fetchData}
220197
filters={filters}
221198
selectable={false}
222199
hasRowActions={true}
223-
getActions={getActions}
200+
getActions={() => []}
224201
hideQueryField={true}
225202
headings={headers}
226203
useNewRow={true}

0 commit comments

Comments
 (0)