;
export const TestConnectionForm = ({
searchParams,
+ providerData,
}: {
searchParams: { type: string; id: string };
+ providerData: {
+ data: {
+ id: string;
+ attributes: {
+ connection: {
+ connected: boolean;
+ };
+ provider: "aws" | "azure" | "gcp" | "kubernetes";
+ alias: string;
+ };
+ };
+ };
}) => {
const { toast } = useToast();
const router = useRouter();
@@ -68,7 +83,6 @@ export const TestConnectionForm = ({
}
});
} else {
- console.log({ data: data.data.id }, "success");
const taskId = data.data.id;
setApiErrorMessage(null);
@@ -128,6 +142,12 @@ export const TestConnectionForm = ({
)}
+
+
@@ -142,6 +162,17 @@ export const TestConnectionForm = ({
/>
Back to providers
+ ) : connectionStatus?.error ? (
+
+
+ Handle credentials
+
) : (
}
>
- {isLoading ? <>Loading> : Connect account}
+ {isLoading ? <>Loading> : Test connection}
)}
diff --git a/components/providers/workflow/forms/via-credentials-form.tsx b/components/providers/workflow/forms/via-credentials-form.tsx
index fb2507e304..56a9161ea0 100644
--- a/components/providers/workflow/forms/via-credentials-form.tsx
+++ b/components/providers/workflow/forms/via-credentials-form.tsx
@@ -38,12 +38,12 @@ type FormType = CredentialsFormSchema &
export const ViaCredentialsForm = ({
searchParams,
}: {
- searchParams: { provider: string; id: string };
+ searchParams: { type: string; id: string };
}) => {
const router = useRouter();
const { toast } = useToast();
- const providerType = searchParams.provider;
+ const providerType = searchParams.type;
const providerId = searchParams.id;
const formSchema = addCredentialsFormSchema(providerType);
diff --git a/components/providers/workflow/forms/via-credentials/aws-credentials-form.tsx b/components/providers/workflow/forms/via-credentials/aws-credentials-form.tsx
index b35b08f93c..a024d138ff 100644
--- a/components/providers/workflow/forms/via-credentials/aws-credentials-form.tsx
+++ b/components/providers/workflow/forms/via-credentials/aws-credentials-form.tsx
@@ -21,7 +21,7 @@ export const AWScredentialsForm = ({