Skip to content

Commit

Permalink
[Platform]: AOTF Export info text and target switch public (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmehta committed Nov 13, 2023
1 parent 12c6103 commit 67ae7bb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,6 @@ function DataMenu() {
label="Show data sources controls"
/>
</FormGroup>
{/* <FormGroup>
<FormControlLabel
disabled={isPrioritisation}
control={
<Checkbox
color="primary"
checked={enableIndirect}
onChange={() => setEnableIndirect(!enableIndirect)}
/>
}
label="Enable Indirect"
/>
</FormGroup> */}
</PopoverContent>
</Popover>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,6 @@ function DataDownloader({ fileStem }) {
} = useAotfContext();
const [onlyPinnedCheckBox, setOnlyPinnedCheckBox] = useState(false);
const [weightControlCheckBox, setWeightControlCheckBox] = useState(modifiedSourcesDataControls);
const [requiredControlCheckBox, setRequiredControlCheckBox] = useState(
modifiedSourcesDataControls
);
const [onlyTargetData, setOnlyTargetData] = useState(false);

const [downloading, setDownloading] = useState(false);
Expand Down Expand Up @@ -205,7 +202,7 @@ function DataDownloader({ fileStem }) {
sortBy: sorting[0].id,
enableIndirect,
datasources: dataSourcesWeights,
...(requiredControlCheckBox && {
...(weightControlCheckBox && {
aggregationFilters: dataSourcesRequired.map(el => ({
name: el.name,
path: el.path,
Expand Down Expand Up @@ -271,7 +268,6 @@ function DataDownloader({ fileStem }) {
};

useEffect(() => {
setRequiredControlCheckBox(modifiedSourcesDataControls);
setWeightControlCheckBox(modifiedSourcesDataControls);
}, [modifiedSourcesDataControls]);

Expand Down Expand Up @@ -299,6 +295,11 @@ function DataDownloader({ fileStem }) {
>
<DialogTitle>Export: {fileStem} data</DialogTitle>
<DialogContent>
<Typography sx={{m: theme=> `${theme.spacing(1)} 0 ${theme.spacing(4)} 0`}} variant="subtitle2" gutterBottom>
By clicking on the download tabs from this view, you will export the entire association
table (default option). Please expand the advanced options to export your own customised
view.
</Typography>
<BorderAccordion>
<AccordionSummary expandIcon={<FontAwesomeIcon icon={faCaretDown} size="lg" />}>
<Typography variant="body1">Advanced export options:</Typography>
Expand Down Expand Up @@ -385,18 +386,7 @@ function DataDownloader({ fileStem }) {
onChange={e => setWeightControlCheckBox(e.target.checked)}
/>
}
label="Include custom weight controls"
/>
<FormControlLabel
sx={{ pl: 1 }}
control={
<Checkbox
checked={requiredControlCheckBox}
disabled={!modifiedSourcesDataControls || downloading}
onChange={e => setRequiredControlCheckBox(e.target.checked)}
/>
}
label="Include custom required control"
label="Include custom controls"
/>
<FormControlLabel
sx={{ pl: 1 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PrivateWrapper } from 'ui';
import { Box } from '@mui/material';
import { PrivateWrapper } from "ui";
import { Box } from "@mui/material";
import {
TableAssociations,
AdvanceOptionsMenu,
Expand All @@ -11,8 +11,8 @@ import {
ControlsSection,
OptionsControlls,
AotFLoader,
} from '../../../components/AssociationsToolkit';
import DISEASE_ASSOCIATIONS_QUERY from './DiseaseAssociationsQuery.gql';
} from "../../../components/AssociationsToolkit";
import DISEASE_ASSOCIATIONS_QUERY from "./DiseaseAssociationsQuery.gql";

function AssociationsWrapper() {
const { initialLoading, id } = useAotfContext();
Expand All @@ -22,18 +22,14 @@ function AssociationsWrapper() {
return (
<>
<ControlsSection>
<Box sx={{ display: 'flex', flexWrap: 'wrap' }}>
<Box sx={{ display: "flex", flexWrap: "wrap" }}>
<SearhInput />
<OptionsControlls>
<AdvanceOptionsMenu />
<DataDownloader fileStem={`${id}-associated-targets`} />
</OptionsControlls>
</Box>
<div>
<PrivateWrapper>
<TargetPrioritisationSwitch />
</PrivateWrapper>
</div>
<TargetPrioritisationSwitch />
</ControlsSection>
<TableAssociations />
</>
Expand All @@ -43,11 +39,7 @@ function AssociationsWrapper() {
/* DISEASE ASSOCIATION */
function DiseaseAssociations({ efoId }) {
return (
<AssociationsProvider
id={efoId}
entity="disease"
query={DISEASE_ASSOCIATIONS_QUERY}
>
<AssociationsProvider id={efoId} entity="disease" query={DISEASE_ASSOCIATIONS_QUERY}>
<AssociationsWrapper />
</AssociationsProvider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function TherapeuticAreasDrawer({ therapeuticAreas }) {

return (
<>
<MUILink onClick={toggleDrawer} className={classes.drawerLink}>
<MUILink underline="none" onClick={toggleDrawer} className={classes.drawerLink}>
{therapeuticAreas.length} areas
</MUILink>

Expand Down

0 comments on commit 67ae7bb

Please sign in to comment.