Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: invalid vcs ui type for azure (#7687)

ecmadaod199aa7fa595
diff --git a/frontend/src/components/VCSProviderBasicInfoPanel.vue b/frontend/src/components/VCSProviderBasicInfoPanel.vue
index d73dadc8bc..e98abe2ca0 100644
--- a/frontend/src/components/VCSProviderBasicInfoPanel.vue
+++ b/frontend/src/components/VCSProviderBasicInfoPanel.vue
@@ -173,6 +173,10 @@ export default defineComponent({
}
} else if (props.config.type === ExternalVersionControl_Type.BITBUCKET) {
return "Bitbucket.org";
+ } else if (
+ props.config.type === ExternalVersionControl_Type.AZURE_DEVOPS
+ ) {
+ return "Azure DevOps";
}
return "";
});
diff --git a/frontend/src/components/VCSProviderOAuthPanel.vue b/frontend/src/components/VCSProviderOAuthPanel.vue
index 67449efd46..01d75eada8 100644
--- a/frontend/src/components/VCSProviderOAuthPanel.vue
+++ b/frontend/src/components/VCSProviderOAuthPanel.vue
@@ -471,7 +471,7 @@
</div>
<div class="grid grid-cols-2 gap-4 px-4 py-2 items-center">
<dt class="text-sm font-medium text-control-light text-right">
- Redirect URI
+ Redirect URL
</dt>
<dd class="text-sm text-main items-center flex">
{{ redirectUrl() }}
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 5539309252..3056c7d5d7 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1675,9 +1675,12 @@
"gitlab-self-host-application-id-label": "Application ID for the registered GitLab instance-wide OAuth application.",
"gitlab-com-application-id-label": "Application ID for the registered GitLab OAuth application.",
"view-in-gitlab": "View in GitLab",
+ "view-in-azure": "View in Azure",
"gitlab-self-host-secret-label": "Secret for the registered GitLab instance-wide OAuth application.",
"gitlab-com-secret-label": "Secret for the registered GitLab OAuth application.",
+ "azure-secret-label": "Client secret for the registered Azure OAuth application.",
"github-application-id-label": "Client ID for the registered GitHub organization-wide OAuth application.",
+ "azure-application-id-label": "Client ID for the registered Azure organization-wide OAuth application.",
"secret-label-github": "Client secret for the registered GitHub organization-wide OAuth application.",
"delete-forbidden": "To delete this provider, unlink all repositories first.",
"delete": "Delete this Git provider",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 69088f76ee..3d95ec65d7 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1668,10 +1668,13 @@
"git-provider": {
"gitlab-self-host-application-id-label": "注册为 GitLab 实例级 OAuth 应用的应用 ID。",
"gitlab-com-application-id-label": "注册为 GitLab OAuth 应用的应用 ID。",
- "view-in-gitlab": "查看 GitLab",
+ "view-in-gitlab": "查看 GitLab App",
+ "view-in-azure": "查看 Azure App",
"gitlab-self-host-secret-label": "注册为 GitLab 实例级 OAuth 应用的 Secret。",
"gitlab-com-secret-label": "注册为 GitLab OAuth 应用的 Secret。",
+ "azure-secret-label": "注册为 Azure OAuth 应用的 Client Secret。",
"github-application-id-label": "注册为 GitHub 组织级别 OAuth 应用的 Client ID。",
+ "azure-application-id-label": "注册为 Azure 组织级别 OAuth 应用的 Client ID。",
"secret-label-github": "注册为 GitHub 组织级别 OAuth 应用的 Client secret。",
"delete-forbidden": "删除这个提供方前,需要先解除所有仓库的关联。",
"delete": "删除 Git 提供方",
diff --git a/frontend/src/utils/v1/vcs.ts b/frontend/src/utils/v1/vcs.ts
index 49241fe209..4c188d7d64 100644
--- a/frontend/src/utils/v1/vcs.ts
+++ b/frontend/src/utils/v1/vcs.ts
@@ -15,6 +15,8 @@ export const getVCSUIType = (vcs: ExternalVersionControl): VCSUIType => {
return "GITLAB_COM";
}
return "GITLAB_SELF_HOST";
+ case ExternalVersionControl_Type.AZURE_DEVOPS:
+ return "AZURE_DEVOPS";
default:
return "GITLAB_SELF_HOST";
}
diff --git a/frontend/src/views/SettingWorkspaceVCSDetail.vue b/frontend/src/views/SettingWorkspaceVCSDetail.vue
index dbe387d6a0..c028365d4c 100644
--- a/frontend/src/views/SettingWorkspaceVCSDetail.vue
+++ b/frontend/src/views/SettingWorkspaceVCSDetail.vue
@@ -31,6 +31,13 @@
<div class="textlabel whitespace-nowrap">Bitbucket.org</div>
<img class="h-6 w-auto" src="../assets/bitbucket-logo.svg" />
</div>
+ <div
+ v-else-if="vcsUIType == 'AZURE_DEVOPS'"
+ class="flex flex-row items-center space-x-2"
+ >
+ <div class="textlabel whitespace-nowrap">Azure DevOps</div>
+ <img class="h-6 w-auto" src="../assets/azure-devops-logo.svg" />
+ </div>
</div>
<div>
@@ -91,6 +98,12 @@
<template v-else-if="vcsUIType == 'GITHUB_COM'">
{{ $t("gitops.setting.git-provider.github-application-id-label") }}
</template>
+ <template v-else-if="vcsUIType == 'AZURE_DEVOPS'">
+ {{ $t("gitops.setting.git-provider.azure-application-id-label") }}
+ <a :href="adminApplicationUrl" target="_blank" class="normal-link">{{
+ $t("gitops.setting.git-provider.view-in-azure")
+ }}</a>
+ </template>
</p>
<input
id="applicationid"
@@ -113,6 +126,9 @@
<template v-else-if="vcsUIType == 'GITHUB_COM'">
{{ $t("gitops.setting.git-provider.secret-label-github") }}
</template>
+ <template v-else-if="vcsUIType == 'AZURE_DEVOPS'">
+ {{ $t("gitops.setting.git-provider.azure-secret-label") }}
+ </template>
</p>
<input
id="secret"
@@ -269,12 +285,16 @@ watchEffect(async () => {
});
const adminApplicationUrl = computed(() => {
- if (vcsUIType.value == "GITLAB_SELF_HOST") {
- return `${vcs.value?.url}/admin/applications`;
- } else if (vcsUIType.value == "GITLAB_COM") {
- return "https://gitlab.com/-/profile/applications";
+ switch (vcsUIType.value) {
+ case "AZURE_DEVOPS":
+ return `https://app.vsaex.visualstudio.com/app/view?clientId=${vcs.value?.applicationId}`;
+ case "GITLAB_COM":
+ return "https://gitlab.com/-/profile/applications";
+ case "GITLAB_SELF_HOST":
+ return `${vcs.value?.url}/admin/applications`;
+ default:
+ return "";
}
- return "";
});
const repositoryList = computed(() =>