Skip to content

Commit 521b316

Browse files
committed
add support for ado logo
1 parent 84eda76 commit 521b316

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Loading

packages/web/src/actions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { gerritSchema } from "@sourcebot/schemas/v3/gerrit.schema";
1414
import { giteaSchema } from "@sourcebot/schemas/v3/gitea.schema";
1515
import { githubSchema } from "@sourcebot/schemas/v3/github.schema";
1616
import { gitlabSchema } from "@sourcebot/schemas/v3/gitlab.schema";
17+
import { azuredevopsSchema } from "@sourcebot/schemas/v3/azuredevops.schema";
1718
import { GithubConnectionConfig } from "@sourcebot/schemas/v3/github.type";
1819
import { GitlabConnectionConfig } from "@sourcebot/schemas/v3/gitlab.type";
1920
import { GiteaConnectionConfig } from "@sourcebot/schemas/v3/gitea.type";
@@ -2187,6 +2188,8 @@ const parseConnectionConfig = (config: string) => {
21872188
return gerritSchema;
21882189
case 'bitbucket':
21892190
return bitbucketSchema;
2191+
case 'azuredevops':
2192+
return azuredevopsSchema;
21902193
case 'git':
21912194
return genericGitHostSchema;
21922195
}

packages/web/src/lib/utils.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { type ClassValue, clsx } from "clsx"
22
import { twMerge } from "tailwind-merge"
33
import githubLogo from "@/public/github.svg";
4+
import azuredevopsLogo from "@/public/azuredevops.svg";
45
import gitlabLogo from "@/public/gitlab.svg";
56
import giteaLogo from "@/public/gitea.svg";
67
import gerritLogo from "@/public/gerrit.svg";
@@ -69,6 +70,7 @@ export type CodeHostType =
6970
"gerrit" |
7071
"bitbucket-cloud" |
7172
"bitbucket-server" |
73+
"azuredevops" |
7274
"generic-git-host";
7375

7476
export type AuthProviderType =
@@ -210,6 +212,17 @@ export const getCodeHostInfoForRepo = (repo: {
210212
iconClassName: className,
211213
}
212214
}
215+
case 'azuredevops': {
216+
const { src, className } = getCodeHostIcon('azuredevops')!;
217+
return {
218+
type: "azuredevops",
219+
displayName: displayName ?? name,
220+
codeHostName: "Azure DevOps",
221+
repoLink: webUrl,
222+
icon: src,
223+
iconClassName: className,
224+
}
225+
}
213226
case 'gitea': {
214227
const { src, className } = getCodeHostIcon('gitea')!;
215228
return {
@@ -293,6 +306,10 @@ export const getCodeHostIcon = (codeHostType: string): { src: string, className?
293306
return {
294307
src: bitbucketLogo,
295308
}
309+
case "azuredevops":
310+
return {
311+
src: azuredevopsLogo,
312+
}
296313
case "generic-git-host":
297314
return {
298315
src: gitLogo,
@@ -309,6 +326,7 @@ export const isAuthSupportedForCodeHost = (codeHostType: CodeHostType): boolean
309326
case "gitea":
310327
case "bitbucket-cloud":
311328
case "bitbucket-server":
329+
case "azuredevops":
312330
return true;
313331
case "generic-git-host":
314332
case "gerrit":

0 commit comments

Comments
 (0)