Skip to content

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

feat(github): various logic fixes in UI (#1997)

Joe Chen5caa8f72d68a
diff --git a/frontend/src/components/Issue/IssueHighlightPanel.vue b/frontend/src/components/Issue/IssueHighlightPanel.vue
index 932fcd81be..905e6a4c6f 100644
--- a/frontend/src/components/Issue/IssueHighlightPanel.vue
+++ b/frontend/src/components/Issue/IssueHighlightPanel.vue
@@ -143,6 +143,8 @@ const vcsBranchUrl = computed((): string => {
if (pushEvent.value) {
if (pushEvent.value.vcsType == "GITLAB_SELF_HOST") {
return `${pushEvent.value.repositoryUrl}/-/tree/${vcsBranch.value}`;
+ } else if (pushEvent.value.vcsType == "GITHUB_COM") {
+ return `${pushEvent.value.repositoryUrl}/tree/${vcsBranch.value}`;
}
}
return "";
diff --git a/frontend/src/types/repository.ts b/frontend/src/types/repository.ts
index 17695b937e..da6d593572 100644
--- a/frontend/src/types/repository.ts
+++ b/frontend/src/types/repository.ts
@@ -94,6 +94,12 @@ export function baseDirectoryWebUrl(repository: Repository): string {
url += `/${repository.baseDirectory}`;
}
return url;
+ } else if (repository.vcs.type == "GITHUB_COM") {
+ let url = `${repository.webUrl}/tree/${repository.branchFilter}`;
+ if (!isEmpty(repository.baseDirectory)) {
+ url += `/${repository.baseDirectory}`;
+ }
+ return url;
}
return repository.webUrl;
diff --git a/frontend/src/views/MigrationHistoryDetail.vue b/frontend/src/views/MigrationHistoryDetail.vue
index 0a75b9cf79..851810f4ba 100644
--- a/frontend/src/views/MigrationHistoryDetail.vue
+++ b/frontend/src/views/MigrationHistoryDetail.vue
@@ -358,6 +358,9 @@ export default defineComponent({
if (pushEvent.value.vcsType == "GITLAB_SELF_HOST") {
const parts = pushEvent.value.ref.split("/");
return parts[parts.length - 1];
+ } else if (pushEvent.value.vcsType == "GITHUB_COM") {
+ const parts = pushEvent.value.ref.split("/");
+ return parts[parts.length - 1];
}
}
return "";
@@ -367,6 +370,8 @@ export default defineComponent({
if (pushEvent.value) {
if (pushEvent.value.vcsType == "GITLAB_SELF_HOST") {
return `${pushEvent.value.repositoryUrl}/-/tree/${vcsBranch.value}`;
+ } else if (pushEvent.value.vcsType == "GITHUB_COM") {
+ return `${pushEvent.value.repositoryUrl}/tree/${vcsBranch.value}`;
}
}
return "";