From e871287ec90c29c9a89e0f5a884a330e5aa64800 Mon Sep 17 00:00:00 2001 From: Jessie Wei Date: Tue, 10 Sep 2024 20:10:16 +1000 Subject: [PATCH] chore: Update MitigationCandidate --- .../threat-composer/src/components/threats/Header/index.tsx | 2 +- .../src/components/threats/MitigationCandidates/index.tsx | 4 +++- .../src/components/threats/ThreatStatementEditor/index.tsx | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/threat-composer/src/components/threats/Header/index.tsx b/packages/threat-composer/src/components/threats/Header/index.tsx index ef4b8116..d6289f48 100644 --- a/packages/threat-composer/src/components/threats/Header/index.tsx +++ b/packages/threat-composer/src/components/threats/Header/index.tsx @@ -40,7 +40,7 @@ const Header: FC = ({ return ( - + {onStartOver && } diff --git a/packages/threat-composer/src/components/threats/MitigationCandidates/index.tsx b/packages/threat-composer/src/components/threats/MitigationCandidates/index.tsx index 2c7fd01e..0fc48074 100644 --- a/packages/threat-composer/src/components/threats/MitigationCandidates/index.tsx +++ b/packages/threat-composer/src/components/threats/MitigationCandidates/index.tsx @@ -59,11 +59,13 @@ const MitigationCandidates: FC = ({ if (threatPackId && threatPackThreatId) { const mitigationCandidates = await getMitigationCandidates(threatPackId, threatPackThreatId); setMitigations(mitigationCandidates); + } else { + setMitigations([]); } }; setupMitigations().catch(err => console.log('Error', err)); - }, [threatPackId, threatPackThreatId]); + }, [threatPackId, threatPackThreatId, getMitigationCandidates]); const colDef: ColumnDefinition[] = useMemo(() => [ { diff --git a/packages/threat-composer/src/components/threats/ThreatStatementEditor/index.tsx b/packages/threat-composer/src/components/threats/ThreatStatementEditor/index.tsx index 5655422c..9883d3cd 100644 --- a/packages/threat-composer/src/components/threats/ThreatStatementEditor/index.tsx +++ b/packages/threat-composer/src/components/threats/ThreatStatementEditor/index.tsx @@ -97,7 +97,7 @@ const ContentLayout: FC void; - onStartOver: () => void; + onStartOver?: () => void; onComplete: () => void; }>> = ({ children, @@ -389,7 +389,7 @@ export const ThreatStatementEditorInner: FC