diff --git a/.eslintrc.cjs b/.eslintrc.cjs index c9f6d992bf..04f90c81d7 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -10,6 +10,7 @@ module.exports = { "plugin:@typescript-eslint/recommended", "plugin:security/recommended-legacy", "plugin:jsx-a11y/recommended", + "eslint-config-prettier", "prettier", ], parserOptions: { diff --git a/.prettierrc.json b/.prettierrc.json index 15d19325bb..0cbbafa6cc 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -5,5 +5,6 @@ "tabWidth": 2, "useTabs": false, "semi": true, - "printWidth": 80 + "printWidth": 80, + "plugins": ["prettier-plugin-tailwindcss"] } diff --git a/app/(prowler)/error.tsx b/app/(prowler)/error.tsx index 3719b239e3..980e681220 100644 --- a/app/(prowler)/error.tsx +++ b/app/(prowler)/error.tsx @@ -20,7 +20,7 @@ export default function Error({ }, [error]); return ( - + An unexpected error occurred diff --git a/app/(prowler)/findings/page.tsx b/app/(prowler)/findings/page.tsx index 5ef11d41ed..280ecf293b 100644 --- a/app/(prowler)/findings/page.tsx +++ b/app/(prowler)/findings/page.tsx @@ -13,7 +13,7 @@ export default async function Findings() { <>
-
+
}> diff --git a/app/(prowler)/layout.tsx b/app/(prowler)/layout.tsx index ebf66c7975..ea8d1f13bc 100644 --- a/app/(prowler)/layout.tsx +++ b/app/(prowler)/layout.tsx @@ -44,9 +44,9 @@ export default function RootLayout({ )} > -
+
-
+
{children}
diff --git a/app/(prowler)/users/page.tsx b/app/(prowler)/users/page.tsx index a7f643d73b..0a2f240f57 100644 --- a/app/(prowler)/users/page.tsx +++ b/app/(prowler)/users/page.tsx @@ -29,7 +29,7 @@ export default async function Users({ <>
-
+
diff --git a/components/ThemeSwitch.tsx b/components/ThemeSwitch.tsx index 1e581560ae..d397c4a678 100644 --- a/components/ThemeSwitch.tsx +++ b/components/ThemeSwitch.tsx @@ -57,7 +57,7 @@ export const ThemeSwitch: FC = ({ className={slots.wrapper({ class: clsx( [ - "w-auto h-auto", + "h-auto w-auto", "bg-transparent", "rounded-lg", "flex items-center justify-center", diff --git a/components/auth/AuthForm.tsx b/components/auth/AuthForm.tsx index 11176f0aab..b1bbcb866a 100644 --- a/components/auth/AuthForm.tsx +++ b/components/auth/AuthForm.tsx @@ -74,7 +74,7 @@ export const AuthForm = ({ type }: { type: string }) => { > {/* Brand Logo and ThemeSwitch */}
-
+
@@ -82,7 +82,7 @@ export const AuthForm = ({ type }: { type: string }) => { {/* Testimonial */}
-

+

Open Cloud Security diff --git a/components/charts/StatusChart.tsx b/components/charts/StatusChart.tsx index 7ac851ccf8..d906db502e 100644 --- a/components/charts/StatusChart.tsx +++ b/components/charts/StatusChart.tsx @@ -55,7 +55,7 @@ export function StatusChart() { }, []); return ( -

+
-
+
-
+
{updatedChartData[1].percent}
-
+
+2 findings from last scan
diff --git a/components/compliance/ComplianceCard.tsx b/components/compliance/ComplianceCard.tsx index 32e8004377..41cd740a73 100644 --- a/components/compliance/ComplianceCard.tsx +++ b/components/compliance/ComplianceCard.tsx @@ -50,15 +50,15 @@ export const ComplianceCard: React.FC = ({ return ( - -
+ +
{`${title} -
-

{title}

+
+

{title}

= ({ className="mt-2 font-semibold" color={getRatingColor(ratingPercentage)} /> -
+
- + {passingRequirements} / {totalRequirements} Passing Requirements diff --git a/components/compliance/ComplianceSkeletonGrid.tsx b/components/compliance/ComplianceSkeletonGrid.tsx index c16d3edca9..54ec78ce26 100644 --- a/components/compliance/ComplianceSkeletonGrid.tsx +++ b/components/compliance/ComplianceSkeletonGrid.tsx @@ -3,8 +3,8 @@ import React from "react"; export const ComplianceSkeletonGrid = () => { return ( - -
+ +
{[...Array(28)].map((_, index) => (
diff --git a/components/filters/custo-checkbox-muted-findings.tsx b/components/filters/custo-checkbox-muted-findings.tsx index 0ebfcb7755..a5e52b3d92 100644 --- a/components/filters/custo-checkbox-muted-findings.tsx +++ b/components/filters/custo-checkbox-muted-findings.tsx @@ -3,7 +3,12 @@ import React from "react"; export const CustomCheckboxMutedFindings = () => { return ( - + Include Muted Findings ); diff --git a/components/filters/custom-account-selection.tsx b/components/filters/custom-account-selection.tsx index d09052ad4d..f9920a988f 100644 --- a/components/filters/custom-account-selection.tsx +++ b/components/filters/custom-account-selection.tsx @@ -18,6 +18,7 @@ export const CustomAccountSelection = () => { return ( { return ( { +export const CustomSelectProvider: React.FC = () => { const router = useRouter(); const searchParams = useSearchParams(); - const [selectedProvider, setSelectedProvider] = useState(""); const applyProviderFilter = useCallback( (value: string) => { @@ -52,38 +51,39 @@ export const CustomSelectProvider = () => { [router, searchParams], ); - useEffect(() => { - const providerFromUrl = searchParams.get("filter[provider__in]") || ""; - setSelectedProvider(providerFromUrl); - }, [searchParams]); + const currentProvider = searchParams.get("filter[provider__in]") || ""; + + const selectedKeys = useMemo(() => { + return dataInputsProvider.some( + (provider) => provider.key === currentProvider, + ) + ? [currentProvider] + : []; + }, [currentProvider]); return ( diff --git a/components/filters/data-filters.ts b/components/filters/data-filters.ts index eb05d0dc5e..9aea8e9dd3 100644 --- a/components/filters/data-filters.ts +++ b/components/filters/data-filters.ts @@ -6,7 +6,7 @@ export const filtersProviders = [ }, { key: "connected", - labelCheckboxGroup: "Status provider", + labelCheckboxGroup: "Connection", values: ["false", "true"], }, // Add more filter categories as needed diff --git a/components/filters/filter-controls.tsx b/components/filters/filter-controls.tsx index 12e2cca17c..19053cb62b 100644 --- a/components/filters/filter-controls.tsx +++ b/components/filters/filter-controls.tsx @@ -47,7 +47,7 @@ export const FilterControls: React.FC = ({ return (
-
+
{search && } {providers && } {date && } @@ -57,7 +57,8 @@ export const FilterControls: React.FC = ({ {showClearButton && ( = ({ selectedRow }) => { className={clsx( "max-h-[calc(100vh-146px)] overflow-y-auto rounded-md border bg-background transition-all duration-300", { - "w-1/3 translate-x-0 ml-2 p-3 opacity-100": selectedRow, - "translate-x-full w-0 opacity-0": !selectedRow, + "ml-2 w-1/3 translate-x-0 p-3 opacity-100": selectedRow, + "w-0 translate-x-full opacity-0": !selectedRow, }, )} > -

{CheckTitle}

+

{CheckTitle}

= ({ }) => { return ( <> -

{title}

+

{title}

{url ? ( {description} diff --git a/components/findings/FindingsCardDetail.tsx b/components/findings/FindingsCardDetail.tsx index 5b3ffc59bd..957cc6809e 100644 --- a/components/findings/FindingsCardDetail.tsx +++ b/components/findings/FindingsCardDetail.tsx @@ -34,9 +34,9 @@ export const FindingsCardDetail: React.FC = ({ <> {description && (
-

+

{title} {url && ( -

+
- + Select All - {allFilterKeys.map((value) => ( - - {value} - - ))} + + + {allFilterKeys.map((value) => ( + + {_.capitalize(value)} + + ))} +
- {groupSelected?.size > 0 && ( -

- Selected:{" "} - {Array.from(groupSelected) - .filter((item) => item !== "all") - .join(", ")} -

- )}
); }; diff --git a/components/ui/custom/index.ts b/components/ui/custom/index.ts index dc543cb6ca..3b8bd9f162 100644 --- a/components/ui/custom/index.ts +++ b/components/ui/custom/index.ts @@ -1,7 +1,7 @@ +export * from "./custom-button"; export * from "./custom-dropdown-filter"; export * from "./CustomAlertModal"; export * from "./CustomBox"; -export * from "./CustomButton"; export * from "./CustomButtonClientAction"; export * from "./CustomInput"; export * from "./CustomLoader"; diff --git a/components/ui/dialog/dialog.tsx b/components/ui/dialog/dialog.tsx index 93542df32f..8ef88c0487 100644 --- a/components/ui/dialog/dialog.tsx +++ b/components/ui/dialog/dialog.tsx @@ -21,7 +21,7 @@ const DialogOverlay = React.forwardRef< {children} - + Close @@ -102,7 +102,7 @@ const DialogDescription = React.forwardRef< >(({ className, ...props }, ref) => ( )); diff --git a/components/ui/dropdown/Dropdown.tsx b/components/ui/dropdown/Dropdown.tsx index b88da41b59..a5376204cf 100644 --- a/components/ui/dropdown/Dropdown.tsx +++ b/components/ui/dropdown/Dropdown.tsx @@ -27,7 +27,7 @@ const DropdownMenuSubTrigger = React.forwardRef< (({ className, ...props }, ref) => ( )); diff --git a/components/ui/header/Header.tsx b/components/ui/header/Header.tsx index 900db419bb..b7ccefaf7b 100644 --- a/components/ui/header/Header.tsx +++ b/components/ui/header/Header.tsx @@ -12,7 +12,7 @@ export const Header: React.FC = ({ title, icon }) => { <>
-

{title}

+

{title}

diff --git a/components/ui/select/Select.tsx b/components/ui/select/Select.tsx index 64b4d471c5..4443ebba91 100644 --- a/components/ui/select/Select.tsx +++ b/components/ui/select/Select.tsx @@ -24,7 +24,7 @@ const SelectTrigger = React.forwardRef< span]:line-clamp-1 dark:border-slate-800 dark:ring-offset-slate-950 dark:placeholder:text-slate-400 dark:focus:ring-slate-300", + "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-slate-200 bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-white placeholder:text-slate-500 focus:outline-none focus:ring-1 focus:ring-slate-950 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-800 dark:ring-offset-slate-950 dark:placeholder:text-slate-400 dark:focus:ring-slate-300 [&>span]:line-clamp-1", className, )} {...props} diff --git a/components/ui/sidebar/Sidebar.tsx b/components/ui/sidebar/Sidebar.tsx index 7ab1cfe163..1607609099 100644 --- a/components/ui/sidebar/Sidebar.tsx +++ b/components/ui/sidebar/Sidebar.tsx @@ -113,7 +113,7 @@ const Sidebar = React.forwardRef( endContent={ isCompact || isNestType || hideEndContent ? null - : item.endContent ?? null + : (item.endContent ?? null) } startContent={ isCompact || isNestType ? null : item.icon ? ( @@ -127,7 +127,7 @@ const Sidebar = React.forwardRef( width={24} /> ) : ( - item.startContent ?? null + (item.startContent ?? null) ) } title={isCompact || isNestType ? null : item.title} @@ -146,7 +146,7 @@ const Sidebar = React.forwardRef( width={24} /> ) : ( - item.startContent ?? null + (item.startContent ?? null) )}
@@ -180,7 +180,7 @@ const Sidebar = React.forwardRef(
) : ( - item.startContent ?? null + (item.startContent ?? null) ) } > @@ -223,7 +223,7 @@ const Sidebar = React.forwardRef( {...item} key={item.key} endContent={ - isCompact || hideEndContent ? null : item.endContent ?? null + isCompact || hideEndContent ? null : (item.endContent ?? null) } startContent={ isCompact ? null : item.icon ? ( @@ -236,7 +236,7 @@ const Sidebar = React.forwardRef( width={24} /> ) : ( - item.startContent ?? null + (item.startContent ?? null) ) } textValue={item.title} @@ -255,7 +255,7 @@ const Sidebar = React.forwardRef( width={24} /> ) : ( - item.startContent ?? null + (item.startContent ?? null) )}
diff --git a/components/ui/sidebar/SidebarWrap.tsx b/components/ui/sidebar/SidebarWrap.tsx index 2da8d70670..949cd59da0 100644 --- a/components/ui/sidebar/SidebarWrap.tsx +++ b/components/ui/sidebar/SidebarWrap.tsx @@ -42,7 +42,7 @@ export const SidebarWrap = () => { return (
{ )} >
@@ -268,9 +268,9 @@ export const SidebarWrap = () => { >
@@ -284,7 +284,7 @@ export const SidebarWrap = () => {