mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 13:01:56 +00:00
fix: resolve merge conflicts in UI components and menu
This commit is contained in:
@@ -2,12 +2,10 @@
|
||||
|
||||
import { ColumnDef, RowSelectionState } from "@tanstack/react-table";
|
||||
import { Database } from "lucide-react";
|
||||
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
|
||||
import {
|
||||
DataTableRowActions,
|
||||
FindingDetail,
|
||||
} from "@/components/findings/table";
|
||||
import { FindingDetail } from "@/components/findings/table";
|
||||
import { DataTableRowActions } from "@/components/findings/table";
|
||||
import { Checkbox } from "@/components/shadcn";
|
||||
import { DateWithTime, SnippetChip } from "@/components/ui/entities";
|
||||
import {
|
||||
@@ -50,60 +48,17 @@ const getProviderData = (
|
||||
);
|
||||
};
|
||||
|
||||
<<<<<<< HEAD
|
||||
const FindingDetailsCell = ({ row }: { row: { original: FindingProps } }) => {
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const searchParams = useSearchParams();
|
||||
const findingIdFromUrl = searchParams.get("id");
|
||||
|
||||
// If there's an id in the URL, the sheet is controlled by FindingDetailsSheet component
|
||||
// so we don't open a local sheet for any row
|
||||
const isUrlControlled = !!findingIdFromUrl;
|
||||
=======
|
||||
// Component for finding title that opens the detail drawer
|
||||
const FindingTitleCell = ({ row }: { row: { original: FindingProps } }) => {
|
||||
const searchParams = useSearchParams();
|
||||
const findingId = searchParams.get("id");
|
||||
const isOpen = findingId === row.original.id;
|
||||
const { checktitle } = row.original.attributes.check_metadata;
|
||||
>>>>>>> 1bf49747adaefcb19db66274478f6933342112c1
|
||||
|
||||
const handleOpenChange = (open: boolean) => {
|
||||
const params = new URLSearchParams(searchParams.toString());
|
||||
|
||||
if (open) {
|
||||
params.set("id", row.original.id);
|
||||
} else {
|
||||
params.delete("id");
|
||||
}
|
||||
|
||||
router.push(`${pathname}?${params.toString()}`, { scroll: false });
|
||||
};
|
||||
|
||||
return (
|
||||
<<<<<<< HEAD
|
||||
<div className="flex max-w-10 justify-center">
|
||||
<TriggerSheet
|
||||
triggerComponent={
|
||||
<InfoIcon className="text-button-primary" size={16} />
|
||||
}
|
||||
title="Finding Details"
|
||||
description="View the finding details"
|
||||
open={isUrlControlled ? false : undefined}
|
||||
onOpenChange={handleOpenChange}
|
||||
>
|
||||
<DataTableRowDetails
|
||||
entityId={row.original.id}
|
||||
findingDetails={row.original}
|
||||
/>
|
||||
</TriggerSheet>
|
||||
</div>
|
||||
=======
|
||||
<FindingDetail
|
||||
findingDetails={row.original}
|
||||
defaultOpen={isOpen}
|
||||
onOpenChange={handleOpenChange}
|
||||
trigger={
|
||||
<div className="max-w-[500px]">
|
||||
<p className="text-text-neutral-primary hover:text-button-tertiary cursor-pointer text-left text-sm break-words whitespace-normal hover:underline">
|
||||
@@ -112,7 +67,6 @@ const FindingTitleCell = ({ row }: { row: { original: FindingProps } }) => {
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
>>>>>>> 1bf49747adaefcb19db66274478f6933342112c1
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
"use client";
|
||||
|
||||
<<<<<<< HEAD
|
||||
import { ExternalLink, Link } from "lucide-react";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
|
||||
import {
|
||||
Card,
|
||||
CardAction,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
=======
|
||||
import { Snippet } from "@heroui/snippet";
|
||||
import { ExternalLink, Link, X } from "lucide-react";
|
||||
import { usePathname, useSearchParams } from "next/navigation";
|
||||
import type { ReactNode } from "react";
|
||||
@@ -30,7 +18,6 @@ import {
|
||||
TabsContent,
|
||||
TabsList,
|
||||
TabsTrigger,
|
||||
>>>>>>> 1bf49747adaefcb19db66274478f6933342112c1
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
@@ -122,27 +109,6 @@ export const FindingDetail = ({
|
||||
const content = (
|
||||
<div className="flex min-w-0 flex-col gap-4 rounded-lg">
|
||||
{/* Header */}
|
||||
<<<<<<< HEAD
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h2 className="dark:text-prowler-theme-pale/90 line-clamp-2 flex items-center gap-2 text-lg leading-tight font-medium text-gray-800">
|
||||
{renderValue(attributes.check_metadata.checktitle)}
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<button
|
||||
onClick={() => navigator.clipboard.writeText(url)}
|
||||
className="text-text-info inline-flex cursor-pointer transition-opacity hover:opacity-80"
|
||||
aria-label="Copy finding link to clipboard"
|
||||
>
|
||||
<Link size={16} />
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Copy finding link to clipboard</TooltipContent>
|
||||
</Tooltip>
|
||||
</h2>
|
||||
</div>
|
||||
<div className="flex items-center gap-x-4">
|
||||
=======
|
||||
<div className="flex flex-col gap-2">
|
||||
{/* Row 1: Status badges */}
|
||||
<div className="flex flex-wrap items-center gap-4">
|
||||
@@ -156,7 +122,6 @@ export const FindingDetail = ({
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
>>>>>>> 1bf49747adaefcb19db66274478f6933342112c1
|
||||
<Muted
|
||||
isMuted={attributes.muted}
|
||||
mutedReason={attributes.muted_reason || ""}
|
||||
@@ -341,29 +306,18 @@ export const FindingDetail = ({
|
||||
{/* Resources Tab */}
|
||||
<TabsContent value="resources" className="flex flex-col gap-4">
|
||||
{providerDetails.provider === "iac" && gitUrl && (
|
||||
<<<<<<< HEAD
|
||||
<CardAction>
|
||||
=======
|
||||
<div className="flex justify-end">
|
||||
>>>>>>> 1bf49747adaefcb19db66274478f6933342112c1
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<a
|
||||
href={gitUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
<<<<<<< HEAD
|
||||
className="text-text-info inline-flex cursor-pointer"
|
||||
aria-label="Open resource in repository"
|
||||
>
|
||||
<ExternalLink size={16} className="inline" />
|
||||
=======
|
||||
className="text-bg-data-info inline-flex items-center gap-1 text-sm"
|
||||
aria-label="Open resource in repository"
|
||||
>
|
||||
<ExternalLink size={16} />
|
||||
View in Repository
|
||||
>>>>>>> 1bf49747adaefcb19db66274478f6933342112c1
|
||||
</a>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
import { Chip } from "@heroui/chip";
|
||||
<<<<<<< HEAD
|
||||
import clsx from "clsx";
|
||||
=======
|
||||
>>>>>>> 1bf49747adaefcb19db66274478f6933342112c1
|
||||
|
||||
import { SpinnerIcon } from "@/components/icons";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
<<<<<<< HEAD
|
||||
const STATUS = {
|
||||
available: "available",
|
||||
scheduled: "scheduled",
|
||||
executing: "executing",
|
||||
completed: "completed",
|
||||
failed: "failed",
|
||||
cancelled: "cancelled",
|
||||
} as const;
|
||||
|
||||
export type Status = (typeof STATUS)[keyof typeof STATUS];
|
||||
=======
|
||||
export type Status =
|
||||
| "available"
|
||||
| "queued"
|
||||
@@ -27,7 +11,6 @@ export type Status =
|
||||
| "completed"
|
||||
| "failed"
|
||||
| "cancelled";
|
||||
>>>>>>> 1bf49747adaefcb19db66274478f6933342112c1
|
||||
|
||||
const statusDisplayMap: Record<Status, string> = {
|
||||
available: "Queued",
|
||||
@@ -52,15 +35,6 @@ const statusColorMap: Record<
|
||||
cancelled: "danger",
|
||||
};
|
||||
|
||||
const statusDisplayMap: Record<Status, string> = {
|
||||
available: "queued",
|
||||
scheduled: "scheduled",
|
||||
executing: "executing",
|
||||
completed: "completed",
|
||||
failed: "failed",
|
||||
cancelled: "cancelled",
|
||||
};
|
||||
|
||||
export const StatusBadge = ({
|
||||
status,
|
||||
size = "sm",
|
||||
@@ -97,13 +71,7 @@ export const StatusBadge = ({
|
||||
<span>executing</span>
|
||||
</div>
|
||||
) : (
|
||||
<<<<<<< HEAD
|
||||
<span className="flex items-center justify-center">{displayLabel}</span>
|
||||
=======
|
||||
<span className="flex items-center justify-center">
|
||||
{statusDisplayMap[status as keyof typeof statusDisplayMap] || status}
|
||||
</span>
|
||||
>>>>>>> 1bf49747adaefcb19db66274478f6933342112c1
|
||||
)}
|
||||
</Chip>
|
||||
);
|
||||
|
||||
@@ -71,7 +71,6 @@ export const getMenuList = ({ pathname }: MenuListOptions): GroupProps[] => {
|
||||
groupLabel: "",
|
||||
menus: [
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
href: "/attack-paths",
|
||||
label: "Attack Paths",
|
||||
icon: GitBranch,
|
||||
@@ -85,10 +84,7 @@ export const getMenuList = ({ pathname }: MenuListOptions): GroupProps[] => {
|
||||
groupLabel: "",
|
||||
menus: [
|
||||
{
|
||||
href: "/findings",
|
||||
=======
|
||||
href: "/findings?filter[muted]=false",
|
||||
>>>>>>> 1bf49747adaefcb19db66274478f6933342112c1
|
||||
label: "Findings",
|
||||
icon: Tag,
|
||||
},
|
||||
|
||||
Generated
-26171
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user