Skip to content

Commit

Permalink
✏️ Fix types typo
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed May 20, 2024
1 parent a41a610 commit aa7b540
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 deletions.
11 changes: 0 additions & 11 deletions apps/client-ts/src/app/(Dashboard)/configuration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import useFieldMappings from "@/hooks/get/useFieldMappings";
import { Skeleton } from "@/components/ui/skeleton";
import { useState } from "react";
import AddWebhook from "@/components/Configuration/Webhooks/AddWebhook";
import { cn } from "@/lib/utils";
import { WebhooksPage } from "@/components/Configuration/Webhooks/WebhooksPage";
import useWebhooks from "@/hooks/get/useWebhooks";
import { usePostHog } from 'posthog-js/react'
Expand All @@ -40,7 +39,6 @@ import useConnectionStrategies from "@/hooks/get/useConnectionStrategies";
import { extractAuthMode,extractProvider,extractVertical} from '@panora/shared'
import { Heading } from "@/components/ui/heading";
import CustomConnectorPage from "@/components/Configuration/Connector/CustomConnectorPage";
import { PlusCircle } from "lucide-react";

export default function Page() {
const {idProject} = useProjectStore();
Expand Down Expand Up @@ -94,15 +92,6 @@ export default function Page() {
destination_field: mapping.slug,
data_type: mapping.data_type,
}))

const mappingConnectionStrategies = connectionStrategies?.map(cs => ({
id_cs : cs.id_connection_strategy,
provider_name : extractProvider(cs.type),
auth_type: extractAuthMode(cs.type),
vertical: extractVertical(cs.type),
type: cs.type,
status: cs.status
}))

return (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { DataTableLoading } from "@/components/shared/data-table-loading";
import { useEffect, useState } from "react";
import { useColumns } from "./columns";

interface Webhook {
scope: string;
export interface Webhook {
scope: string[];
url: string;
endpoint_description: string;
endpoint_description: string | null;
secret: string;
id_webhook_endpoint: string;
active: boolean;
Expand Down
16 changes: 3 additions & 13 deletions apps/client-ts/src/components/Configuration/Webhooks/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import { ColumnDef } from "@tanstack/react-table"
import { Badge } from "@/components/ui/badge"
import { Webhook } from "./schema"
import { PasswordInput } from "@/components/ui/password-input"
import { useState } from "react"
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
Expand All @@ -12,19 +11,10 @@ import { DataTableColumnHeader } from "@/components/shared/data-table-column-hea
import { DataTableRowActions } from "@/components/shared/data-table-row-actions"
import { Switch } from "@/components/ui/switch"
import useUpdateWebhookStatus from "@/hooks/update/useUpdateWebhookStatus"
import { Input } from "@/components/ui/input"
import { Archive } from "lucide-react"
import { Webhook } from "./WebhooksPage"

interface WebhookType {
scope: string;
url: string;
endpoint_description: string;
secret: string;
id_webhook_endpoint: string;
active: boolean;
}

export function useColumns(webhooks: WebhookType[] | undefined, setWebhooks: React.Dispatch<React.SetStateAction<WebhookType[] | undefined>>) {
export function useColumns(webhooks: Webhook[] | undefined, setWebhooks: React.Dispatch<React.SetStateAction<Webhook[] | undefined>>) {
const [copiedState, setCopiedState] = useState<{ [key: string]: boolean }>({});
const { mutate } = useUpdateWebhookStatus();

Expand Down Expand Up @@ -185,5 +175,5 @@ export function useColumns(webhooks: WebhookType[] | undefined, setWebhooks: Rea
id: "actions",
cell: ({ row }) => <DataTableRowActions row={row} object={"webhook"} />,
},
] as ColumnDef<WebhookType>[];
] as ColumnDef<Webhook>[];
}

0 comments on commit aa7b540

Please sign in to comment.