Skip to content

Commit

Permalink
Merge pull request #1707 from pc-bob/BL/fix-security-insights-first-load
Browse files Browse the repository at this point in the history
fix(security-insights): set filtered table data on initial load
  • Loading branch information
Xantier authored Nov 13, 2024
2 parents f126973 + 92143c0 commit 3c86fc0
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 3c86fc0

Please sign in to comment.