Skip to content

Commit

Permalink
Header search, re-add breadcrumbs, other small features (#288)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vincerubinetti committed Aug 24, 2023
1 parent dfa7826 commit ea1ddd4
Show file tree
Hide file tree
Showing 76 changed files with 914 additions and 638 deletions.
18 changes: 8 additions & 10 deletions frontend/public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "/";
</script>
</body>
</html>
3 changes: 2 additions & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<template>
<TheBanner>
This web app is the
<strong v-if="apiName === 'beta'">BETA VERSION</strong
<strong v-if="apiName === 'v3'">BETA VERSION</strong
><strong v-if="apiName === 'beta'">BETA VERSION</strong
><strong v-if="apiName === 'dev'">DEV VERSION</strong> successor to the
<AppLink to="https://monarchinitiative.org/">old web app here</AppLink>. Not
all features are implemented yet. Please use the feedback form to tell us
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** base biolink api url */
export const biolink = "https://api.monarchinitiative.org/api";

/** served location of web app, verbatim from browser address bar */
const url = new URL(window.location.href);
/** served location of web app, from address bar or storage redirect */
const url = new URL(window.sessionStorage.redirectHref || window.location.href);

/** get api name/version to use */

Expand Down Expand Up @@ -50,7 +50,6 @@ if (apiName === "relative") monarch = suffix;

export { monarch };

/** debug */
console.info({ fromParam, fromEnv, fromDomain, apiName, monarch });

/**
Expand Down Expand Up @@ -107,7 +106,6 @@ export const request = async <Response>(
/** first check if request is cached */
let response = await cache.match(request);

/** log details for debugging (except don't clutter logs when running tests) */
if (import.meta.env.MODE !== "test") {
console.groupCollapsed(
response ? "📞 Request (cached)" : "📞 Request (new)",
Expand Down Expand Up @@ -148,7 +146,6 @@ export const request = async <Response>(
const parsed: Response =
parse === "text" ? await response.text() : await response.json();

/** log details for debugging (except don't clutter logs when running tests) */
if (import.meta.env.MODE !== "test") {
console.groupCollapsed("📣 Response", endpoint);
console.info("Url", url);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-case.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-causal-disease.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-causal-gene.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-cell-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-correlated-disease.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-correlated-gene.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-disease.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-function.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-gene.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-genotype.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-homolog.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-interaction.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-model.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-ortholog-disease.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-ortholog-phenotype.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-pathway.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-phenotypic-feature.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions frontend/src/assets/icons/category-phenotypic-quality.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-publication.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/assets/icons/category-variant.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions frontend/src/assets/icons/loading.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 13 additions & 49 deletions frontend/src/assets/icons/phenotype-search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ea1ddd4

Please sign in to comment.