Skip to content

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

feat: storage

dextmorgne3ec5b1400d5
diff --git a/flowsint-web/src/app/api/projects/[project_id]/documents/route.ts b/flowsint-web/src/app/api/projects/[project_id]/documents/route.ts
index 35a2979b..521f8494 100644
--- a/flowsint-web/src/app/api/projects/[project_id]/documents/route.ts
+++ b/flowsint-web/src/app/api/projects/[project_id]/documents/route.ts
@@ -28,7 +28,7 @@ export async function GET(_: Request, { params }: { params: Promise<{ project_id
return NextResponse.json({ error: error.message }, { status: 500 })
}
// Filtrer le fichier .emptyFolderPlaceholder
- const filteredData = data?.filter((file) => file.name !== ".emptyFolderPlaceholder") || []
+ const filteredData = data?.filter((file) => !["placeholder", ".emptyFolderPlaceholder"].includes(file.name)) || []
// Récupérer les URLs publiques pour chaque fichier
const filesWithUrls = await Promise.all(
diff --git a/flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/data/route.ts b/flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/sketch/route.ts
similarity index 100%
rename from flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/data/route.ts
rename to flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/sketch/route.ts
diff --git a/flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/table/route.ts b/flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/table/route.ts
new file mode 100644
index 00000000..ac764114
--- /dev/null
+++ b/flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/table/route.ts
@@ -0,0 +1,32 @@
+import { createClient } from "@/lib/supabase/server"
+import type { NodeData, EdgeData } from "@/types"
+import { NextResponse } from "next/server"
+
+export async function GET(_: Request, { params }: { params: Promise<{ investigation_id: string }> }) {
+ const { investigation_id } = await params
+ const supabase = await createClient()
+ try {
+ const {
+ data: { user },
+ error: userError,
+ } = await supabase.auth.getUser();
+ if (!user || userError) {
+ return NextResponse.json({ error: "Unauthorized" }, { status: 401 })
+ }
+ const { data: graphData, error: graphError } = await supabase
+ .from("investigation_table")
+ .select("*")
+ .eq("investigation_id", investigation_id)
+ .single();
+
+ if (graphError) {
+ return NextResponse.json({ error: graphError.message }, { status: 500 })
+ }
+ if (!graphData) {
+ return NextResponse.json({ error: "Not found" }, { status: 404 })
+ }
+ return NextResponse.json(graphData.data, { status: 200 })
+ } catch (error) {
+ return NextResponse.json({ error: "Internal Server Error" }, { status: 500 })
+ }
+}
diff --git a/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/client.tsx b/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/client.tsx
index 2c042550..14dc8a9b 100644
--- a/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/client.tsx
+++ b/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/client.tsx
@@ -16,7 +16,7 @@ export default function DashboardClient({ projectId, investigationId }: Dashboar
const graphQuery = useQuery({
queryKey: ["investigation", investigationId, "data"],
queryFn: async () => {
- const res = await fetch(`/api/projects/${projectId}/investigations/${investigationId}/data`)
+ const res = await fetch(`/api/projects/${projectId}/investigations/${investigationId}/sketch`)
if (!res.ok) {
notFound()
}
diff --git a/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/individuals/data-table.tsx b/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/table/data-table.tsx
similarity index 91%
rename from flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/individuals/data-table.tsx
rename to flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/table/data-table.tsx
index a5ca236f..51055f09 100644
--- a/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/individuals/data-table.tsx
+++ b/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/table/data-table.tsx
@@ -43,6 +43,7 @@ import {
ChevronsRightIcon,
ColumnsIcon,
GripVerticalIcon,
+ HelpCircle,
MoreVerticalIcon,
PlusIcon,
RotateCwIcon,
@@ -96,6 +97,8 @@ import { TypeBadge } from "@/components/type-badge"
import { DialogTitle } from "@radix-ui/react-dialog"
import { MemoizedKeyValueDisplay } from "@/components/investigations/sketch/profile-panel"
import { Card } from "@/components/ui/card"
+import { actionItems } from "@/lib/action-items"
+import { usePlatformIcons } from "@/lib/hooks/use-platform-icons"
function DragHandle({ id }: { id: number }) {
const { attributes, listeners } = useSortable({
@@ -120,7 +123,7 @@ const columns: ColumnDef<any>[] = [
{
id: "drag",
header: () => null,
- cell: ({ row }: any) => <DragHandle id={row.original.id} />,
+ cell: ({ row }: any) => <DragHandle id={row.original.data.id} />,
},
{
id: "select",
@@ -153,14 +156,9 @@ const columns: ColumnDef<any>[] = [
header: "Full Name",
cell: ({ row }: any) => {
return (
- <TableCellViewer item={row.original}>
+ <TableCellViewer item={row.original.data}>
<div className="flex items-center gap-2">
- <Avatar className="h-7 w-7">
- <AvatarImage src={row.original.image_url} alt={row.original.full_name} />
- <AvatarFallback>
- <UserIcon className="h-4 w-4 opacity-60" />
- </AvatarFallback>
- </Avatar>{row.original.full_name}
+ {row.original.data.label}
</div>
</TableCellViewer>)
},
@@ -170,7 +168,7 @@ const columns: ColumnDef<any>[] = [
accessorKey: "type",
header: "Type",
cell: ({ row }: any) => {
- return <TypeBadge type={"individual"} />
+ return <TypeBadge type={row?.original?.data?.type} />
},
enableHiding: false,
},
@@ -179,7 +177,7 @@ const columns: ColumnDef<any>[] = [
header: "Email(s)",
cell: ({ row }: any) => {
return <Badge variant="outline" className="px-1.5 text-muted-foreground flex items-center gap-2 max-w-[290px]">
- <span className="truncate text-ellipsis">{row.original?.emails?.map(({ email }: any) => email).join(", ") || <span className="italic opacity-60">No email yet.</span>}</span>
+ <span className="truncate text-ellipsis">{row.original.data?.emails?.map(({ email }: any) => email).join(", ") || <span className="italic opacity-60">No email yet.</span>}</span>
</Badge>
},
enableHiding: false,
@@ -189,7 +187,7 @@ const columns: ColumnDef<any>[] = [
header: "Phone(s)",
cell: ({ row }: any) => {
return <Badge variant="outline" className="px-1.5 text-muted-foreground flex items-center gap-2 max-w-[290px]">
- <span className="truncate text-ellipsis">{row.original?.phone_numbers?.map(({ phone_number }: any) => phone_number).join(", ") || <span className="italic opacity-60">No phone number yet.</span>}</span>
+ <span className="truncate text-ellipsis">{row.original.data?.phone_numbers?.map(({ phone_number }: any) => phone_number).join(", ") || <span className="italic opacity-60">No phone number yet.</span>}</span>
</Badge>
},
enableHiding: false,
@@ -200,7 +198,7 @@ const columns: ColumnDef<any>[] = [
cell: ({ row }: any) => (
<div>
<Badge variant="outline" className="px-1.5 text-muted-foreground">
- {formatDistanceToNow(row.original.created_at, { addSuffix: true }) || "N/A"}
+ {formatDistanceToNow(row.original.data.created_at, { addSuffix: true }) || "N/A"}
</Badge>
</div>
),
@@ -211,7 +209,7 @@ const columns: ColumnDef<any>[] = [
cell: ({ row }: any) => (
<div>
<Badge variant="outline" className="px-1.5 text-muted-foreground">
- {row.original.nationality || "N/A"}
+ {row.original.data.nationality || "N/A"}
</Badge>
</div>
),
@@ -224,7 +222,7 @@ const columns: ColumnDef<any>[] = [
variant="outline"
className="flex gap-1 px-1.5 text-muted-foreground [&_svg]:size-3"
>
- <span>{row.originalbirth_date || "N/A"}</span>
+ <span>{row.original.databirth_date || "N/A"}</span>
</Badge>
),
},
@@ -234,7 +232,7 @@ const columns: ColumnDef<any>[] = [
cell: ({ row }: any) => (
<div>
<Badge variant="outline" className="px-1.5 text-muted-foreground">
- {row.original.gender || "N/A"}
+ {row.original.data.gender || "N/A"}
</Badge>
</div>
),
@@ -267,7 +265,7 @@ const columns: ColumnDef<any>[] = [
function DraggableRow({ row }: { row: Row<any> }) {
const { transform, transition, setNodeRef, isDragging } = useSortable({
- id: row.original.id,
+ id: row.original.data.id,
})
return (
@@ -602,16 +600,28 @@ export function DataTable({
}
function TableCellViewer({ item, children }: { item: any, children: React.ReactNode }) {
+
+ const i = React.useMemo(() =>
+ (actionItems as any).find((a: any) => a.type === item?.type),
+ [item?.original?.data?.type]
+ )
+ const Icon = i?.icon || HelpCircle
return (
<Sheet>
<SheetTrigger asChild>
- <Button variant="link" className="w-fit px-0 text-left text-foreground">
- {children}
- </Button>
+ {item.type === "social" ?
+
+ <SocialButton item={item} /> :
+ <Button variant="link" className="w-fit px-0 text-left text-foreground">
+ <Badge variant="secondary" className="h-7 w-7 p-0 rounded-full">
+ <Icon className="h-5 w-5" />
+ </Badge>
+ {children}
+ </Button>}
</SheetTrigger>
<SheetContent side="right" className="flex flex-col">
<DialogTitle className="text-2xl p-4 font-bold">
- {item.full_name}
+ {item.label}
</DialogTitle>
<MemoizedKeyValueDisplay data={item} />
<SheetFooter className="mt-auto flex gap-2 sm:flex-col sm:space-x-0">
@@ -625,3 +635,20 @@ function TableCellViewer({ item, children }: { item: any, children: React.ReactN
</Sheet>
)
}
+
+const SocialButton = ({ item }: { item: any }) => {
+ const platformsIcons = usePlatformIcons()
+ const platformIcon = React.useMemo(() => {
+ // @ts-ignore
+ return platformsIcons?.[item.platform]?.icon
+ }, [platformsIcons, item.platform])
+
+ return (
+ <Button variant="link" className="w-fit px-0 text-left text-foreground">
+ <Badge variant="secondary" className="h-7 w-7 p-0 rounded-full">
+ {platformIcon}
+ </Badge>
+ {item.label}
+ </Button>
+ )
+}
\ No newline at end of file
diff --git a/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/individuals/page.tsx b/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/table/page.tsx
similarity index 80%
rename from flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/individuals/page.tsx
rename to flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/table/page.tsx
index 53040d02..acf95164 100644
--- a/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/individuals/page.tsx
+++ b/flowsint-web/src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/table/page.tsx
@@ -11,7 +11,7 @@ const IndividualsPage = () => {
const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: 10 })
const fetchIndividuals = async () => {
- const response = await fetch(`/api/projects/${project_id}/investigations/${investigation_id}/individuals?page=${pagination.pageIndex + 1}&size=${pagination.pageSize}&includeEmails=true&includePhones=true`)
+ const response = await fetch(`/api/projects/${project_id}/investigations/${investigation_id}/table?page=${pagination.pageIndex + 1}&size=${pagination.pageSize}&includeEmails=true&includePhones=true`)
return response.json()
}
@@ -24,8 +24,8 @@ const IndividualsPage = () => {
return (
<div className="w-full space-y-8 mx-auto py-12 px-8">
{isLoading ? <TableSkeleton /> :
- <DataTable data={data.individuals}
- pageCount={data?.individuals?.length}
+ <DataTable data={data}
+ pageCount={data?.length}
pagination={pagination}
refetch={refetch}
setPagination={setPagination}
diff --git a/flowsint-web/src/components/copy.tsx b/flowsint-web/src/components/copy.tsx
index e673712e..5f2465e7 100644
--- a/flowsint-web/src/components/copy.tsx
+++ b/flowsint-web/src/components/copy.tsx
@@ -1,7 +1,7 @@
"use client"
import { useState, useCallback } from "react"
-import { CopyIcon } from "lucide-react"
+import { CheckIcon, CopyIcon } from "lucide-react"
import { useTimeout } from "usehooks-ts"
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip"
import { Button } from "./ui/button"
@@ -36,7 +36,7 @@ export function CopyButton({ content, className, delay = 2000 }: CopyButtonProps
<Tooltip open={isCopied}>
<TooltipTrigger asChild>
<Button className={cn("h-7 w-7", className)} size={"icon"} variant="ghost" onClick={handleCopy} aria-label="Copy content">
- <CopyIcon className="!h-3.5 !w-3.5 opacity-50" />
+ {isCopied ? <CheckIcon className="!h-3.5 !w-3.5 text-primary " /> : <CopyIcon className="!h-3.5 !w-3.5 opacity-50" />}
</Button>
</TooltipTrigger>
<TooltipContent>
diff --git a/flowsint-web/src/components/dashboard/new-project.tsx b/flowsint-web/src/components/dashboard/new-project.tsx
index 34af3818..87b0c1b8 100644
--- a/flowsint-web/src/components/dashboard/new-project.tsx
+++ b/flowsint-web/src/components/dashboard/new-project.tsx
@@ -38,6 +38,8 @@ export default function NewProject({ children, noDropDown }: { children: React.R
const result = await createNewProject(formData)
if (result.success) {
toast.success("New project created.")
+ if (result.path)
+ toast.success("New storage bucket created.")
router.push(`/dashboard/projects/${result.id}`)
setOpen(false)
} else {
@@ -48,7 +50,7 @@ export default function NewProject({ children, noDropDown }: { children: React.R
if (noDropDown) return (
<>
<Button asChild onClick={() => setOpen(true)}>{children}</Button>
- <Dialog open={open} onOpenChange={setOpen}>
+ <Dialog open={open} onOpenChange={setOpen}>
<DialogContent className="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>New project</DialogTitle>
diff --git a/flowsint-web/src/components/dashboard/new-sketch.tsx b/flowsint-web/src/components/dashboard/new-sketch.tsx
index 0257b495..ef848b72 100644
--- a/flowsint-web/src/components/dashboard/new-sketch.tsx
+++ b/flowsint-web/src/components/dashboard/new-sketch.tsx
@@ -47,7 +47,7 @@ export default function NewCase({ children, noDropDown = false }: { children: Re
router.push(`/dashboard/projects/${project_id}/investigations/${result.id}`)
setOpen(false)
} else {
- toast.error("Could not create new sketch.")
+ toast.error("Could not create new sketch." + JSON.stringify(result))
}
}
diff --git a/flowsint-web/src/components/investigations/investigation-navigation.tsx b/flowsint-web/src/components/investigations/investigation-navigation.tsx
index 3aea2832..2afd70d2 100644
--- a/flowsint-web/src/components/investigations/investigation-navigation.tsx
+++ b/flowsint-web/src/components/investigations/investigation-navigation.tsx
@@ -1,7 +1,7 @@
"use client"
import { cn } from "@/lib/utils"
-import { Users, TimerIcon, MapIcon, WaypointsIcon } from 'lucide-react'
+import { Users, TimerIcon, MapIcon, WaypointsIcon, TablePropertiesIcon } from 'lucide-react'
import Link from "next/link"
import { usePathname } from "next/navigation"
import { Fragment, memo, useMemo } from "react"
@@ -21,10 +21,10 @@ function InvestigationNavigation({ project_id, investigation_id }: { project_id:
icon: WaypointsIcon
},
{
- id: "individuals",
- name: "Individuals",
- href: `/dashboard/projects/${project_id}/investigations/${investigation_id}/individuals`,
- icon: Users,
+ id: "table",
+ name: "Table",
+ href: `/dashboard/projects/${project_id}/investigations/${investigation_id}/table`,
+ icon: TablePropertiesIcon,
},
{
id: "map",
@@ -48,7 +48,7 @@ function InvestigationNavigation({ project_id, investigation_id }: { project_id:
<Fragment key={section.id}>
{section.disabled ?
<span
- className="text-muted-foreground opacity-40 text-sm px-4 py-2 flex items-center gap-2">
+ className="text-muted-foreground border-b-2 border-transparent opacity-40 text-sm px-4 py-2 flex items-center gap-2">
<section.icon className="h-4 w-4" />
<span>{section.name}</span>
<Badge variant={"outline"}>Soon</Badge>
@@ -56,9 +56,9 @@ function InvestigationNavigation({ project_id, investigation_id }: { project_id:
<Link
href={section?.href || ""}
className={cn(
- "flex items-center text-sm gap-2 px-4 py-2 transition-colors",
+ "flex items-center text-sm gap-2 border-b-2 border-transparent px-4 py-2 transition-colors",
section?.href == pathname
- ? "bg-accent text-accent-foreground"
+ ? "bg-accent text-accent-foreground border-b-primary"
: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
)}
>
diff --git a/flowsint-web/src/components/investigations/panel-context-menu.tsx b/flowsint-web/src/components/investigations/panel-context-menu.tsx
index 0152373a..d95d0f8f 100644
--- a/flowsint-web/src/components/investigations/panel-context-menu.tsx
+++ b/flowsint-web/src/components/investigations/panel-context-menu.tsx
@@ -13,13 +13,13 @@ import { Badge } from "../ui/badge"
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle } from "../ui/dialog"
import { actionItems, type ActionItem } from "@/lib/action-items"
import { useInvestigationStore } from "@/store/investigation-store"
-import { CardContent } from "@/components/ui/card"
+import { Card, CardContent } from "@/components/ui/card"
import { AnimatePresence, motion } from "framer-motion"
export default function PanelContextMenu({ addNodes }: { addNodes: any }) {
const { investigation_id } = useParams()
const [openAddNodeModal, setOpenNodeModal] = useState(false)
- const [openActionDialog, setOpenActionDialog] = useState(false)
+ const [_, setOpenActionDialog] = useState(false)
const { setCurrentNode } = useInvestigationStore((state) => state)
const [currentNodeType, setCurrentNodeType] = useState<any | null>(null)
const [error, setError] = useState<string | null>(null)
@@ -189,21 +189,30 @@ function ActionCard({ item, onSelect }: ActionCardProps) {
const Icon = item.icon
return (
- <CardContent className="p-4 relative flex flex-col items-center text-center h-full">
- <div
- className="w-8 h-8 rounded-full flex items-center justify-center mb-3 mt-2"
- style={{ backgroundColor: `${item.color}20` }} // Light background based on item color
- >
- <Icon style={{ color: item.color }} className="h-6 w-6 opacity-60 text-primary" />
- </div>
- <div className="font-medium text-sm">{item.label}</div>
- {item.comingSoon && (
- <Badge variant="outline" className="mt-2 absolute top-2 left-2">
- soon
- </Badge>
+ <Card
+ className={cn(
+ "cursor-pointer transition-all hover:scale-105 hover:shadow-md",
+ item.disabled && "opacity-50 cursor-not-allowed",
+ "h-full",
)}
- {item.children && <div className="absolute top-3 right-4 text-xs text-muted-foreground mt-1"><ArrowRight className="h-4 w-4" /></div>}
- {item.children && <div className="text-xs text-muted-foreground mt-1">{item.children.length} options</div>}
- </CardContent>
+ onClick={item.disabled ? undefined : onSelect}
+ >
+ <CardContent className="p-4 relative flex flex-col items-center text-center h-full">
+ <div
+ className="w-8 h-8 rounded-full flex items-center justify-center mb-3 mt-2"
+ style={{ backgroundColor: `${item.color}20` }} // Light background based on item color
+ >
+ <Icon style={{ color: item.color }} className="h-6 w-6 opacity-60 text-primary" />
+ </div>
+ <div className="font-medium text-sm">{item.label}</div>
+ {item.comingSoon && (
+ <Badge variant="outline" className="mt-2 absolute top-2 left-2">
+ soon
+ </Badge>
+ )}
+ {item.children && <div className="absolute top-3 right-4 text-xs text-muted-foreground mt-1"><ArrowRight className="h-4 w-4" /></div>}
+ {item.children && <div className="text-xs text-muted-foreground mt-1">{item.children.length} options</div>}
+ </CardContent>
+ </Card>
)
}
diff --git a/flowsint-web/src/components/investigations/sketch/floating-edge.tsx b/flowsint-web/src/components/investigations/sketch/floating-edge.tsx
index e5156b23..040e352b 100644
--- a/flowsint-web/src/components/investigations/sketch/floating-edge.tsx
+++ b/flowsint-web/src/components/investigations/sketch/floating-edge.tsx
@@ -36,7 +36,7 @@ function FloatingEdge({
// Mémorisation du calcul du chemin et des coordonnées du label
const pathData = useMemo(() => {
const { sx, sy, tx, ty } = edgeParameters
- return getBezierPath({
+ return getStraightPath({
sourceX: sx,
sourceY: sy,
targetX: tx,
diff --git a/flowsint-web/src/components/investigations/sketch/graph.tsx b/flowsint-web/src/components/investigations/sketch/graph.tsx
index 2d6eaa7a..ff1777bc 100644
--- a/flowsint-web/src/components/investigations/sketch/graph.tsx
+++ b/flowsint-web/src/components/investigations/sketch/graph.tsx
@@ -226,25 +226,21 @@ const LayoutFlow = memo(({ refetch, theme }: any) => {
// Handle current node changes
useEffect(() => {
if (!currentNode) return;
-
const internalNode = getNode(currentNode.id);
if (!internalNode) return;
-
updateNode(internalNode.id, {
...internalNode,
zIndex: 5000,
data: { ...internalNode.data, forceToolbarVisible: true },
style: { ...internalNode.style, opacity: 1 },
});
-
const nodeWidth = internalNode.measured?.width ?? 0;
const nodeHeight = internalNode.measured?.height ?? 0;
-
setCenter(
internalNode.position.x + nodeWidth / 2,
internalNode.position.y + nodeHeight / 2 + 20,
{
- duration: 1000,
+ duration: 500,
zoom: 1.5,
}
);
@@ -364,7 +360,7 @@ const LayoutFlow = memo(({ refetch, theme }: any) => {
</TooltipProvider>
</ResizablePanel>
<ResizableHandle withHandle />
- <ResizablePanel defaultSize={20} minSize={15} className="h-full bg-background">
+ <ResizablePanel defaultSize={20} minSize={15} maxSize={40} className="h-full bg-background">
<ResizablePanelGroup autoSaveId="conditional" direction="vertical">
{currentNode && (
<>
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/custom-node.tsx b/flowsint-web/src/components/investigations/sketch/nodes/custom-node.tsx
index 3951cf53..8472cef5 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes/custom-node.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes/custom-node.tsx
@@ -36,7 +36,7 @@ export default memo(({ data, selected }: any) => {
</div>
</TooltipTrigger>
{!showNodeLabel &&
- <TooltipContent selected={active} position={Position.Top}>{data.label}</TooltipContent>
+ <TooltipContent selected={active} position={Position.Top}>{data.label}<CopyButton className="h-6 w-6" content={data.label} /></TooltipContent>
}
<Handle
type="target"
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx b/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx
index 898cefce..65588d85 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx
@@ -109,9 +109,10 @@ const NodeContextMenu = memo(({ x, y, onClose }: NodeContextMenuProps) => {
setEdges((edges: any[]) => edges.filter((edge: { source: any }) => edge.source !== currentNode?.id?.toString()))
onClose()
}
+ toast.success("Node deleted.")
}
catch (e) {
- toast.error("An error occured.")
+ toast.error("An error occured deleting the node.")
}
}
@@ -197,6 +198,17 @@ const NodeContextMenu = memo(({ x, y, onClose }: NodeContextMenuProps) => {
toast.error("Error creating new relation.")
}
}
+ // add organization to organization
+ else if ((nodeToInsert.type === "organization" && currentNode?.data?.type === "organization")) {
+ const { error: relationshipError } = await supabase.from("organizations_organizations").upsert({
+ organization_a: currentNode.id,
+ organization_b: nodeData.id,
+ investigation_id: investigation_id,
+ })
+ if (relationshipError) {
+ toast.error("Error creating new relation.")
+ }
+ }
const newNode = {
id: nodeData.id,
type: "custom",
diff --git a/flowsint-web/src/components/investigations/sketch/profile-panel.tsx b/flowsint-web/src/components/investigations/sketch/profile-panel.tsx
index 822dbab9..7a902390 100644
--- a/flowsint-web/src/components/investigations/sketch/profile-panel.tsx
+++ b/flowsint-web/src/components/investigations/sketch/profile-panel.tsx
@@ -86,10 +86,11 @@ function KeyValueDisplay({ data, className }: KeyValueDisplayProps) {
.filter(([key]) => !["id", "individual_id", "investigation_id", "group_id", "forceToolbarVisible"].includes(key))
.map(([key, value], index) => {
const val = Array.isArray(value) ? `${value.length} items` : value?.toString() || null
+ const display = (typeof val === "string" && val.startsWith("https://")) ? <a href={val} className="underline text-primary" target="_blank">{val}</a> : val
return (
<div key={index} className="flex w-full items-center border-b border-border divide-x divide-border">
<div className="w-1/2 bg-background px-4 p-2 text-sm text-muted-foreground font-normal">{key}</div>
- <div className="w-1/2 bg-background px-4 p-2 text-sm font-medium flex items-center justify-between"><div className="truncate font-semibold">{val || <span className="italic text-muted-foreground">N/A</span>}</div> <div>{val && <CopyButton className="h-6 w-6" content={val} />}</div></div>
+ <div className="w-1/2 bg-background px-4 p-2 text-sm font-medium flex items-center justify-between"><div className="truncate font-semibold">{display || <span className="italic text-muted-foreground">N/A</span>}</div> <div>{display && <CopyButton className="h-6 w-6" content={val} />}</div></div>
</div>
)
})}
diff --git a/flowsint-web/src/components/ui/tooltip-node.tsx b/flowsint-web/src/components/ui/tooltip-node.tsx
index 87e17183..71b0d812 100644
--- a/flowsint-web/src/components/ui/tooltip-node.tsx
+++ b/flowsint-web/src/components/ui/tooltip-node.tsx
@@ -63,7 +63,7 @@ export const TooltipContent = forwardRef<HTMLDivElement, TooltipContentProps & {
<div ref={ref}>
<NodeToolbar
isVisible={isTooltipVisible || selected}
- className="rounded-sm bg-background p-2 shadow-md"
+ className="rounded-sm bg-background p-2 shadow-md flex items-center gap-1"
tabIndex={1}
position={position}
>
diff --git a/flowsint-web/src/lib/action-items.ts b/flowsint-web/src/lib/action-items.ts
index 55981a39..98dd9ee8 100644
--- a/flowsint-web/src/lib/action-items.ts
+++ b/flowsint-web/src/lib/action-items.ts
@@ -89,7 +89,7 @@ export const actionItems: ActionItem[] = [
icon: Phone,
label: "Phone number",
fields: ["phone_number"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 3,
@@ -99,7 +99,7 @@ export const actionItems: ActionItem[] = [
icon: MapPin,
label: "Physical address",
fields: ["address", "city", "country", "zip"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 4,
@@ -109,7 +109,7 @@ export const actionItems: ActionItem[] = [
icon: AtSign,
label: "Email address",
fields: ["email"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 5,
@@ -119,6 +119,7 @@ export const actionItems: ActionItem[] = [
icon: Locate,
label: "IP address",
fields: ["ip_address"],
+ size: "h-5 w-5"
},
{
id: 6,
@@ -139,7 +140,7 @@ export const actionItems: ActionItem[] = [
color: "#1d4ed8",
label: "Facebook",
fields: ["profile_url", "username", "platform:facebook"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 8,
@@ -150,7 +151,7 @@ export const actionItems: ActionItem[] = [
color: "#db2777",
label: "Instagram",
fields: ["profile_url", "username", "platform:instagram"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 9,
@@ -161,7 +162,7 @@ export const actionItems: ActionItem[] = [
color: "#0369a1",
label: "Telegram",
fields: ["profile_url", "username", "platform:telegram"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 10,
@@ -172,7 +173,7 @@ export const actionItems: ActionItem[] = [
color: "#3B45FC",
label: "Signal",
fields: ["profile_url", "username", "platform:signal"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 11,
@@ -183,7 +184,7 @@ export const actionItems: ActionItem[] = [
icon: Ghost,
label: "Snapchat",
fields: ["profile_url", "username", "platform:snapchat"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 12,
@@ -193,7 +194,7 @@ export const actionItems: ActionItem[] = [
icon: Github,
label: "Github",
fields: ["profile_url", "username", "platform:github"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 13,
@@ -205,7 +206,7 @@ export const actionItems: ActionItem[] = [
fields: ["profile_url", "username", "platform:coco"],
disabled: true,
comingSoon: true,
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 18,
@@ -216,7 +217,7 @@ export const actionItems: ActionItem[] = [
icon: Linkedin,
label: "LinkedIn",
fields: ["profile_url", "username", "platform:linkedin"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 19,
@@ -226,7 +227,7 @@ export const actionItems: ActionItem[] = [
icon: Twitter,
label: "Twitter",
fields: ["profile_url", "username", "platform:twitter"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 20,
@@ -236,7 +237,7 @@ export const actionItems: ActionItem[] = [
icon: Video,
label: "TikTok",
fields: ["profile_url", "username", "platform:tiktok"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 21,
@@ -247,7 +248,7 @@ export const actionItems: ActionItem[] = [
color: "#FF4B13",
label: "Reddit",
fields: ["profile_url", "username", "platform:reddit"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 22,
@@ -258,7 +259,7 @@ export const actionItems: ActionItem[] = [
color: "#525FEE",
label: "Discord",
fields: ["profile_url", "username", "platform:discord"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 2343,
@@ -269,7 +270,7 @@ export const actionItems: ActionItem[] = [
color: "#A96FFF",
label: "Twitch",
fields: ["profile_url", "username", "platform:twitch"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
],
},
@@ -290,7 +291,7 @@ export const actionItems: ActionItem[] = [
icon: Car,
label: "Car",
fields: ["plate", "model", "brand", "year", "type:car"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 16,
@@ -300,7 +301,7 @@ export const actionItems: ActionItem[] = [
icon: Bike,
label: "Motorcycle",
fields: ["plate", "model", "brand", "year", "type:motorcycle"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 17,
@@ -310,7 +311,7 @@ export const actionItems: ActionItem[] = [
icon: Sailboat,
label: "Boat",
fields: ["plate", "model", "brand", "year", "type:boat"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 23,
@@ -320,7 +321,7 @@ export const actionItems: ActionItem[] = [
icon: Plane,
label: "Aircraft",
fields: ["registration", "model", "manufacturer", "year", "type:aircraft"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
],
},
@@ -332,7 +333,7 @@ export const actionItems: ActionItem[] = [
icon: Globe,
label: "Website",
fields: ["url", "registration_date", "registrar", "ip_address"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 26,
@@ -342,7 +343,7 @@ export const actionItems: ActionItem[] = [
icon: FileIcon,
label: "Document",
fields: ["title", "author", "creation_date", "file_hash", "file_type"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 27,
@@ -361,7 +362,7 @@ export const actionItems: ActionItem[] = [
icon: Bitcoin,
label: "Crypto Wallet",
fields: ["address", "currency", "platform"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 29,
@@ -371,7 +372,7 @@ export const actionItems: ActionItem[] = [
icon: CreditCard,
label: "Bank Account",
fields: ["account_number", "bank_name", "iban", "bic"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 30,
@@ -381,7 +382,7 @@ export const actionItems: ActionItem[] = [
icon: ArrowRightLeft,
label: "Transaction",
fields: ["amount", "date", "sender", "recipient", "currency"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
],
},
@@ -393,7 +394,7 @@ export const actionItems: ActionItem[] = [
icon: Calendar,
label: "Event",
fields: ["name", "date", "location", "description", "participants"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
@@ -413,7 +414,7 @@ export const actionItems: ActionItem[] = [
icon: Smartphone,
label: "Phone",
fields: ["imei", "model", "manufacturer", "serial_number", "type:phone"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 34,
@@ -423,7 +424,7 @@ export const actionItems: ActionItem[] = [
icon: Laptop,
label: "Computer",
fields: ["mac_address", "model", "manufacturer", "serial_number", "type:computer"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 35,
@@ -433,7 +434,7 @@ export const actionItems: ActionItem[] = [
icon: Tablet,
label: "Tablet",
fields: ["imei", "model", "manufacturer", "serial_number", "type:tablet"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 36,
@@ -443,7 +444,7 @@ export const actionItems: ActionItem[] = [
icon: Wifi,
label: "IoT Device",
fields: ["mac_address", "model", "manufacturer", "serial_number", "type:iot"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
],
},
@@ -455,7 +456,7 @@ export const actionItems: ActionItem[] = [
icon: ImageIcon,
label: "Media",
fields: ["filename", "hash", "creation_date", "location", "exif_data"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 38,
@@ -465,7 +466,7 @@ export const actionItems: ActionItem[] = [
icon: GraduationCap,
label: "Education",
fields: ["institution", "degree", "field", "start_date", "end_date"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 39,
@@ -475,7 +476,7 @@ export const actionItems: ActionItem[] = [
icon: Users,
label: "Relationship",
fields: ["type", "entity_a", "entity_b", "start_date", "end_date", "description"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 40,
@@ -494,7 +495,7 @@ export const actionItems: ActionItem[] = [
icon: MessageSquare,
label: "Forum Post",
fields: ["forum", "username", "post_date", "post_content", "post_url", "type:forum_post"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 42,
@@ -504,7 +505,7 @@ export const actionItems: ActionItem[] = [
icon: MessageCircle,
label: "Comment",
fields: ["platform", "username", "comment_date", "comment_content", "comment_url", "type:comment"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 43,
@@ -514,7 +515,7 @@ export const actionItems: ActionItem[] = [
icon: ShoppingCart,
label: "Online Purchase",
fields: ["platform", "username", "purchase_date", "item", "price", "type:purchase"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
],
},
@@ -526,7 +527,7 @@ export const actionItems: ActionItem[] = [
icon: Footprints,
label: "Digital Footprint",
fields: ["platform", "username", "date_discovered", "data_type", "source_url"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 45,
@@ -536,7 +537,7 @@ export const actionItems: ActionItem[] = [
icon: Fingerprint,
label: "Biometric Data",
fields: ["type", "identifier", "date_collected", "source"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
{
id: 46,
@@ -546,6 +547,6 @@ export const actionItems: ActionItem[] = [
icon: Key,
label: "Credential",
fields: ["service", "username", "hash", "breach_date", "breach_source"],
- size: "h-6 w-6"
+ size: "h-5 w-5"
},
]
\ No newline at end of file
diff --git a/flowsint-web/src/lib/actions/projects.ts b/flowsint-web/src/lib/actions/projects.ts
index 2474c8d8..7d59fde5 100644
--- a/flowsint-web/src/lib/actions/projects.ts
+++ b/flowsint-web/src/lib/actions/projects.ts
@@ -15,8 +15,9 @@ export const createNewProject = async (formData: FormData) => {
try {
const { data: project, error } = await supabase.from("projects").insert({ ...data, owner_id: session?.user?.id }).select("id").single()
if (error) throw error
- revalidatePath("/")
- return { success: true, id: project.id }
+ const { data: folder, error: bucketError } = await supabase.storage.from('documents').upload(`${project.id}/placeholder`, '')
+ if (bucketError) throw bucketError
+ return { success: true, id: project.id, path: folder.path }
} catch (error) {
console.error("Error creating new project:", error)
return { success: false, error: "Failed to create new project." }
diff --git a/flowsint-web/src/lib/hooks/use-platform-icons.tsx b/flowsint-web/src/lib/hooks/use-platform-icons.tsx
index fd429111..2e9886c0 100644
--- a/flowsint-web/src/lib/hooks/use-platform-icons.tsx
+++ b/flowsint-web/src/lib/hooks/use-platform-icons.tsx
@@ -3,9 +3,10 @@ import { actionItems, type ActionItem } from "../action-items"
export const usePlatformIcons = () => {
return useMemo(() => {
- if (!actionItems[5]?.children)
+ const socials = actionItems.find((item) => item.type === "social")?.children
+ if (!socials)
return {};
- return actionItems[5].children.reduce((acc: Record<string, { icon: JSX.Element, color: string }>, item: ActionItem) => {
+ return socials.reduce((acc: Record<string, { icon: JSX.Element, color: string }>, item: ActionItem) => {
const platform = item.key.split("_")[2];
acc[platform] = {
icon: <item.icon style={{ color: item.color }} />,
diff --git a/flowsint-web/tsconfig.json b/flowsint-web/tsconfig.json
index c55af01b..c2556ed9 100644
--- a/flowsint-web/tsconfig.json
+++ b/flowsint-web/tsconfig.json
@@ -23,6 +23,6 @@
"@/*": ["./src/*"]
}
},
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "../../ReconOps/src/lib/utils.ts", "src/components/investigations/collide.js", "src/lib/utils/flow.js", "src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/individuals/page.tss"],
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "../../ReconOps/src/lib/utils.ts", "src/components/investigations/collide.js", "src/lib/utils/flow.js", "src/app/dashboard/projects/[project_id]/investigations/[investigation_id]/table/page.tss"],
"exclude": ["node_modules"]
}