Compare commits

...

1 Commits

Author SHA1 Message Date
7f0f5b130a Make Azure DevOps sync not require project name 2025-07-14 21:14:57 -04:00
6 changed files with 16 additions and 11 deletions

View File

@ -17,7 +17,7 @@ export const AzureDevOpsSyncDestinationConfigSchema = z.object({
.describe(SecretSyncs.DESTINATION_CONFIG.AZURE_DEVOPS?.devopsProjectId || "Azure DevOps Project ID"), .describe(SecretSyncs.DESTINATION_CONFIG.AZURE_DEVOPS?.devopsProjectId || "Azure DevOps Project ID"),
devopsProjectName: z devopsProjectName: z
.string() .string()
.min(1, "Project name required") .optional()
.describe(SecretSyncs.DESTINATION_CONFIG.AZURE_DEVOPS?.devopsProjectName || "Azure DevOps Project Name") .describe(SecretSyncs.DESTINATION_CONFIG.AZURE_DEVOPS?.devopsProjectName || "Azure DevOps Project Name")
}); });

View File

@ -11,7 +11,9 @@ export const AzureDevOpsSyncReviewFields = () => {
return ( return (
<> <>
<GenericFieldLabel label="Project">{devopsProjectName}</GenericFieldLabel> {devopsProjectName && (
<GenericFieldLabel label="Project">{devopsProjectName}</GenericFieldLabel>
)}
<GenericFieldLabel label="Project ID">{devopsProjectId}</GenericFieldLabel> <GenericFieldLabel label="Project ID">{devopsProjectId}</GenericFieldLabel>
</> </>
); );

View File

@ -8,10 +8,7 @@ export const AzureDevOpsSyncDestinationSchema = BaseSecretSyncSchema().merge(
destination: z.literal(SecretSync.AzureDevOps), destination: z.literal(SecretSync.AzureDevOps),
destinationConfig: z.object({ destinationConfig: z.object({
devopsProjectId: z.string().trim().min(1, { message: "Azure DevOps Project ID is required" }), devopsProjectId: z.string().trim().min(1, { message: "Azure DevOps Project ID is required" }),
devopsProjectName: z devopsProjectName: z.string().trim().optional()
.string()
.trim()
.min(1, { message: "Azure DevOps Project Name is required" })
}) })
}) })
); );

View File

@ -6,7 +6,7 @@ export type TAzureDevOpsSync = TRootSecretSync & {
destination: SecretSync.AzureDevOps; destination: SecretSync.AzureDevOps;
destinationConfig: { destinationConfig: {
devopsProjectId: string; devopsProjectId: string;
devopsProjectName: string; devopsProjectName?: string;
}; };
connection: { connection: {
app: AppConnection.AzureDevOps; app: AppConnection.AzureDevOps;

View File

@ -115,8 +115,10 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
secondaryText = "Vault ID"; secondaryText = "Vault ID";
break; break;
case SecretSync.AzureDevOps: case SecretSync.AzureDevOps:
primaryText = destinationConfig.devopsProjectName; primaryText = destinationConfig.devopsProjectName || destinationConfig.devopsProjectId;
secondaryText = destinationConfig.devopsProjectId; secondaryText = destinationConfig.devopsProjectName
? destinationConfig.devopsProjectId
: "Project ID";
break; break;
case SecretSync.Heroku: case SecretSync.Heroku:
primaryText = destinationConfig.appName; primaryText = destinationConfig.appName;

View File

@ -7,8 +7,12 @@ type Props = {
export const AzureDevOpsSyncDestinationSection = ({ secretSync }: Props) => { export const AzureDevOpsSyncDestinationSection = ({ secretSync }: Props) => {
const { const {
destinationConfig: { devopsProjectName } destinationConfig: { devopsProjectName, devopsProjectId }
} = secretSync; } = secretSync;
return <GenericFieldLabel label="Project">{devopsProjectName}</GenericFieldLabel>; return (
<GenericFieldLabel label={devopsProjectName ? "Project" : "Project ID"}>
{devopsProjectName || devopsProjectId}
</GenericFieldLabel>
);
}; };