Skip to content

Commit

Permalink
chore: Update MitigationCandidate
Browse files Browse the repository at this point in the history
  • Loading branch information
jessieweiyi committed Sep 10, 2024
1 parent c292020 commit e871287
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Header: FC<HeaderProps> = ({
return (
<SpaceBetween direction="horizontal" size="xs">
<Button onClick={onCancel}>Threat list</Button>
<Button onClick={onStartOver}>Start over</Button>
{onStartOver && <Button onClick={onStartOver}>Start over</Button>}
<Button variant="primary" onClick={onComplete} disabled={!statement.statement}>
{saveButtonText}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ const MitigationCandidates: FC<MitigationCandidatesProp> = ({
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<Mitigation>[] = useMemo(() => [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const ContentLayout: FC<PropsWithChildren<{
editingStatement: TemplateThreatStatement;
saveButtonText: string;
onCancel: () => void;
onStartOver: () => void;
onStartOver?: () => void;
onComplete: () => void;
}>> = ({
children,
Expand Down Expand Up @@ -389,7 +389,7 @@ export const ThreatStatementEditorInner: FC<ThreatStatementEditorProps & { editi
saveButtonText={saveButtonText}
editingStatement={editingStatement}
onCancel={handleCancel}
onStartOver={handleStartOver}
onStartOver={isExampleVisible ? handleStartOver : undefined}
onComplete={handleComplete}
>
<SpaceBetween direction='vertical' size='l'>
Expand Down

0 comments on commit e871287

Please sign in to comment.