Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions app/next-client-app/app/(protected)/scanreports/[id]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
getScanReport,
getScanReportPermissions,
} from "@/api/scanreports";
import { getScanReport, getScanReportPermissions } from "@/api/scanreports";
import { Forbidden } from "@/components/core/Forbidden";
import { NavGroup } from "@/components/core/nav-group";
import DeleteDialog from "@/components/scanreports/DeleteDialog";
Expand All @@ -14,7 +11,7 @@ import {
DropdownMenuContent,
DropdownMenuTrigger,
DropdownMenuSeparator,
DropdownMenuLabel
DropdownMenuLabel,
} from "@/components/ui/dropdown-menu";
import { Suspense } from "react";
import { Skeleton } from "@/components/ui/skeleton";
Expand All @@ -28,7 +25,11 @@ import { UploadStatusOptions } from "@/constants/scanReportStatus";
import ExportScanReport from "@/components/scanreports/ExportScanReport";
import { ActionsDownloadMenu } from "./actions-download-menu";

export async function generateMetadata({ params }: { params: Promise<{ id: string }> }) {
export async function generateMetadata({
params,
}: {
params: Promise<{ id: string }>;
}) {
const resolvedParams = await params;
const scanreport = await getScanReport(resolvedParams.id);
return {
Expand All @@ -39,7 +40,7 @@ export async function generateMetadata({ params }: { params: Promise<{ id: strin

export default async function ScanReportLayout(
props: Readonly<{
params: { id: string };
params: Promise<{ id: string }>;
children: React.ReactNode;
}>
) {
Expand All @@ -57,11 +58,11 @@ export default async function ScanReportLayout(
{
name: "Tables",
iconName: "TableProperties",
matchPrefixes: ["tables"]
matchPrefixes: ["tables"],
},
{ name: "Rules", slug: "mapping_rules", iconName: "Waypoints" },
{ name: "Review Rules", slug: "review_rules", iconName: "SearchCheck" },
{ name: "Downloads", slug: "downloads", iconName: "Download" }
{ name: "Downloads", slug: "downloads", iconName: "Download" },
];

{
Expand All @@ -71,7 +72,7 @@ export default async function ScanReportLayout(
items.push({
name: "Edit Details",
slug: "details",
iconName: "Edit"
iconName: "Edit",
});
}

Expand Down Expand Up @@ -144,25 +145,28 @@ export default async function ScanReportLayout(
}
/>
</div>

</div>
<div className="hidden md:flex flex-col md:flex-row md:items-center h-7 text-sm space-y-2 md:space-y-0 divide-y md:divide-y-0 md:divide-x">
<div className="flex items-center gap-2 text-muted-foreground">
Members:{" "}
<AvatarList
members={[scanreport.author, ...scanreport.viewers, ...scanreport.editors].filter(
(member, index, self) =>
index === self.findIndex((m) => m.id === member.id)
)}
/>
Members:{" "}
<AvatarList
members={[
scanreport.author,
...scanreport.viewers,
...scanreport.editors,
].filter(
(member, index, self) =>
index === self.findIndex((m) => m.id === member.id)
)}
/>
</div>
</div>
{/* "Navs" group */}
<div className="flex flex-col md:flex-row justify-between mt-6 md:mt-0">
<div>
<NavGroup
path={`/scanreports/${params.id}`}
items={items.map(x => ({ ...x, text: x.name }))}
path={`/scanreports/${params.id}`}
items={items.map((x) => ({ ...x, text: x.name }))}
/>
</div>

Expand Down
20 changes: 10 additions & 10 deletions app/next-client-app/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";

import { cn } from "@/lib/utils"
import { cn } from "@/lib/utils";

const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:cursor-pointer",
{
variants: {
variant: {
Expand Down Expand Up @@ -33,7 +33,7 @@ const buttonVariants = cva(
size: "default",
},
}
)
);

function Button({
className,
Expand All @@ -43,17 +43,17 @@ function Button({
...props
}: React.ComponentProps<"button"> &
VariantProps<typeof buttonVariants> & {
asChild?: boolean
asChild?: boolean;
}) {
const Comp = asChild ? Slot : "button"
const Comp = asChild ? Slot : "button";

return (
<Comp
data-slot="button"
className={cn(buttonVariants({ variant, size, className }))}
{...props}
/>
)
);
}

export { Button, buttonVariants }
export { Button, buttonVariants };
1 change: 1 addition & 0 deletions app/next-client-app/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Loading