fix(frontend): post-review fixes sprint 2

- MitreTechniquePicker: guard sync effect while dropdown open to prevent
  mid-stroke wipe when onChange(null,null) propagates back as null props
- SimulationList: replace window.location.href with navigate() to keep
  TanStack Query cache intact on row click
- SimulationFormPage: simplify redundant ternary on SOC form onSubmit
- SimulationFormPage: remove dead .replace(' ','T') on executed_at
  (backend already returns ISO 8601 with T separator)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Knacky
2026-05-26 11:22:05 +02:00
parent 83bf60fb30
commit c9032a9057
3 changed files with 13 additions and 8 deletions

View File

@@ -86,7 +86,7 @@ export function SimulationFormPage(): JSX.Element {
description: s.description ?? '',
commands: s.commands ?? '',
prerequisites: s.prerequisites ?? '',
executed_at: s.executed_at ? s.executed_at.replace(' ', 'T').slice(0, 16) : '',
executed_at: s.executed_at ? s.executed_at.slice(0, 16) : '',
execution_result: s.execution_result ?? '',
});
setSoc({
@@ -117,6 +117,7 @@ export function SimulationFormPage(): JSX.Element {
const socCanEdit = isSoc && (status === 'review_required' || status === 'done');
const socBlocked = isSoc && (status === 'pending' || status === 'in_progress');
const canSaveSoc = socCanEdit || canEditEngagements;
const rtDisabled = !canEditRT;
const socDisabled = !canEditEngagements && !socCanEdit;
@@ -395,7 +396,7 @@ export function SimulationFormPage(): JSX.Element {
{/* SOC card */}
<form
id="soc-form"
onSubmit={socCanEdit ? onSaveSOC : canEditEngagements ? onSaveSOC : (e) => e.preventDefault()}
onSubmit={canSaveSoc ? onSaveSOC : (e) => e.preventDefault()}
noValidate
className="card-product flex flex-col gap-md"
>
@@ -441,7 +442,7 @@ export function SimulationFormPage(): JSX.Element {
/>
</FormField>
{(socCanEdit || canEditEngagements) && (
{canSaveSoc && (
<div className="flex items-center gap-md pt-sm border-t border-hairline">
<button type="submit" form="soc-form" className="btn-primary" disabled={submitting}>
{updateMutation.isPending ? 'Saving…' : 'Save SOC'}