-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge main into sweep/add-readme-dev-docs
- Loading branch information
Showing
45 changed files
with
208 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# | ||
# Last Modified: Apr/28/2023 | ||
# | ||
# Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
# Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
# | ||
# License: GPL-3.0 license | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# | ||
# Last Modified: Apr/28/2023 | ||
# | ||
# Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
# Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
# | ||
# License: GPL-3.0 license | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,19 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
||
import React, { useEffect, useContext, useMemo, useState } from "react"; | ||
import { Navigate, Route, Routes, useNavigate, useParams } from "react-router-dom"; | ||
import { | ||
Navigate, | ||
Route, | ||
Routes, | ||
useNavigate, | ||
useParams, | ||
} from "react-router-dom"; | ||
import { ErrorBoundary } from "react-error-boundary"; | ||
import { Box, Grid } from "@mui/material"; | ||
import { useTheme, ThemeProvider, createTheme } from "@mui/material/styles"; | ||
|
@@ -99,22 +105,22 @@ function renderRoutes() { | |
)); | ||
} | ||
|
||
function AuthenticatedRoute ({ element: Component, path, security }) { | ||
function AuthenticatedRoute({ element: Component, path, security }) { | ||
const navigate = useNavigate(); | ||
const isAuthenticated = security === "false" || auth.user.authenticated; | ||
const params = useParams(); | ||
|
||
useEffect(() => { | ||
if (!isAuthenticated) { | ||
if ("jobId" in params) { | ||
path = `${ path }/${ params.jobId }`; | ||
path = `${path}/${params.jobId}`; | ||
} | ||
navigate("/login", { state: { redirect: path } }); | ||
} | ||
}, [auth.user.authenticated, navigate]); | ||
|
||
return isAuthenticated ? <Component /> : null; | ||
}; | ||
} | ||
|
||
function App() { | ||
const theme = useTheme(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
@@ -20,7 +20,7 @@ import Home from "./views/home/Home"; | |
|
||
const kcConfig = | ||
process.env.NODE_ENV === "production" | ||
? JSON.parse(window.REACT_APP_KC_CONFIG.replace(/'/g, "\"")) | ||
? JSON.parse(window.REACT_APP_KC_CONFIG.replace(/'/g, '"')) | ||
: JSON.parse(import.meta.env.VITE_KC_CONFIG); | ||
|
||
const keycloakConfig = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Jun/21/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,14 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
||
import React, { useState, useRef } from "react"; | ||
import { Button, Popover, Tooltip, Typography } from "@mui/material"; | ||
import ValueWithTooltip from "./ValueWithTooltip"; | ||
|
||
const UnstyledButton = ({ onClick, children }) => { | ||
return ( | ||
|
@@ -84,62 +85,6 @@ const getValue = (props) => { | |
); | ||
}; | ||
|
||
const ValueWithTooltip = ({ value, ontology_id, url }) => { | ||
const [isTooltipOpen, setIsTooltipOpen] = useState(false); | ||
const tooltipTimeout = useRef({ current: null }); | ||
|
||
console.log("value", value); | ||
console.log("ontology_id", ontology_id); | ||
console.log("url", url); | ||
|
||
const handleMouseOver = (value) => { | ||
if (value === "NA") { | ||
return; | ||
} | ||
setIsTooltipOpen(true); | ||
clearTimeout(tooltipTimeout.current); | ||
}; | ||
|
||
const handleMouseOut = () => { | ||
tooltipTimeout.current = setTimeout(() => { | ||
setIsTooltipOpen(false); | ||
}, 1000); | ||
}; | ||
|
||
const handleLinkClick = () => { | ||
clearTimeout(tooltipTimeout.current); | ||
window.open(url, "_blank"); | ||
}; | ||
|
||
return ( | ||
<Tooltip | ||
open={isTooltipOpen} | ||
title={ | ||
<span> | ||
Click to open{" "} | ||
<a | ||
href={url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
onClick={handleLinkClick} | ||
> | ||
{ontology_id} | ||
</a> | ||
</span> | ||
} | ||
placement="bottom" | ||
> | ||
<span | ||
onMouseOver={() => handleMouseOver(value)} | ||
onMouseOut={handleMouseOut} | ||
style={{ marginRight: "5px", cursor: "pointer" }} | ||
> | ||
{value} | ||
</span> | ||
</Tooltip> | ||
); | ||
}; | ||
|
||
const PopoverButton = ({ | ||
children, | ||
onClick, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
68 changes: 68 additions & 0 deletions
68
...c/code/views/conversion/ components/clinicalData/components/dataGrid/ValueWithTooltip.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
renders the value of a cell in the data grid with a tooltip that shows the ontology id and a link to the ontology term | ||
This file is part of convert-pheno-ui | ||
Last Modified: Sep/1/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
||
import React, { useState, useRef } from "react"; | ||
import { Tooltip } from "@mui/material"; | ||
|
||
export default function ValueWithTooltip(props) { | ||
const { value, ontology_id, url } = props; | ||
|
||
const [isTooltipOpen, setIsTooltipOpen] = useState(false); | ||
const tooltipTimeout = useRef({ current: null }); | ||
|
||
const handleMouseOver = (value) => { | ||
if (value === "NA") { | ||
return; | ||
} | ||
setIsTooltipOpen(true); | ||
clearTimeout(tooltipTimeout.current); | ||
}; | ||
|
||
const handleMouseOut = () => { | ||
tooltipTimeout.current = setTimeout(() => { | ||
setIsTooltipOpen(false); | ||
}, 1000); | ||
}; | ||
|
||
const handleLinkClick = () => { | ||
clearTimeout(tooltipTimeout.current); | ||
window.open(url, "_blank"); | ||
}; | ||
|
||
return ( | ||
<Tooltip | ||
open={isTooltipOpen} | ||
title={ | ||
<span> | ||
Click to open{" "} | ||
<a | ||
href={url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
onClick={handleLinkClick} | ||
> | ||
{ontology_id} | ||
</a> | ||
</span> | ||
} | ||
placement="bottom" | ||
> | ||
<span | ||
onMouseOver={() => handleMouseOver(value)} | ||
onMouseOut={handleMouseOut} | ||
style={{ marginRight: "5px", cursor: "pointer" }} | ||
> | ||
{value} | ||
</span> | ||
</Tooltip> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Last Modified: Apr/28/2023 | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG (Ivo.leist@cnag.crg.eu) | ||
Copyright (C) 2022-2023 Ivo Christopher Leist - CNAG ([email protected]) | ||
License: GPL-3.0 license | ||
*/ | ||
|
Oops, something went wrong.