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

[Platform]: AOTF Export info text and target switch public #286

Merged
merged 1 commit into from
Nov 13, 2023
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
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
Loading