misc: renamed enum

This commit is contained in:
Sheen Capadngan
2025-01-27 21:47:27 +08:00
parent 49e6d7a861
commit 18cf3c89c1
19 changed files with 62 additions and 27 deletions
@@ -10,7 +10,9 @@ import { SecretSync } from "@app/hooks/api/secretSyncs";
import { TSecretSyncForm } from "../schemas";
export const GcpSyncFields = () => {
const { control, setValue } = useFormContext<TSecretSyncForm & { destination: SecretSync.GCP }>();
const { control, setValue } = useFormContext<
TSecretSyncForm & { destination: SecretSync.GCPSecretManager }
>();
const connectionId = useWatch({ name: "connection.id", control });
@@ -17,7 +17,7 @@ export const SecretSyncDestinationFields = () => {
return <AwsParameterStoreSyncFields />;
case SecretSync.GitHub:
return <GitHubSyncFields />;
case SecretSync.GCP:
case SecretSync.GCPSecretManager:
return <GcpSyncFields />;
default:
throw new Error(`Unhandled Destination Config Field: ${destination}`);
@@ -5,7 +5,9 @@ import { TSecretSyncForm } from "@app/components/secret-syncs/forms/schemas";
import { SecretSync } from "@app/hooks/api/secretSyncs";
export const GcpSyncReviewFields = () => {
const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.GCP }>();
const { watch } = useFormContext<
TSecretSyncForm & { destination: SecretSync.GCPSecretManager }
>();
const projectId = watch("destinationConfig.projectId");
return <SecretSyncLabel label="Project ID">{projectId}</SecretSyncLabel>;
@@ -39,7 +39,7 @@ export const SecretSyncReviewFields = () => {
case SecretSync.GitHub:
DestinationFieldsComponent = <GitHubSyncReviewFields />;
break;
case SecretSync.GCP:
case SecretSync.GCPSecretManager:
DestinationFieldsComponent = <GcpSyncReviewFields />;
break;
default:
@@ -3,7 +3,7 @@ import { z } from "zod";
import { SecretSync } from "@app/hooks/api/secretSyncs";
export const GcpSyncDestinationSchema = z.object({
destination: z.literal(SecretSync.GCP),
destination: z.literal(SecretSync.GCPSecretManager),
destinationConfig: z.object({
projectId: z.string().min(1, "Project ID required")
})