Skip to content
Open
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
5 changes: 4 additions & 1 deletion src/components/auth/ApiKeyAuth/ApiKeyAuthContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type ApiKeyAuthFormProps = {
isButtonDisabled?: boolean;
buttonVariant?: "ghost";
submitButtonType?: "submit" | "button";
metadataFields: MetadataItemInput[];
};

type ApiKeyFormData = {
Expand All @@ -40,9 +41,9 @@ export function ApiKeyAuthForm({
isButtonDisabled,
buttonVariant,
submitButtonType,
metadataFields,
}: ApiKeyAuthFormProps) {
const [formData, setFormData] = useState<ApiKeyFormData>({ apiKey: "" });
const metadataFields = providerInfo.metadata?.input || [];

const handleChange = (
event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
Expand Down Expand Up @@ -128,6 +129,7 @@ function ApiKeyAuthContentForm({
handleSubmit,
error,
isButtonDisabled,
metadataFields,
}: LandingContentProps) {
const { providerName } = useProvider(provider);

Expand All @@ -140,6 +142,7 @@ function ApiKeyAuthContentForm({
providerInfo={providerInfo}
handleSubmit={handleSubmit}
isButtonDisabled={isButtonDisabled}
metadataFields={metadataFields}
/>
</AuthCardLayout>
);
Expand Down
4 changes: 4 additions & 0 deletions src/components/auth/ApiKeyAuth/ApiKeyAuthFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useCallback } from "react";
import {
GenerateConnectionOperationRequest,
ProviderInfo,
MetadataItemInput,
} from "@generated/api/src";
import { useProject } from "context/ProjectContextProvider";
import { Connection } from "services/api";
Expand All @@ -20,6 +21,7 @@ type ApiKeyAuthFlowProps = {
groupName?: string;
children: JSX.Element;
selectedConnection: Connection | null;
metadataFields: MetadataItemInput[];
};

export function ApiKeyAuthFlow({
Expand All @@ -31,6 +33,7 @@ export function ApiKeyAuthFlow({
groupName,
children,
selectedConnection,
metadataFields,
}: ApiKeyAuthFlowProps) {
const { projectIdOrName } = useProject();
const createConnectionMutation = useCreateConnectionMutation();
Expand Down Expand Up @@ -72,6 +75,7 @@ export function ApiKeyAuthFlow({
providerInfo={providerInfo}
handleSubmit={onNext}
error={null}
metadataFields={metadataFields}
/>
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/auth/ApiKeyAuth/LandingContentProps.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProviderInfo } from "@generated/api/src";
import { ProviderInfo, MetadataItemInput } from "@generated/api/src";

import { ProviderMetadata } from "../providerMetadata";

Expand All @@ -8,6 +8,7 @@ export type LandingContentProps = {
handleSubmit: (form: IFormType) => void;
error: string | null;
isButtonDisabled?: boolean;
metadataFields: MetadataItemInput[];
};

export interface IFormType {
Expand Down
Loading