Skip to content

Commit 39587c3

Browse files
authored
Merge pull request #195 from KoolTheba/feat/add-gitlab-support
Feat: adapted links to availability for gitlab
2 parents 1b9d9c9 + b4c6426 commit 39587c3

File tree

3 files changed

+30
-23
lines changed

3 files changed

+30
-23
lines changed

src/components/ProjectCompartor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ function ProjectComparator() {
113113
<p data-testid="commits-analysis">
114114
Analysis of commits{" "}
115115
<a
116-
href={`https://github.com/${org}/${repo}/commit/${currentData.repo.commit}`}
116+
href={`https://${platform}/${org}/${repo}/commit/${currentData.repo.commit}`}
117117
target="_blank"
118118
rel="noreferrer"
119119
>
120120
{`(${currentData.repo.commit.substring(0, 8)})`}
121121
</a>{" "}
122122
and{" "}
123123
<a
124-
href={`https://github.com/${org}/${repo}/commit/${previousData.repo.commit}`}
124+
href={`https://${platform}/${org}/${repo}/commit/${previousData.repo.commit}`}
125125
target="_blank"
126126
rel="noreferrer"
127127
>

src/components/ProjectDetails.tsx

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Collapsible from "./Collapsable";
88
import Loading from "./Loading";
99

1010
import { ScoreElement } from "../types";
11+
import { GITHUB } from "../constants/platforms";
1112

1213
import "../styles/ProjectDetails.css";
1314

@@ -54,33 +55,38 @@ function ProjectDetails() {
5455
<p data-testid="current-commit">
5556
Current commit{" "}
5657
<a
57-
href={`https://github.com/${org}/${repo}/commit/${data.repo.commit}`}
58+
href={`https://${platform}/${org}/${repo}/commit/${data.repo.commit}`}
5859
target="_blank"
5960
rel="noreferrer"
6061
>
6162
{`(${data.repo.commit.substring(0, 8)})`}
6263
</a>
6364
</p>
64-
<p data-testid="deps-dev">
65-
Additional info at{" "}
66-
<a
67-
href={`https://deps.dev/project/github/${org}%2F${repo}`}
68-
target="_blank"
69-
rel="noreferrer"
70-
>
71-
deps.dev
72-
</a>
73-
</p>
74-
<p data-testid="step-security">
75-
Improve your scoring with{" "}
76-
<a
77-
href={`https://app.stepsecurity.io/securerepo?repo=${org}/${repo}`}
78-
target="_blank"
79-
rel="noreferrer"
80-
>
81-
StepSecurity
82-
</a>
83-
</p>
65+
{platform === GITHUB && (
66+
<>
67+
<p data-testid="deps-dev">
68+
Additional info at{" "}
69+
<a
70+
href={`https://deps.dev/project/github/${org}%2F${repo}`}
71+
target="_blank"
72+
rel="noreferrer"
73+
>
74+
deps.dev
75+
</a>
76+
</p>
77+
<p data-testid="step-security">
78+
Improve your scoring with{" "}
79+
<a
80+
href={`https://app.stepsecurity.io/securerepo?repo=${org}/${repo}`}
81+
target="_blank"
82+
rel="noreferrer"
83+
>
84+
StepSecurity
85+
</a>
86+
</p>
87+
</>
88+
)}
89+
8490
<hr />
8591
{data.checks.map((element: ScoreElement) => (
8692
<>

src/constants/platforms.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const GITHUB = 'github.com'

0 commit comments

Comments
 (0)