Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

fix: missing param in onConnect

dextmorgn2ee6c8653199
diff --git a/src/components/contexts/search-context.tsx b/src/components/contexts/search-context.tsx
index 120f7589..97a60abb 100644
--- a/src/components/contexts/search-context.tsx
+++ b/src/components/contexts/search-context.tsx
@@ -74,9 +74,9 @@ export const SearchProvider: React.FC<SearchProviderProps> = ({ children }) => {
<SheetTitle>New search</SheetTitle>
<SheetDescription>Make a new keyword associated research.</SheetDescription>
</SheetHeader>
- <form onSubmit={onSubmitNewSearch}>
- <div className="flex flex-col gap-3">
- <Card className="p-4">
+ <form onSubmit={onSubmitNewSearch} className="grow flex flex-col">
+ <div className="flex flex-col grow gap-3 p-2">
+ <Card className="p-4 shadow-none">
<p>
value: <span className="font-medium">"{value}"</span>
</p>
@@ -106,7 +106,7 @@ export const SearchProvider: React.FC<SearchProviderProps> = ({ children }) => {
)
)}
</div>
- <SheetFooter className="mt-4">
+ <SheetFooter className="mt-auto flex flex-row justify-end gap-2">
<SheetClose asChild>
<Button type="button" variant="outline">
Close
diff --git a/src/components/contexts/use-flow-store.tsx b/src/components/contexts/use-flow-store.tsx
index 7370092d..53bfcde7 100644
--- a/src/components/contexts/use-flow-store.tsx
+++ b/src/components/contexts/use-flow-store.tsx
@@ -74,6 +74,7 @@ const createStore = (initialNodes: AppNode[] = [], initialEdges: Edge[] = []) =>
set({ currentNode: nodeId });
},
onConnect: async (params: any, investigation_id?: string) => {
+ console.log(investigation_id)
if (!investigation_id) return;
try {
// Insertion dans Supabase
diff --git a/src/components/investigations/graph.tsx b/src/components/investigations/graph.tsx
index 4e6c37db..85f43b95 100644
--- a/src/components/investigations/graph.tsx
+++ b/src/components/investigations/graph.tsx
@@ -98,7 +98,7 @@ const LayoutFlow = ({ theme }: { theme: ColorMode }) => {
edges={edges}
onNodesChange={onNodesChange}
onEdgesChange={onEdgesChange}
- onConnect={onConnect}
+ onConnect={(p: any) => onConnect(p, investigation_id as string)}
onNodeClick={onNodeClick}
onPaneClick={onPaneClick}
minZoom={0.1}
diff --git a/src/components/investigations/nodes/email.tsx b/src/components/investigations/nodes/email.tsx
index c8f309df..2beadec6 100644
--- a/src/components/investigations/nodes/email.tsx
+++ b/src/components/investigations/nodes/email.tsx
@@ -3,7 +3,7 @@
import { memo } from "react"
import { Handle, Position, useStore } from "@xyflow/react"
import { NodeProvider, useNodeContext } from "../../contexts/node-context"
-import { AtSign, LocateIcon, Zap } from "lucide-react"
+import { AtSignIcon, Zap } from "lucide-react"
import { cn, zoomSelector } from "@/lib/utils"
import { useInvestigationContext } from "../../contexts/investigation-provider"
import { CopyButton } from "../../copy"
@@ -42,7 +42,7 @@ function EmailNode({ data }: any) {
>
<div className="flex items-center gap-2 p-1">
<Badge variant="secondary" className="h-6 w-6 p-0 rounded-full">
- <LocateIcon className="h-4 w-4" />
+ <AtSignIcon className="h-4 w-4" />
</Badge>
<div className="flex items-center gap-1">
<span className="text-sm">{data.label}</span>
@@ -57,7 +57,7 @@ function EmailNode({ data }: any) {
<Button variant="ghost" className="rounded-full p-0">
<Avatar className="h-6 w-6">
<AvatarFallback>
- <AtSign className="h-3 w-3" />
+ <AtSignIcon className="h-3 w-3" />
</AvatarFallback>
</Avatar>
</Button>
diff --git a/src/components/investigations/nodes/ip_address.tsx b/src/components/investigations/nodes/ip_address.tsx
index eb577c18..abfdc87c 100644
--- a/src/components/investigations/nodes/ip_address.tsx
+++ b/src/components/investigations/nodes/ip_address.tsx
@@ -74,7 +74,7 @@ function IpNode({ data }: any) {
</div>
</ContextMenuTrigger>
<ContextMenuContent>
- <ContextMenuItem onClick={() => handleOpenSearchModal(data.email)}>
+ <ContextMenuItem onClick={() => handleOpenSearchModal(data.label)}>
Launch search
<Zap className="ml-2 h-4 w-4 text-orange-500" />
</ContextMenuItem>
diff --git a/src/components/investigations/nodes/phone.tsx b/src/components/investigations/nodes/phone.tsx
index ca0a6ee4..c9c4636c 100644
--- a/src/components/investigations/nodes/phone.tsx
+++ b/src/components/investigations/nodes/phone.tsx
@@ -74,7 +74,7 @@ function PhoneNode({ data }: any) {
</div>
</ContextMenuTrigger>
<ContextMenuContent>
- <ContextMenuItem onClick={() => handleOpenSearchModal(data.email)}>
+ <ContextMenuItem onClick={() => handleOpenSearchModal(data.phone_number)}>
Launch search
<Zap className="ml-2 h-4 w-4 text-orange-500" />
</ContextMenuItem>
diff --git a/src/components/investigations/nodes/physical_address.tsx b/src/components/investigations/nodes/physical_address.tsx
index 97ea43dc..830a72e4 100644
--- a/src/components/investigations/nodes/physical_address.tsx
+++ b/src/components/investigations/nodes/physical_address.tsx
@@ -74,7 +74,7 @@ function AddressNode({ data }: any) {
</div>
</ContextMenuTrigger>
<ContextMenuContent>
- <ContextMenuItem onClick={() => handleOpenSearchModal(data.email)}>
+ <ContextMenuItem onClick={() => handleOpenSearchModal(data.label)}>
Launch search
<Zap className="ml-2 h-4 w-4 text-orange-500" />
</ContextMenuItem>