Skip to content

Commit

Permalink
fix the source table in search settings presenting private sources...
Browse files Browse the repository at this point in the history
...as links

this didn't expose private links or anything like that. purely a
visual thing.
  • Loading branch information
ndepaola committed Dec 31, 2023
1 parent b19d662 commit 760c1be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion frontend/src/features/contributions/contributions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from "next/link";
import React from "react";

import { useGetBackendInfoQuery, useGetContributionsQuery } from "@/app/api";
import { useGetContributionsQuery } from "@/app/api";
import { Card, Cardback, ProjectName, Token } from "@/common/constants";
import { SourceContribution } from "@/common/types";
import { Spinner } from "@/components/spinner";
Expand Down
13 changes: 7 additions & 6 deletions frontend/src/features/searchSettings/sourceSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Droppable,
DropResult,
} from "@hello-pangea/dnd"; // TODO: look into using `react-dnd` instead as it's a significantly smaller package
import Link from "next/link";
import React, { ReactNode, useCallback } from "react";
import Button from "react-bootstrap/Button";
import Table from "react-bootstrap/Table";
Expand Down Expand Up @@ -133,18 +134,18 @@ export function SourceSettings({
key={`${sourceRow[0]}-name-column`}
style={{ verticalAlign: "middle", width: 50 + "%" }}
>
{maybeSourceDocuments[sourceRow[0]].external_link != null ? (
<a
{(maybeSourceDocuments[sourceRow[0]].external_link ?? "")
.length > 0 ? (
<Link
href={
maybeSourceDocuments[sourceRow[0]].external_link ??
undefined
maybeSourceDocuments[sourceRow[0]].external_link ?? ""
}
target="_blank"
>
{maybeSourceDocuments[sourceRow[0]].name}
</a>
</Link>
) : (
<a>{maybeSourceDocuments[sourceRow[0]].name}</a>
maybeSourceDocuments[sourceRow[0]].name
)}
</td>
<td
Expand Down

0 comments on commit 760c1be

Please sign in to comment.