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"),
devopsProjectName: z
.string()
.min(1, "Project name required")
.optional()
.describe(SecretSyncs.DESTINATION_CONFIG.AZURE_DEVOPS?.devopsProjectName || "Azure DevOps Project Name")
});

View File

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

View File

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

View File

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

View File

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

View File

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