Skip to content

Commit

Permalink
Merge branch 'main' into ot-variant-page
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmcn committed Jun 27, 2024
2 parents 818042a + 4a4b1cf commit bf8af85
Show file tree
Hide file tree
Showing 52 changed files with 1,007 additions and 580 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { styled } from "@mui/material/styles";
import { Tooltip } from "ui";

import useAotfContext from "./hooks/useAotfContext";
import useAotfContext from "../hooks/useAotfContext";

const PopoverContent = styled("div")({
padding: "15px",
Expand All @@ -15,8 +15,6 @@ function DataMenu() {
const [anchorEl, setAnchorEl] = useState(null);

const {
enableIndirect,
setEnableIndirect,
activeHeadersControlls,
setActiveHeadersControlls,
displayedTable,
Expand Down Expand Up @@ -44,6 +42,7 @@ function DataMenu() {
variant="outlined"
disableElevation
disabled={isPrioritisation}
sx={{ height: 1, maxHeight: "45px" }}
>
<FontAwesomeIcon icon={faGear} size="lg" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApiPlaygroundDrawer } from "ui";
import useAotfContext from "./hooks/useAotfContext";
import useAotfContext from "../hooks/useAotfContext";

function AotfApiPlayground() {
const {
Expand Down Expand Up @@ -28,6 +28,8 @@ function AotfApiPlayground() {
aggregationFilters,
};

return <ApiPlaygroundDrawer query={query.loc.source.body} variables={variables} />;
return (
<ApiPlaygroundDrawer fullHeight={true} query={query.loc.source.body} variables={variables} />
);
}
export default AotfApiPlayground;
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ import { makeStyles } from "@mui/styles";
import { faCaretDown, faCloudArrowDown } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Tooltip, useConfigContext } from "ui";
import useBatchDownloader from "./hooks/useBatchDownloader";
import useAotfContext from "./hooks/useAotfContext";
import OriginalDataSources from "./static_datasets/dataSourcesAssoc";
import prioritizationCols from "./static_datasets/prioritisationColumns";
import useBatchDownloader from "../hooks/useBatchDownloader";
import useAotfContext from "../hooks/useAotfContext";
import OriginalDataSources from "../static_datasets/dataSourcesAssoc";
import prioritizationCols from "../static_datasets/prioritisationColumns";
import {
getRowsQuerySelector,
getExportedColumns,
getExportedPrioritisationColumns,
createBlob,
getFilteredColumnArray,
} from "./utils/downloads";
import config from "../../config";
} from "../utils/downloads";
import config from "../../../config";
import CopyUrlButton from "./CopyUrlButton";

const { isPartnerPreview } = config.profile;
Expand Down Expand Up @@ -282,6 +282,7 @@ function DataDownloader() {
onClick={handleClickBTN}
variant="outlined"
disableElevation
sx={{ height: 1, maxHeight: "45px" }}
>
<FontAwesomeIcon icon={faCloudArrowDown} size="lg" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link, Tooltip } from "ui";
import * as XLSX from "xlsx";

import useAotfContext from "../hooks/useAotfContext";
import useAotfContext from "../../hooks/useAotfContext";
import ValidationQuery from "./ValidationQuery.gql";
import client from "../../../client";
import client from "../../../../client";
import NestedItem from "./NestedItem";

const BorderAccordion = styled(Accordion)(({ theme }) => ({
Expand Down Expand Up @@ -245,7 +245,7 @@ const FileExample = ({ entity = "target", runAction }) => {
);
};

function DataUploader({ fileStem }) {
function DataUploader() {
const [activeStep, setActiveStep] = useState(0);
const [queryTermsResults, setQueryTermsResults] = useState(null);
const { entityToGet, pinnedEntries, setPinnedEntries } = useAotfContext();
Expand Down Expand Up @@ -407,6 +407,7 @@ function DataUploader({ fileStem }) {
onClick={handleClickBTN}
variant="outlined"
disableElevation
sx={{ height: 1, maxHeight: "45px" }}
>
<FontAwesomeIcon icon={faFileImport} size="lg" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { faXmark } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

import { styled } from "@mui/material/styles";
import dataSources from "../static_datasets/dataSourcesAssoc";
import dataSources from "../../static_datasets/dataSourcesAssoc";

import Slider from "./SliderControl";
import Required from "./RequiredControl";
import { GridContainer } from "../layout";

import useAotfContext from "../hooks/useAotfContext";
import useAotfContext from "../../hooks/useAotfContext";

const CloseContainer = styled("div")({
position: "absolute",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useState, useEffect } from "react";
import { Checkbox } from "@mui/material";
import { styled } from "@mui/material/styles";
import useAotfContext from "../hooks/useAotfContext";
import { checkBoxPayload, getControlChecked } from "../utils";
import useAotfContext from "../../hooks/useAotfContext";
import { checkBoxPayload, getControlChecked } from "../../utils";

const OTCheckbox = styled(Checkbox)`
padding: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { useState, useEffect } from "react";
import { Slider } from "@mui/material";
import { styled } from "@mui/material/styles";

import useAotfContext from "../hooks/useAotfContext";
import { getWightSourceDefault } from "../utils";
import useAotfContext from "../../hooks/useAotfContext";
import { getWightSourceDefault } from "../../utils";

const OTSlider = styled(Slider)({
root: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { styled } from "@mui/material/styles";
import { faXmark, faMagnifyingGlass } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useDebounce } from "ui";
import useAotfContext from "./hooks/useAotfContext";
import useAotfContext from "../hooks/useAotfContext";

const InputContainer = styled(Grid)({
marginRight: "15px",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { useState } from "react";
import { styled, Grid } from "@mui/material";

import AggregationsTooltip from "./AssocTooltip";
import associationsColumns from "../static_datasets/dataSourcesAssoc";
import prioritizationColumns from "../static_datasets/prioritisationColumns";
import { groupViewColumnsBy } from "../utils";
import associationsColumns from "../../static_datasets/dataSourcesAssoc";
import prioritizationColumns from "../../static_datasets/prioritisationColumns";
import { groupViewColumnsBy } from "../../utils";
import { GridContainer } from "../layout";

const AggregationsContainer = styled(GridContainer)({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Popover,
Box,
Fade,
Skeleton,
} from "@mui/material";
import {
faThumbTack,
Expand All @@ -20,8 +21,8 @@ import {
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useHistory } from "react-router-dom";
import useAotfContext from "../hooks/useAotfContext";
import { ENTITIES } from "../utils";
import useAotfContext from "../../hooks/useAotfContext";
import { ENTITIES } from "../../utils";
import { grey } from "@mui/material/colors";

const StyledMenuItem = styled(MenuItem)({
Expand Down Expand Up @@ -73,7 +74,13 @@ const ContextMenuContainer = styled("div", {
function CellName({ cell, colorScale }) {
const history = useHistory();
const contextMenuRef = useRef();
const { entityToGet, pinnedEntries, setPinnedEntries, id: currentEntityId } = useAotfContext();
const {
entityToGet,
pinnedEntries,
setPinnedEntries,
id: currentEntityId,
handleSetInteractors,
} = useAotfContext();
const { loading } = cell.table.getState();
const name = cell.getValue();
const { id } = cell.row;
Expand Down Expand Up @@ -119,7 +126,11 @@ function CellName({ cell, colorScale }) {
history.push(evidenceURL);
};

if (loading) return null;
const loadingWidth = entityToGet === ENTITIES.TARGET ? 50 : 150;
const loadingMargin = entityToGet === ENTITIES.TARGET ? 12 : 2;

if (loading)
return <Skeleton width={loadingWidth} height={35} sx={{ marginLeft: loadingMargin }} />;

return (
<NameContainer>
Expand Down Expand Up @@ -174,14 +185,16 @@ function CellName({ cell, colorScale }) {
<ListItemText>Unpin {entityToGet}</ListItemText>
</StyledMenuItem>
)}
{entityToGet === ENTITIES.TARGET && <Divider />}
{entityToGet === ENTITIES.TARGET && (
<StyledMenuItem disabled>
<ListItemIcon>
<FontAwesomeIcon icon={faBezierCurve} />
</ListItemIcon>
<ListItemText>Target network associations</ListItemText>
<ListItemText>Target interactors</ListItemText>
</StyledMenuItem>
)}

<Divider />
<StyledMenuItem onClick={handleNavigateToEvidence}>
<ListItemIcon>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Suspense } from "react";
import { styled } from "@mui/material/styles";
import { LoadingBackdrop } from "ui";
import { ENTITIES } from "../utils";
import { ENTITIES } from "../../utils";

import targetSections from "../../../sections/targetSections";
import evidenceSections from "../../../sections/evidenceSections";
import targetSections from "../../../../sections/targetSections";
import evidenceSections from "../../../../sections/evidenceSections";

const LoadingContainer = styled("div")({
margin: "25px 0",
Expand Down
Loading

0 comments on commit bf8af85

Please sign in to comment.