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"),
|
.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")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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" })
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user