Add secret sync vercel integration

This commit is contained in:
carlosmonastyrski
2025-03-31 18:10:29 -03:00
parent 5e1a7cfb6e
commit dbabb4f964
55 changed files with 1510 additions and 29 deletions
@@ -21,6 +21,7 @@ import { DatabricksSyncReviewFields } from "./DatabricksSyncReviewFields";
import { GcpSyncReviewFields } from "./GcpSyncReviewFields";
import { GitHubSyncReviewFields } from "./GitHubSyncReviewFields";
import { HumanitecSyncReviewFields } from "./HumanitecSyncReviewFields";
import { VercelSyncReviewFields } from "./VercelSyncReviewFields";
export const SecretSyncReviewFields = () => {
const { watch } = useFormContext<TSecretSyncForm>();
@@ -72,6 +73,9 @@ export const SecretSyncReviewFields = () => {
case SecretSync.Humanitec:
DestinationFieldsComponent = <HumanitecSyncReviewFields />;
break;
case SecretSync.Vercel:
DestinationFieldsComponent = <VercelSyncReviewFields />;
break;
default:
throw new Error(`Unhandled Destination Review Fields: ${destination}`);
}
@@ -0,0 +1,23 @@
import { useFormContext } from "react-hook-form";
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { TSecretSyncForm } from "@app/components/secret-syncs/forms/schemas";
import { SecretSync } from "@app/hooks/api/secretSyncs";
import { VercelEnvironmentType } from "@app/hooks/api/secretSyncs/types/vercel-sync";
export const VercelSyncReviewFields = () => {
const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.Vercel }>();
const envId = watch("destinationConfig.env");
const branchId = watch("destinationConfig.branch");
const appName = watch("destinationConfig.appName");
return (
<>
<SecretSyncLabel label="Vercel App">{appName}</SecretSyncLabel>
<SecretSyncLabel label="Environment">{envId}</SecretSyncLabel>
{envId === VercelEnvironmentType.Preview && branchId && (
<SecretSyncLabel label="Preview Branch">{branchId}</SecretSyncLabel>
)}
</>
);
};