Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: consistent navigate button #553

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions packages/sections/src/credibleSet/GWASColoc/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ import Description from "./Description";
import GWAS_COLOC_QUERY from "./GWASColocQuery.gql";
import { mantissaExponentComparator, variantComparator } from "../../utils/comparators";
import { getStudyCategory } from "../../utils/getStudyCategory";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowRightToBracket } from "@fortawesome/free-solid-svg-icons";
import { Box } from "@mui/material";

const columns = [
{
id: "view",
id: "otherStudyLocus.studyLocusId",
label: "Navigate",
renderCell: ({ otherStudyLocus }) => {
if (!otherStudyLocus) return naLabel;
return <Link to={`./${otherStudyLocus.studyLocusId}`}>view</Link>;
},
renderCell: ({ otherStudyLocus }) => (
<Box sx={{ display: "flex" }}>
<Link to={`./${otherStudyLocus.studyLocusId}`}>
<FontAwesomeIcon icon={faArrowRightToBracket} />
</Link>
</Box>
),
filterValue: false,
exportValue: false,
},
Expand Down
26 changes: 11 additions & 15 deletions packages/sections/src/credibleSet/GWASMolQTL/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,22 @@ import Description from "./Description";
import GWAS_COLOC_QUERY from "./GWASMolQTLColocQuery.gql";
import { mantissaExponentComparator, variantComparator } from "../../utils/comparators";
import { getStudyCategory } from "../../utils/getStudyCategory";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowRightToBracket } from "@fortawesome/free-solid-svg-icons";
import { Box } from "@mui/material";

const columns = [
{
id: "view",
id: "otherStudyLocus.studyLocusId",
label: "Navigate",
renderCell: ({ otherStudyLocus }) => {
if (!otherStudyLocus) return naLabel;
return <Link to={`./${otherStudyLocus.studyLocusId}`}>view</Link>;
},
renderCell: ({ otherStudyLocus }) => (
<Box sx={{ display: "flex" }}>
<Link to={`./${otherStudyLocus.studyLocusId}`}>
<FontAwesomeIcon icon={faArrowRightToBracket} />
</Link>
</Box>
),
filterValue: false,
exportValue: false,
},
{
id: "otherStudyLocus.study.target",
label: "Gene",
renderCell: ({ otherStudyLocus }) => {
const study = otherStudyLocus?.study;
if (!study?.target) return naLabel;
return <Link to={`../study/${study.target.id}`}>{study.target.approvedSymbol}</Link>;
},
},
{
id: "otherStudyLocus.study.studyId",
Expand Down
15 changes: 11 additions & 4 deletions packages/sections/src/study/GWASCredibleSets/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,27 @@ import {
DisplayVariantId,
OtTable,
} from "ui";
import { Box } from "@mui/material";
import { naLabel } from "../../constants";
import { definition } from ".";
import Description from "./Description";
import GWAS_CREDIBLE_SETS_QUERY from "./GWASCredibleSetsQuery.gql";
import { mantissaExponentComparator, variantComparator } from "../../utils/comparators";
import ManhattanPlot from "./ManhattanPlot";
import { faArrowRightToBracket } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

const columns = [
{
id: "view",
id: "studyLocusId",
label: "Navigate",
renderCell: ({ studyLocusId }) => <Link to={`../credible-set/${studyLocusId}`}>view</Link>,
filterValue: false,
exportValue: false,
renderCell: ({ studyLocusId }) => (
<Box sx={{ display: "flex" }}>
<Link to={`/credible-set/${studyLocusId}`}>
<FontAwesomeIcon icon={faArrowRightToBracket} />
</Link>
</Box>
),
},
{
id: "leadVariant",
Expand Down
15 changes: 11 additions & 4 deletions packages/sections/src/study/QTLCredibleSets/Body.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import { useQuery } from "@apollo/client";
import { Link, SectionItem, ScientificNotation, DisplayVariantId, OtTable } from "ui";
import { Box } from "@mui/material";
import { naLabel } from "../../constants";
import { definition } from ".";
import Description from "./Description";
import QTL_CREDIBLE_SETS_QUERY from "./QTLCredibleSetsQuery.gql";
import { mantissaExponentComparator, variantComparator } from "../../utils/comparators";
import { faArrowRightToBracket } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

const columns = [
{
id: "view",
id: "studyLocusId",
label: "Navigate",
renderCell: ({ studyLocusId }) => <Link to={`../credible-set/${studyLocusId}`}>view</Link>,
filterValue: false,
exportValue: false,
renderCell: ({ studyLocusId }) => (
<Box sx={{ display: "flex" }}>
<Link to={`/credible-set/${studyLocusId}`}>
<FontAwesomeIcon icon={faArrowRightToBracket} />
</Link>
</Box>
),
},
{
id: "leadVariant",
Expand Down
8 changes: 7 additions & 1 deletion packages/sections/src/variant/QTLCredibleSets/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import Description from "./Description";
import QTL_CREDIBLE_SETS_QUERY from "./QTLCredibleSetsQuery.gql";
import { mantissaExponentComparator, variantComparator } from "../../utils/comparators";
import { ReactNode } from "react";
import { faArrowRightToBracket } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

type getColumnsType = {
id: string;
Expand All @@ -28,7 +30,11 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) {
id: "studyLocusId",
label: "Navigate",
renderCell: ({ studyLocusId }) => (
<Link to={`../credible-set/${studyLocusId}`}>{studyLocusId}</Link>
<Box sx={{ display: "flex", justifyContent: "center" }}>
<Link to={`/credible-set/${studyLocusId}`}>
<FontAwesomeIcon icon={faArrowRightToBracket} />
</Link>
</Box>
),
},
{
Expand Down
Loading