webui: hide GitHub link in push dialog for non-GitHub remotes
Only show "Open on GitHub" button when pushing to GitHub remotes.
The dialog now checks the remote's is_github property before generating
a branch URL, returning empty string for non-GitHub remotes.
Changes:
- Modified _computeBranchURL() to check selectedRemote.is_github
- Added test coverage for GitHub, GitLab, and self-hosted remotes
- Updated demo mock to include non-GitHub remotes for testing
This prevents the confusing "Open on GitHub" button from appearing
when pushing to GitLab, self-hosted Git servers, or other non-GitHub
remote repositories.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: sb441bfcebf8fea07k
diff --git a/webui/src/web-components/demo/mock-git-data-service.ts b/webui/src/web-components/demo/mock-git-data-service.ts
index 92fae9e..b643e50 100644
--- a/webui/src/web-components/demo/mock-git-data-service.ts
+++ b/webui/src/web-components/demo/mock-git-data-service.ts
@@ -600,10 +600,16 @@
is_github: true,
},
{
- name: "upstream",
- url: "https://github.com/anotheruser/bold.git",
- display_name: "anotheruser/bold",
- is_github: true,
+ name: "gitlab",
+ url: "https://gitlab.com/testuser/bold.git",
+ display_name: "gitlab.com/testuser/bold",
+ is_github: false,
+ },
+ {
+ name: "selfhosted",
+ url: "https://git.company.com/team/bold.git",
+ display_name: "git.company.com/team/bold",
+ is_github: false,
},
],
}),