mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-27 18:07:57 +00:00
feat(ui): Display 'View in Gitlab' if externalUrl is a link to Gitlab (#10668)
This commit is contained in:
parent
894e25680b
commit
6054cb889b
@ -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;
|
||||
@ -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 (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user