diff --git a/apps/console/src/pages/organizations/mitigations/MitigationView.tsx b/apps/console/src/pages/organizations/mitigations/MitigationView.tsx index 5f4cb5ffb..ea1ce579c 100644 --- a/apps/console/src/pages/organizations/mitigations/MitigationView.tsx +++ b/apps/console/src/pages/organizations/mitigations/MitigationView.tsx @@ -36,6 +36,8 @@ import { Link2, Search, Link as LinkIcon, + CheckSquare, + ShieldCheck, } from "lucide-react"; import { Card, CardContent } from "@/components/ui/card"; import { useToast } from "@/hooks/use-toast"; @@ -445,6 +447,9 @@ function MitigationViewContent({ const navigate = useNavigate(); const environment = useRelayEnvironment(); + // Add state for main content tabs + const [mainContentTab, setMainContentTab] = useState("tasks"); + // Add URLSearchParams handling for task persistence const [searchParams, setSearchParams] = useSearchParams(); const taskIdFromUrl = searchParams.get("taskId"); @@ -883,7 +888,6 @@ function MitigationViewContent({ setLinkEvidenceName(""); setLinkEvidenceUrl(""); setLinkEvidenceDescription(""); - setActiveTab("file"); }; const handleFileSelected = (e: React.ChangeEvent) => { @@ -1662,781 +1666,831 @@ function MitigationViewContent({ - {/* Control Mapping Section */} -
-
-

Controls

- -
- - {/* Control Mapping Dialog */} - - - - Map Mitigation to Controls - - Search and select controls to link to this mitigation. This - helps track which controls are addressed by this mitigation. - - - -
-
-
- - setControlSearchQuery(e.target.value)} - className="w-full pl-10" - /> -
-
- -
- -
-
- -
- {isLoadingControls ? ( -
- - Loading controls... -
- ) : ( -
- {filteredControls().length === 0 ? ( -
- No controls found. Try adjusting your search or select a - different framework. -
- ) : ( - filteredControls().map((control) => { - const isLinked = isControlLinked(control.id); - return ( - -
-
-
-
-
- {control.referenceId} -
- {isLinked && ( - - Linked - - )} -
-

{control.name}

- {control.description && ( -

- {control.description} -

- )} -
-
- {isLinked ? ( - - ) : ( - - )} -
-
-
-
- ); - }) - )} -
- )} -
- - - - -
-
- - {/* Linked Controls List */} - - - {linkedControlsData?.mitigation?.controls?.edges && - linkedControlsData.mitigation.controls.edges.length > 0 ? ( -
- {getLinkedControls().map((control: ControlNode) => ( - -
-
-
- {control.referenceId} -
-
-

{control.name}

- {control.description && ( -

- {control.description} -

- )} -
- -
-
-
- ))} -
- ) : ( -
- No controls linked to this mitigation yet. Click "Map to - Controls" to link controls. -
+ {/* Main Content Tabs */} + + + + + Tasks + {tasks.length > 0 && ( + + {tasks.length} + )} -
-
-
+ + + + Controls + {linkedControlsData?.mitigation?.controls?.edges && + linkedControlsData.mitigation.controls.edges.length > 0 && ( + + {linkedControlsData.mitigation.controls.edges.length} + + )} + + -
-
-

Tasks

-
-
- - Drag & drop files onto tasks to add evidence + {/* Controls Tab Content */} + +
+
+

Controls

+
- - - - - + + {/* Control Mapping Dialog */} + + - Create New Task + Map Mitigation to Controls - Add a new task to this mitigation. Click save when - you're done. + Search and select controls to link to this mitigation. This + helps track which controls are addressed by this mitigation. -
-
- - setNewTaskName(e.target.value)} - placeholder="Enter task name" - /> -
-
- -