mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #4105 from Infisical/make-azure-devops-sync-not-require-proj-name
This commit is contained in:
@@ -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")
|
||||
});
|
||||
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
})
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ export type TAzureDevOpsSync = TRootSecretSync & {
|
||||
destination: SecretSync.AzureDevOps;
|
||||
destinationConfig: {
|
||||
devopsProjectId: string;
|
||||
devopsProjectName: string;
|
||||
devopsProjectName?: string;
|
||||
};
|
||||
connection: {
|
||||
app: AppConnection.AzureDevOps;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user