From 6edad65dd6dc4e0ba8bc768bb5ee42744ce30b1a Mon Sep 17 00:00:00 2001 From: James McLaughlin Date: Sat, 12 Aug 2023 22:02:21 +0100 Subject: [PATCH 1/7] add lipidmaps --- ebi_ontologies.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ebi_ontologies.json b/ebi_ontologies.json index ce0b5e363..4d314a039 100644 --- a/ebi_ontologies.json +++ b/ebi_ontologies.json @@ -17,6 +17,14 @@ "ontology_purl": "file:///nfs/production/parkinso/spot/ols4/prod/local_ontologies/swisslipids.ttl", "preferredPrefix": "SLM", "base_uri": ["https://swisslipids.org/rdf/SLM_"] + }, + { + "id": "lipidmaps", + "title": "LIPID MAPS", + "ontology_purl": "https://lipidmaps.org/files/?file=sparql_lipids&ext=ttl", + "preferredPrefix": "LIPIDMAPS", + "homepage": "https://lipidmaps.org", + "base_uri": ["https://www.lipidmaps.org/rdf/"] }, { "id": "oio", From 3e822f26f4926f91bba7d1099d93fdda0f36b371 Mon Sep 17 00:00:00 2001 From: Josh Lagrimas Date: Thu, 14 Sep 2023 16:12:12 +0100 Subject: [PATCH 2/7] issue-503: refactor home and search pages to be responsive --- frontend/src/components/Footer.tsx | 2 + frontend/src/pages/home/Home.tsx | 16 +- frontend/src/pages/search/Search.tsx | 278 ++++++++++++++------------- 3 files changed, 158 insertions(+), 138 deletions(-) diff --git a/frontend/src/components/Footer.tsx b/frontend/src/components/Footer.tsx index 48e4a059d..13b935c56 100644 --- a/frontend/src/components/Footer.tsx +++ b/frontend/src/components/Footer.tsx @@ -10,12 +10,14 @@ export default function Footer() { X diff --git a/frontend/src/pages/home/Home.tsx b/frontend/src/pages/home/Home.tsx index 21bed18ef..b9fcebbf6 100644 --- a/frontend/src/pages/home/Home.tsx +++ b/frontend/src/pages/home/Home.tsx @@ -32,8 +32,8 @@ export default function Home() { {banner} )} -
-
+
+
Welcome to the EMBL-EBI Ontology Lookup Service @@ -61,8 +61,8 @@ export default function Home() {
-
-
+
+
@@ -91,7 +91,7 @@ export default function Home() { .

-
+
-
+ -
-
+
+
Data Content diff --git a/frontend/src/pages/search/Search.tsx b/frontend/src/pages/search/Search.tsx index 252c8e50a..8cc433829 100644 --- a/frontend/src/pages/search/Search.tsx +++ b/frontend/src/pages/search/Search.tsx @@ -28,6 +28,7 @@ export default function Search() { const [page, setPage] = useState(0); const [rowsPerPage, setRowsPerPage] = useState(10); const [ontologyFacetQuery, setOntologyFacetQuery] = useState(""); + const [hideFilters, setHideFilters] = useState(true); const ontologyFacets = facets && Object.keys(facets).length > 0 ? facets["ontologyId"] : {}; @@ -121,147 +122,164 @@ export default function Search() {
-
-
-
-
+
+
+
+
{`Showing ${ totalResults > rowsPerPage ? rowsPerPage : totalResults } from a total of ${totalResults}`}
- {totalResults > 0 ? ( -
-
Type
-
- {typeFacets && Object.keys(typeFacets).length > 0 - ? Object.keys(typeFacets) - .sort((a, b) => { - const ac = a ? a.toString() : ""; - const bc = b ? b.toString() : ""; - return ac.localeCompare(bc); - }) - .map((key) => { - if (key !== "entity" && typeFacets[key] > 0) { - return ( - - ); - } else return null; - }) - : null} -
-
Ontology
-
- { - if (event.target.value) { - setOntologyFacetFiltered( - Object.fromEntries( - Object.entries(ontologyFacets).filter((key) => - key - .toString() - .toLowerCase() - .includes(event.target.value.toLowerCase()) - ) + +
+ {totalResults > 0 ? ( +
+
Type
+
+ {typeFacets && Object.keys(typeFacets).length > 0 + ? Object.keys(typeFacets) + .sort((a, b) => { + const ac = a ? a.toString() : ""; + const bc = b ? b.toString() : ""; + return ac.localeCompare(bc); + }) + .map((key) => { + if (key !== "entity" && typeFacets[key] > 0) { + return ( + + ); + } else return null; + }) + : null} +
+
Ontology
+
+ { + if (event.target.value) { + setOntologyFacetFiltered( + Object.fromEntries( + Object.entries(ontologyFacets).filter((key) => + key + .toString() + .toLowerCase() + .includes(event.target.value.toLowerCase()) ) - ); - setOntologyFacetQuery(event.target.value); - } else { + ) + ); + setOntologyFacetQuery(event.target.value); + } else { + setOntologyFacetFiltered(ontologyFacets); + setOntologyFacetQuery(""); + } + }} + /> + {ontologyFacetQuery ? ( +
+ -
- ) : null} -
-
- {ontologyFacetFiltered && - Object.keys(ontologyFacetFiltered).length > 0 - ? Object.keys(ontologyFacetFiltered) - .sort((a, b) => { - const ac = a ? a.toString() : ""; - const bc = b ? b.toString() : ""; - return ac.localeCompare(bc); - }) - .map((key) => { - if (ontologyFacetFiltered[key] > 0) { - return ( - - ); - } else return null; - }) - : null} -
+ }} + > + + +
+ ) : null}
- ) : null} -
+
+ {ontologyFacetFiltered && + Object.keys(ontologyFacetFiltered).length > 0 + ? Object.keys(ontologyFacetFiltered) + .sort((a, b) => { + const ac = a ? a.toString() : ""; + const bc = b ? b.toString() : ""; + return ac.localeCompare(bc); + }) + .map((key) => { + if (ontologyFacetFiltered[key] > 0) { + return ( + + ); + } else return null; + }) + : null} +
+
+ ) : null}
-
-
-
+
+
+
Search results for: {search}
-
-
+
+ +