Skip to content

Commit

Permalink
feat(ui): Display 'View in Gitlab' if externalUrl is a link to Gitlab (
Browse files Browse the repository at this point in the history
  • Loading branch information
k7ragav authored and yoonhyejin committed Jul 16, 2024
1 parent d197ccc commit 591a4a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions datahub-web-react/src/app/entity/shared/ExternalUrlButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import UrlButton from './UrlButton';

const GITHUB_LINK = 'github.com';
const GITHUB = 'GitHub';
const GITLAB_LINK = 'gitlab.com';
const GITLAB = 'GitLab';

interface Props {
externalUrl: string;
Expand All @@ -26,6 +28,8 @@ export default function ExternalUrlButton({ externalUrl, platformName, entityTyp
let displayedName = platformName;
if (externalUrl.toLocaleLowerCase().includes(GITHUB_LINK)) {
displayedName = GITHUB;
} else if (externalUrl.toLocaleLowerCase().includes(GITLAB_LINK)) {
displayedName = GITLAB;
}

return (
Expand Down

0 comments on commit 591a4a9

Please sign in to comment.