fix: move ProviderType to shared types and update usages (#7714)

Co-authored-by: Pablo Lara <larabjj@gmail.com>
This commit is contained in:
Prowler BotandPablo Lara authored and GitHub committed 2025-05-19 14:11:52 +05:45
1 parent fcc25451d8
commit 575bb8cd2c
18 files changed
+111 -97

No files matched your search

@@ -2,11 +2,11 @@ import { Divider } from "@nextui-org/react";
import React from "react";
import { DateWithTime, EntityInfoShort } from "@/components/ui/entities";
import { ProviderType } from "@/types";
interface ComplianceScanInfoProps {
scan: {
providerInfo: {
provider: "aws" | "azure" | "gcp" | "kubernetes";
provider: ProviderType;
alias?: string;
uid?: string;
};
@@ -12,7 +12,7 @@ import {
SeverityBadge,
StatusFindingBadge,
} from "@/components/ui/table";
import { FindingProps } from "@/types";
import { FindingProps, ProviderType } from "@/types";
import { Muted } from "../muted";
import { DeltaIndicator } from "./delta-indicator";
@@ -215,7 +215,7 @@ export const ColumnFindings: ColumnDef<FindingProps>[] = [
return (
<>
<EntityInfoShort
cloudProvider={provider as "aws" | "azure" | "gcp" | "kubernetes"}
cloudProvider={provider as ProviderType}
entityAlias={alias as string}
entityId={uid as string}
/>
@@ -6,12 +6,9 @@ import Link from "next/link";
import { CodeSnippet } from "@/components/ui/code-snippet/code-snippet";
import { InfoField } from "@/components/ui/entities";
import { DateWithTime } from "@/components/ui/entities/date-with-time";
import {
getProviderLogo,
type ProviderType,
} from "@/components/ui/entities/get-provider-logo";
import { getProviderLogo } from "@/components/ui/entities/get-provider-logo";
import { SeverityBadge } from "@/components/ui/table/severity-badge";
import { FindingProps } from "@/types";
import { FindingProps, ProviderType } from "@/types";
import { Muted } from "../muted";
import { DeltaIndicator } from "./delta-indicator";
@@ -9,7 +9,7 @@ import { InfoIcon } from "@/components/icons";
import { DateWithTime, EntityInfoShort } from "@/components/ui/entities";
import { TriggerSheet } from "@/components/ui/sheet";
import { SeverityBadge, StatusFindingBadge } from "@/components/ui/table";
import { FindingProps } from "@/types";
import { FindingProps, ProviderType } from "@/types";
import { Muted } from "../../../findings/muted";
@@ -162,7 +162,7 @@ export const ColumnNewFindingsToDate: ColumnDef<FindingProps>[] = [
return (
<>
<EntityInfoShort
cloudProvider={provider as "aws" | "azure" | "gcp" | "kubernetes"}
cloudProvider={provider as ProviderType}
entityAlias={alias as string}
entityId={uid as string}
/>
+3 -2
View File
@@ -1,9 +1,10 @@
import { Tooltip } from "@nextui-org/react";
import React from "react";
import { ConnectionFalse, ConnectionPending, ConnectionTrue } from "../icons";
import { getProviderLogo, ProviderType } from "../ui/entities";
import { ProviderType } from "@/types";
import { ConnectionFalse, ConnectionPending, ConnectionTrue } from "../icons";
import { getProviderLogo } from "../ui/entities";
interface ProviderInfoProps {
connected: boolean | null;
provider: ProviderType;
@@ -9,8 +9,8 @@ import * as z from "zod";
import { useToast } from "@/components/ui";
import { CustomButton, CustomInput } from "@/components/ui/custom";
import { ProviderType } from "@/components/ui/entities";
import { Form } from "@/components/ui/form";
import { ProviderType } from "@/types";
import { addProvider } from "../../../../actions/providers/providers";
import { addProviderFormSchema, ApiError } from "../../../../types";
@@ -18,9 +18,9 @@ import { getTask } from "@/actions/task/tasks";
import { CheckIcon, RocketIcon } from "@/components/icons";
import { useToast } from "@/components/ui";
import { CustomButton } from "@/components/ui/custom";
import { ProviderType } from "@/components/ui/entities";
import { Form } from "@/components/ui/form";
import { checkTaskStatus } from "@/lib/helper";
import { ProviderType } from "@/types";
import { ApiError, testConnectionFormSchema } from "@/types";
import { ProviderInfo } from "../..";
@@ -10,8 +10,8 @@ import * as z from "zod";
import { updateCredentialsProvider } from "@/actions/providers/providers";
import { useToast } from "@/components/ui";
import { CustomButton } from "@/components/ui/custom";
import { ProviderType } from "@/components/ui/entities";
import { Form } from "@/components/ui/form";
import { ProviderType } from "@/types";
import {
addCredentialsFormSchema,
ApiError,
@@ -10,8 +10,8 @@ import * as z from "zod";
import { addCredentialsProvider } from "@/actions/providers/providers";
import { useToast } from "@/components/ui";
import { CustomButton } from "@/components/ui/custom";
import { ProviderType } from "@/components/ui/entities";
import { Form } from "@/components/ui/form";
import { ProviderType } from "@/types";
import {
addCredentialsFormSchema,
ApiError,
@@ -1,8 +1,8 @@
import Link from "next/link";
import { getProviderName } from "@/components/ui/entities/get-provider-logo";
import { ProviderType } from "@/components/ui/entities/get-provider-logo";
import { getProviderLogo } from "@/components/ui/entities/get-provider-logo";
import { ProviderType } from "@/types";
export const ProviderTitleDocs = ({
providerType,
@@ -10,7 +10,7 @@ import { DateWithTime, EntityInfoShort } from "@/components/ui/entities";
import { TriggerSheet } from "@/components/ui/sheet";
import { DataTableColumnHeader, StatusBadge } from "@/components/ui/table";
import { downloadScanZip } from "@/lib/helper";
import { ScanProps } from "@/types";
import { ProviderType, ScanProps } from "@/types";
import { LinkToFindingsFromScan } from "../../link-to-findings-from-scan";
import { TriggerIcon } from "../../trigger-icon";
@@ -60,7 +60,7 @@ export const ColumnGetScans: ColumnDef<ScanProps>[] = [
return (
<EntityInfoShort
cloudProvider={provider as "aws" | "azure" | "gcp" | "kubernetes"}
cloudProvider={provider as ProviderType}
entityAlias={alias}
entityId={uid}
/>
@@ -1,10 +1,12 @@
import React from "react";
import { ProviderType } from "@/types";
import { getProviderLogo } from "./get-provider-logo";
import { SnippetId } from "./snippet-id";
interface EntityInfoProps {
cloudProvider: "aws" | "azure" | "gcp" | "kubernetes";
cloudProvider: ProviderType;
entityAlias?: string;
entityId?: string;
hideCopyButton?: boolean;
@@ -7,8 +7,7 @@ import {
KS8ProviderBadge,
M365ProviderBadge,
} from "@/components/icons/providers-badge";
export type ProviderType = "aws" | "azure" | "gcp" | "kubernetes" | "m365";
import { ProviderType } from "@/types";
export const getProviderLogo = (provider: ProviderType) => {
switch (provider) {