Skip to content

Commit

Permalink
fixed recent alerts & finding order; count for pie chart (#576)
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
  • Loading branch information
amsiglan committed May 5, 2023
1 parent 65f3a0b commit 3812055
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const RecentAlertsWidget: React.FC<RecentAlertsWidgetProps> = ({
items.sort((a, b) => {
const timeA = new Date(a.time).getTime();
const timeB = new Date(b.time).getTime();
return timeA - timeB;
return timeB - timeA;
});
setAlertItems(items.slice(0, 20));
setwidgetEmptyMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const RecentFindingsWidget: React.FC<RecentFindingsWidgetProps> = ({

useEffect(() => {
items.sort((a, b) => {
return a.time - b.time;
return b.time - a.time;
});
setFindingItems(items.slice(0, 20));
setWidgetEmptyMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const TopRulesWidget: React.FC<TopRulesWidgetProps> = ({ findings, loadin
if (Object.keys(rulesCount).length > 0) {
const visualizationData = Object.keys(rulesCount).map((ruleName) => ({
ruleName,
count: 1,
count: rulesCount[ruleName],
}));
renderVisualization(getTopRulesVisualizationSpec(visualizationData), 'top-rules-view');
}
Expand Down

0 comments on commit 3812055

Please sign in to comment.