Skip to content

Commit

Permalink
fix(security-insights): set filtered table data on initial load
Browse files Browse the repository at this point in the history
  • Loading branch information
pc-bob committed Oct 30, 2024
1 parent b59b4b4 commit dc29b55
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-forks-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@roadiehq/backstage-plugin-security-insights': patch
---

fix bug where security insights tab was empty on initial render until clicking one of the filter buttons
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ export const SecurityInsightsTable = () => {
);
const data = response.data as SecurityInsight[];
setTableData(data);
if (insightsStatusFilter) {
setFilteredTableData(
data.filter(entry => entry.state === insightsStatusFilter),
);
}
return data;
}, []);

Expand Down

0 comments on commit dc29b55

Please sign in to comment.