From ea1ddd48d2b445b01e54ea488056e9a14989b08c Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Fri, 25 Aug 2023 04:20:08 +0900 Subject: [PATCH] Header search, re-add breadcrumbs, other small features (#288) Closes #266 Closes #227 Closes #77 Closes #80 Summary of changes (for reviewers, going commit by commit is better for this PR): - rework 404 redirect - add "BETA" to prod banner - update category icons - change css data attr selectors to class selectors - show taxon info in node badge for genes - in node badge, remove link option. instead, show link unless already on page being linked to (current node). - rework and reinsert breadcrumbs, but only hook up to hierarchy - refactor predicate badge - dont automatically change case of labels in select components, do that from parent using it - in multi select component, solo-select first option clicked - add icon support to multi select component - in select components, fix hover then enter press bug - tweak table component styling, save expanded state to local storage - fix tab component keyboard wrapping behavior - add search box to header and change styles to accommodate - tweak homepage nexus visualization - on testbed, show all custom icons - change tab search higher-order-component to accommodate search box in header - re-add breadcrumbs section - add "back to search" button at top of node page --- frontend/public/404.html | 18 +- frontend/src/App.vue | 3 +- frontend/src/api/index.ts | 7 +- ...omy.svg => category-anatomical-entity.svg} | 7 +- frontend/src/assets/icons/category-case.svg | 7 +- .../assets/icons/category-causal-disease.svg | 7 +- .../src/assets/icons/category-causal-gene.svg | 7 +- .../src/assets/icons/category-cell-line.svg | 7 +- .../icons/category-correlated-disease.svg | 7 +- .../assets/icons/category-correlated-gene.svg | 7 +- .../src/assets/icons/category-disease.svg | 7 +- .../src/assets/icons/category-function.svg | 7 +- frontend/src/assets/icons/category-gene.svg | 7 +- .../src/assets/icons/category-genotype.svg | 7 +- .../src/assets/icons/category-homolog.svg | 7 +- .../src/assets/icons/category-interaction.svg | 7 +- frontend/src/assets/icons/category-model.svg | 7 +- .../icons/category-ortholog-disease.svg | 7 +- .../icons/category-ortholog-phenotype.svg | 7 +- .../src/assets/icons/category-pathway.svg | 7 +- .../icons/category-phenotypic-feature.svg | 7 +- .../icons/category-phenotypic-quality.svg | 12 + .../src/assets/icons/category-publication.svg | 7 +- .../src/assets/icons/category-variant.svg | 7 +- frontend/src/assets/icons/loading.svg | 9 +- .../src/assets/icons/phenotype-search.svg | 62 +-- frontend/src/assets/icons/toolbox.svg | 5 +- frontend/src/components/AppAccordion.vue | 8 +- frontend/src/components/AppButton.vue | 31 +- frontend/src/components/AppDetail.vue | 11 +- frontend/src/components/AppFlex.vue | 23 +- frontend/src/components/AppGallery.vue | 8 +- frontend/src/components/AppHeading.vue | 4 +- frontend/src/components/AppIcon.vue | 30 +- frontend/src/components/AppNodeBadge.vue | 29 +- frontend/src/components/AppPost.vue | 7 +- frontend/src/components/AppPredicateBadge.vue | 19 +- frontend/src/components/AppSection.vue | 12 +- .../src/components/AppSelectAutocomplete.vue | 13 +- frontend/src/components/AppSelectMulti.vue | 69 +-- frontend/src/components/AppSelectSingle.vue | 28 +- frontend/src/components/AppSelectTags.vue | 22 +- frontend/src/components/AppStatus.vue | 15 +- frontend/src/components/AppTable.vue | 439 +++++++++--------- frontend/src/components/AppTabs.vue | 32 +- frontend/src/components/AppTextbox.vue | 10 +- frontend/src/components/AppTile.vue | 4 +- frontend/src/components/AppUpload.vue | 5 +- frontend/src/components/TheFooter.vue | 2 +- frontend/src/components/TheHeader.vue | 39 +- frontend/src/components/TheNexus.vue | 37 +- frontend/src/components/TheSnackbar.vue | 2 +- .../src/components/TheTableOfContents.vue | 10 +- frontend/src/global/breadcrumbs.ts | 13 +- frontend/src/global/styles.scss | 9 +- frontend/src/global/variables.scss | 11 +- frontend/src/main.ts | 1 - frontend/src/pages/PageHome.vue | 4 +- frontend/src/pages/PageTestbed.vue | 42 +- frontend/src/pages/about/PageAbout.vue | 2 +- .../src/pages/about/PagePhenomicsFirst.vue | 2 +- frontend/src/pages/explore/PageExplore.vue | 2 +- .../pages/explore/TabPhenotypeExplorer.vue | 2 +- frontend/src/pages/explore/TabSearch.vue | 76 ++- .../src/pages/node/AssociationsSummary.vue | 2 + frontend/src/pages/node/AssociationsTable.vue | 21 +- frontend/src/pages/node/EvidenceViewer.vue | 11 +- frontend/src/pages/node/PageNode.vue | 2 + .../src/pages/node/SectionAssociations.vue | 9 +- .../src/pages/node/SectionBreadcrumbs.vue | 75 +++ frontend/src/pages/node/SectionHierarchy.vue | 20 +- frontend/src/pages/node/SectionTitle.vue | 35 +- frontend/src/router/index.ts | 28 +- frontend/src/util/object.ts | 4 +- frontend/tsconfig.json | 8 +- frontend/unit/uptime.test.ts | 8 +- 76 files changed, 914 insertions(+), 638 deletions(-) rename frontend/src/assets/icons/{category-anatomy.svg => category-anatomical-entity.svg} (75%) create mode 100644 frontend/src/assets/icons/category-phenotypic-quality.svg create mode 100644 frontend/src/pages/node/SectionBreadcrumbs.vue diff --git a/frontend/public/404.html b/frontend/public/404.html index 8522cdbc5..b3a086ee0 100644 --- a/frontend/public/404.html +++ b/frontend/public/404.html @@ -10,18 +10,16 @@ * everything. */ - /** turn on "preserve log" in chrome dev tools to still see this after nav */ - console.info("Redirecting from:", window.location); - console.info("With state:", window.history.state); + /** turn on "preserve log" in dev tools to still see this after nav */ + console.info("Redirecting from:", location); + console.info("With state:", history.state); - /** get redirect and state */ - const { origin, pathname, search, hash } = window.location; - const { state } = window.history; + /** save redirect and state */ + sessionStorage.redirect = location.href; + sessionStorage.redirectState = JSON.stringify(history.state); - /** set redirect and state */ - window.sessionStorage.redirect = pathname + search + hash; - window.sessionStorage.redirectState = JSON.stringify(state); - window.location = "/"; + /** navigate */ + location = "/"; diff --git a/frontend/src/App.vue b/frontend/src/App.vue index e3fb13bf8..cefeb7cb1 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -5,7 +5,8 @@