Skip to content

Commit

Permalink
[Platform]: added facets tooltip info icon (opentargets#474)
Browse files Browse the repository at this point in the history
* added facets tooltip info icon

* adding facet info as part of tip
  • Loading branch information
chinmehta authored Sep 17, 2024
1 parent 3df4138 commit 7867788
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 22 deletions.
41 changes: 25 additions & 16 deletions apps/platform/src/components/Facets/FacetsSuggestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Box } from "@mui/material";
import { useAotfContext } from "../AssociationsToolkit";
import { ENTITY } from "./facetsTypes";
import { Link } from "ui";

const EXAMPLE = {
[ENTITY.DISEASE]: "Measurement",
[ENTITY.DISEASE]: "Eczema",
[ENTITY.TARGET]: "Enzyme",
};

Expand All @@ -15,22 +16,30 @@ function FacetsSuggestion(): ReactElement {

return (
<Box sx={{ display: "flex", alignItems: "center" }}>
<Box>
<Box
sx={{
display: "flex",
typography: "subtitle1",
fontWeight: "bold",
alignItems: "center",
gap: theme => theme.spacing(1),
}}
>
<FontAwesomeIcon icon={faLightbulb} />
Tip:
<Box sx={{ typography: "caption" }}>
<Box>
<b>How do facet filters work?</b>
<ul style={{ paddingLeft: "15px" }}>
<li>
Please search by {entityToGet} or filter by {entityToGet} category. Example:{" "}
{EXAMPLE[entityToGet]}
</li>
<li>
Filters across categories use <b>AND</b>
</li>
<li>
Filters within a category use <b>OR</b>
</li>
</ul>
</Box>
<Box sx={{ typography: "body2" }}>
Please search by {entityToGet} or filter by {entityToGet} category. Example:{" "}
{EXAMPLE[entityToGet]}
<Box sx={{ w: 1, display: "flex", justifyContent: "end" }}>
<Link
to="https://platform-docs.opentargets.org/web-interface/associations-on-the-fly#filtering-functionality"
external
footer={false}
>
Read more details here.
</Link>
</Box>
</Box>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion apps/platform/src/components/Facets/facetsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const FacetsSelect = styled(Select)(({ theme }) => ({
}));

export const FacetsAutocomplete = styled(Autocomplete)(({ theme }) => ({
minWidth: "280px",
minWidth: "320px",
width: 1,
maxWidth: 1,
flexWrap: "nowrap",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function DiseaseAssociations(pros: DiseaseAssociationsProps): ReactElement {
<FacetsSearch />
<AdvanceOptionsMenu />
<DataUploader />
<Divider orientation="vertical" />
<Divider orientation="vertical" flexItem />
<DataDownloader />
<AotfApiPlayground />
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ function TargetAssociations({ ensgId }: TargetAssociationsProps): ReactElement {
<AssociationsFocusProvider>
<>
<ControlsSection>
<Box
sx={{ flex: 2, display: "flex", flexWrap: "wrap", gap: theme => theme.spacing(2) }}
>
<Box sx={{ flex: 2, display: "flex", flexWrap: "wrap", gap: 2 }}>
<FacetsSearch />
<AdvanceOptionsMenu />
<DataUploader />
<Divider orientation="vertical" />
<Divider orientation="vertical" flexItem />
<DataDownloader />
<AotfApiPlayground />
</Box>
Expand Down

0 comments on commit 7867788

Please sign in to comment.