mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 19:44:52 +00:00
Add secret sync vercel integration
This commit is contained in:
+4
@@ -18,6 +18,7 @@ import { AzureAppConfigurationSyncDestinationSection } from "./AzureAppConfigura
|
||||
import { AzureKeyVaultSyncDestinationSection } from "./AzureKeyVaultSyncDestinationSection";
|
||||
import { GcpSyncDestinationSection } from "./GcpSyncDestinationSection";
|
||||
import { HumanitecSyncDestinationSection } from "./HumanitecSyncDestinationSection";
|
||||
import { VercelSyncDestinationSection } from "./VercelSyncDestinationSection";
|
||||
|
||||
type Props = {
|
||||
secretSync: TSecretSync;
|
||||
@@ -57,6 +58,9 @@ export const SecretSyncDestinationSection = ({ secretSync, onEditDestination }:
|
||||
case SecretSync.Humanitec:
|
||||
DestinationComponents = <HumanitecSyncDestinationSection secretSync={secretSync} />;
|
||||
break;
|
||||
case SecretSync.Vercel:
|
||||
DestinationComponents = <VercelSyncDestinationSection secretSync={secretSync} />;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unhandled Destination Section components: ${destination}`);
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import { ReactNode } from "react";
|
||||
|
||||
import { SecretSyncLabel } from "@app/components/secret-syncs";
|
||||
import { TVercelSync, VercelEnvironmentType } from "@app/hooks/api/secretSyncs/types/vercel-sync";
|
||||
|
||||
type Props = {
|
||||
secretSync: TVercelSync;
|
||||
};
|
||||
|
||||
export const VercelSyncDestinationSection = ({ secretSync }: Props) => {
|
||||
const { destinationConfig } = secretSync;
|
||||
|
||||
let Components: ReactNode;
|
||||
if (destinationConfig.env === VercelEnvironmentType.Preview && destinationConfig.branch) {
|
||||
Components = (
|
||||
<>
|
||||
<SecretSyncLabel label="Vercel App">{destinationConfig.app}</SecretSyncLabel>
|
||||
<SecretSyncLabel label="Environment">{destinationConfig.env}</SecretSyncLabel>
|
||||
<SecretSyncLabel label="Preview Branch">{destinationConfig.branch}</SecretSyncLabel>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
Components = (
|
||||
<>
|
||||
<SecretSyncLabel label="Vercel App">{destinationConfig.app}</SecretSyncLabel>
|
||||
<SecretSyncLabel label="Environment">{destinationConfig.env}</SecretSyncLabel>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return Components;
|
||||
};
|
||||
+1
@@ -48,6 +48,7 @@ export const SecretSyncOptionsSection = ({ secretSync, onEditOptions }: Props) =
|
||||
case SecretSync.AzureAppConfiguration:
|
||||
case SecretSync.Databricks:
|
||||
case SecretSync.Humanitec:
|
||||
case SecretSync.Vercel:
|
||||
AdditionalSyncOptionsComponent = null;
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user