Skip to content

Commit

Permalink
Merge pull request #195 from KoolTheba/feat/add-gitlab-support
Browse files Browse the repository at this point in the history
Feat: adapted links to availability for gitlab
  • Loading branch information
KoolTheba authored Oct 28, 2023
2 parents 1b9d9c9 + b4c6426 commit 39587c3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/components/ProjectCompartor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ function ProjectComparator() {
<p data-testid="commits-analysis">
Analysis of commits{" "}
<a
href={`https://github.com/${org}/${repo}/commit/${currentData.repo.commit}`}
href={`https://${platform}/${org}/${repo}/commit/${currentData.repo.commit}`}
target="_blank"
rel="noreferrer"
>
{`(${currentData.repo.commit.substring(0, 8)})`}
</a>{" "}
and{" "}
<a
href={`https://github.com/${org}/${repo}/commit/${previousData.repo.commit}`}
href={`https://${platform}/${org}/${repo}/commit/${previousData.repo.commit}`}
target="_blank"
rel="noreferrer"
>
Expand Down
48 changes: 27 additions & 21 deletions src/components/ProjectDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Collapsible from "./Collapsable";
import Loading from "./Loading";

import { ScoreElement } from "../types";
import { GITHUB } from "../constants/platforms";

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

Expand Down Expand Up @@ -54,33 +55,38 @@ function ProjectDetails() {
<p data-testid="current-commit">
Current commit{" "}
<a
href={`https://github.com/${org}/${repo}/commit/${data.repo.commit}`}
href={`https://${platform}/${org}/${repo}/commit/${data.repo.commit}`}
target="_blank"
rel="noreferrer"
>
{`(${data.repo.commit.substring(0, 8)})`}
</a>
</p>
<p data-testid="deps-dev">
Additional info at{" "}
<a
href={`https://deps.dev/project/github/${org}%2F${repo}`}
target="_blank"
rel="noreferrer"
>
deps.dev
</a>
</p>
<p data-testid="step-security">
Improve your scoring with{" "}
<a
href={`https://app.stepsecurity.io/securerepo?repo=${org}/${repo}`}
target="_blank"
rel="noreferrer"
>
StepSecurity
</a>
</p>
{platform === GITHUB && (
<>
<p data-testid="deps-dev">
Additional info at{" "}
<a
href={`https://deps.dev/project/github/${org}%2F${repo}`}
target="_blank"
rel="noreferrer"
>
deps.dev
</a>
</p>
<p data-testid="step-security">
Improve your scoring with{" "}
<a
href={`https://app.stepsecurity.io/securerepo?repo=${org}/${repo}`}
target="_blank"
rel="noreferrer"
>
StepSecurity
</a>
</p>
</>
)}

<hr />
{data.checks.map((element: ScoreElement) => (
<>
Expand Down
1 change: 1 addition & 0 deletions src/constants/platforms.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const GITHUB = 'github.com'

0 comments on commit 39587c3

Please sign in to comment.