Skip to content

Commit

Permalink
fix: hide mitigation chip for control suggestions if relevant threat …
Browse files Browse the repository at this point in the history
…suggestion does not exist
  • Loading branch information
Tethik committed Oct 20, 2023
1 parent 92830d9 commit e438fec
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions app/src/components/model/panels/right/Suggestion.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,21 @@ export function Suggestion(props) {
>
Mitigates:
</Typography>
{suggestion.mitigates.map((m) => (
<Chip
label={
threatSuggestions.find((t) =>
t.id.includes(m.partialThreatId)
)?.title
}
/>
))}
{suggestion.mitigates
.filter((m) =>
threatSuggestions.find((t) =>
t.id.includes(m.partialThreatId)
)
)
.map((m) => (
<Chip
label={
threatSuggestions.find((t) =>
t.id.includes(m.partialThreatId)
)?.title
}
/>
))}
</>
)}
{suggestion.reason && (
Expand Down

0 comments on commit e438fec

Please sign in to comment.