From b43832fa8facb46ae6ea1968196ce2511045208d Mon Sep 17 00:00:00 2001 From: Pablo Lara Date: Tue, 8 Oct 2024 11:23:52 +0200 Subject: [PATCH] chore: menu tweaks --- app/(prowler)/providers/page.tsx | 2 +- components/auth/oss/auth-form.tsx | 2 +- components/providers/forms/add-form.tsx | 5 +- components/providers/radio-group-provider.tsx | 67 +++++++++++-------- components/ui/sidebar/index.ts | 10 +-- .../{SidebarItems.tsx => sidebar-items.tsx} | 22 +++--- .../sidebar/{Sidebar.tsx => sidebar-tmp.tsx} | 0 .../{SidebarWrap.tsx => sidebar-wrap.tsx} | 6 +- .../{TeamAvatar.tsx => team-avatar.tsx} | 0 .../{UserAvatar.tsx => user-avatar.tsx} | 0 10 files changed, 66 insertions(+), 48 deletions(-) rename components/ui/sidebar/{SidebarItems.tsx => sidebar-items.tsx} (97%) rename components/ui/sidebar/{Sidebar.tsx => sidebar-tmp.tsx} (100%) rename components/ui/sidebar/{SidebarWrap.tsx => sidebar-wrap.tsx} (98%) rename components/ui/sidebar/{TeamAvatar.tsx => team-avatar.tsx} (100%) rename components/ui/sidebar/{UserAvatar.tsx => user-avatar.tsx} (100%) diff --git a/app/(prowler)/providers/page.tsx b/app/(prowler)/providers/page.tsx index b999671859..7ff10fbb5e 100644 --- a/app/(prowler)/providers/page.tsx +++ b/app/(prowler)/providers/page.tsx @@ -43,7 +43,7 @@ const SSRDataTable = async ({ searchParams: SearchParamsProps; }) => { const page = parseInt(searchParams.page?.toString() || "1", 10); - const sort = searchParams.sort?.toString() || "-inserted_at"; + const sort = searchParams.sort?.toString(); // Extract all filter parameters const filters = Object.fromEntries( diff --git a/components/auth/oss/auth-form.tsx b/components/auth/oss/auth-form.tsx index 451e043c0b..2f4e3700a7 100644 --- a/components/auth/oss/auth-form.tsx +++ b/components/auth/oss/auth-form.tsx @@ -116,7 +116,7 @@ export const AuthForm = ({ type }: { type: string }) => { {/* Background Pattern */}
-
+
{/* Prowler Logo */}
diff --git a/components/providers/forms/add-form.tsx b/components/providers/forms/add-form.tsx index 4c063c7aef..c721a709c0 100644 --- a/components/providers/forms/add-form.tsx +++ b/components/providers/forms/add-form.tsx @@ -67,7 +67,10 @@ export const AddForm = ({ onSubmit={form.handleSubmit(onSubmitClient)} className="flex flex-col space-y-4" > - + = (props) => { const { Component, children, - description, + // description, getBaseProps, getWrapperProps, getInputProps, @@ -37,7 +37,7 @@ export const CustomRadio: React.FC = (props) => { className={cn( "group inline-flex flex-row-reverse items-center justify-between tap-highlight-transparent hover:opacity-70 active:opacity-50", "max-w-full cursor-pointer gap-4 rounded-lg border-2 border-default p-4", - "data-[selected=true]:border-primary", + "data-[selected=true]:border-primar w-full", )} > @@ -48,11 +48,11 @@ export const CustomRadio: React.FC = (props) => {
{children && {children}} - {description && ( + {/* {description && ( {description} - )} + )} */}
); @@ -60,10 +60,12 @@ export const CustomRadio: React.FC = (props) => { interface RadioGroupProviderProps { control: Control>; + isInvalid: boolean; } export const RadioGroupProvider: React.FC = ({ control, + isInvalid, }) => { return ( = ({ control={control} render={({ field }) => ( <> - - -
- - AWS -
-
- -
- - GCP -
-
- -
- - Azure -
-
- -
- - Kubernetes -
-
+ +
+ +
+ + AWS +
+
+ +
+ + GCP +
+
+ +
+ + Azure +
+
+ +
+ + Kubernetes +
+
+
diff --git a/components/ui/sidebar/index.ts b/components/ui/sidebar/index.ts index ec61cb2f3b..a12c0b800d 100644 --- a/components/ui/sidebar/index.ts +++ b/components/ui/sidebar/index.ts @@ -1,5 +1,5 @@ -export * from "./Sidebar"; -export * from "./SidebarItems"; -export * from "./SidebarWrap"; -export * from "./TeamAvatar"; -export * from "./UserAvatar"; +export * from "./sidebar-items"; +export * from "./sidebar-tmp"; +export * from "./sidebar-wrap"; +export * from "./team-avatar"; +export * from "./user-avatar"; diff --git a/components/ui/sidebar/SidebarItems.tsx b/components/ui/sidebar/sidebar-items.tsx similarity index 97% rename from components/ui/sidebar/SidebarItems.tsx rename to components/ui/sidebar/sidebar-items.tsx index 497d29544a..dc0ab7b790 100644 --- a/components/ui/sidebar/SidebarItems.tsx +++ b/components/ui/sidebar/sidebar-items.tsx @@ -1,8 +1,8 @@ import { Icon } from "@iconify/react"; import { Chip } from "@nextui-org/react"; -import { SidebarItem, SidebarItemType } from "./Sidebar"; -import { TeamAvatar } from "./TeamAvatar"; +import { SidebarItem, SidebarItemType } from "./sidebar-tmp"; +import { TeamAvatar } from "./team-avatar"; /** * Please check the https://nextui.org/docs/guide/routing to have a seamless router integration @@ -119,6 +119,12 @@ export const sectionItems: SidebarItem[] = [ key: "scan", title: "Scan", items: [ + { + key: "scanners", + href: "#", + icon: "lucide:scan-search", + title: "Scanners", + }, { key: "findings", href: "/findings", @@ -142,12 +148,6 @@ export const sectionItems: SidebarItem[] = [ }, ], }, - { - key: "tasks", - href: "#", - icon: "solar:checklist-minimalistic-outline", - title: "Tasks", - }, ], }, { @@ -206,6 +206,12 @@ export const sectionItemsWithTeams: SidebarItem[] = [ title: "Users", icon: "ci:users", }, + { + key: "tasks", + href: "#", + icon: "solar:checklist-minimalistic-outline", + title: "Tasks", + }, // { // key: "memberships", // href: "#", diff --git a/components/ui/sidebar/Sidebar.tsx b/components/ui/sidebar/sidebar-tmp.tsx similarity index 100% rename from components/ui/sidebar/Sidebar.tsx rename to components/ui/sidebar/sidebar-tmp.tsx diff --git a/components/ui/sidebar/SidebarWrap.tsx b/components/ui/sidebar/sidebar-wrap.tsx similarity index 98% rename from components/ui/sidebar/SidebarWrap.tsx rename to components/ui/sidebar/sidebar-wrap.tsx index 08204b3392..ceacc5d3e1 100644 --- a/components/ui/sidebar/SidebarWrap.tsx +++ b/components/ui/sidebar/sidebar-wrap.tsx @@ -17,9 +17,9 @@ import { ProwlerShort, } from "../../icons/prowler/ProwlerIcons"; import { ThemeSwitch } from "../../ThemeSwitch"; -import Sidebar from "./Sidebar"; -import { sectionItemsWithTeams } from "./SidebarItems"; -import { UserAvatar } from "./UserAvatar"; +import Sidebar from "./sidebar-tmp"; +import { sectionItemsWithTeams } from "./sidebar-items"; +import { UserAvatar } from "./user-avatar"; export const SidebarWrap = () => { const pathname = usePathname(); diff --git a/components/ui/sidebar/TeamAvatar.tsx b/components/ui/sidebar/team-avatar.tsx similarity index 100% rename from components/ui/sidebar/TeamAvatar.tsx rename to components/ui/sidebar/team-avatar.tsx diff --git a/components/ui/sidebar/UserAvatar.tsx b/components/ui/sidebar/user-avatar.tsx similarity index 100% rename from components/ui/sidebar/UserAvatar.tsx rename to components/ui/sidebar/user-avatar.tsx