Skip to content

Commit

Permalink
Merge branch 'url-filter-params'
Browse files Browse the repository at this point in the history
* url-filter-params:
  gatsby create page fix;
  filter-selection and list-datasets styles;
  Rendered columns are also filters
  Pages can define which columns are rendered
  Improve styling of <DatasetSelect>
  Dataset visualization as prop to <DatasetSelect>
  Add docs for <DatasetSelect> and type check props
  Add pathname filter parsing to SARS-CoV-2 page
  Update URLs to reflect parent page
  Remove gatsby-plugin-create-client-paths
  Only filter to valid values
  Refactor `Datasets/*`
  Lift URL filter parsing to <DatasetSelect>
  [gatsby] Update how influenza pages are configured
  apply url params as filter to /influenza datasets;
  • Loading branch information
jameshadfield committed Apr 16, 2021
2 parents d3343ce + b909018 commit 7f658e1
Show file tree
Hide file tree
Showing 16 changed files with 678 additions and 506 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ rules:
react/jsx-filename-extension: [1, { "extensions": [".js", ".jsx"] }]
react/jsx-first-prop-new-line: off
react/no-did-mount-set-state: off
react/require-default-props: off
react/no-did-update-set-state: off
react/prop-types: off # possibly reinstate
react/sort-comp: off # possibly reinstate
Expand Down
21 changes: 16 additions & 5 deletions static-site/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,28 +194,39 @@ exports.createPages = ({graphql, actions}) => {
});

// Create page detailing all things SARS-CoV-2
// Note that this is in src/sections, not src/pages. This is because we don't
// want to render anything at the exact url of nextstrain.org/sars-cov-2-page
// and Gatsby auto-creates such pages from any jsx file in the src/pages directory.
// Many of the pages created here are in src/sections for the same reason.
createPage({
path: "/sars-cov-2",
component: path.resolve("src/pages/sars-cov-2.jsx")
matchPath: "/sars-cov-2/*",
component: path.resolve("src/sections/sars-cov-2-page.jsx")
});

// Create page detailing all things seasonal influenza
/* NOTE: we are using "influenza" URLs for dev purposes only. This will be switched to "flu"
when this functionality is released & publicized. For unknown reasons, if the component is named
`influenza.jsx` we lose the matchPath functionality. Therefore in a future commit we should simultaneously
change the path & matchPath to "flu", change the page back to `influenza.jsx`, and update the routing logic of the
server so that URLs starting with /flu which define valid (core) datasets, and only these, are sent to auspice,
with the rest falling through to Gatsby to be handled here */
createPage({
path: "/influenza",
component: path.resolve("src/pages/influenza.jsx")
matchPath: "/influenza/*",
component: path.resolve("src/sections/influenza-page.jsx")
});

// search pages
createPage({
path: `/search`,
component: path.resolve("src/pages/sequence-search-list.jsx"),
component: path.resolve("src/sections/sequence-search-list.jsx"),
context: {searchPages}
});
searchPages.forEach(({urlName, displayName, jsonUrl}) => {
console.log(`created page at /search/${urlName}`);
createPage({
path: `/search/${urlName}`,
component: path.resolve("src/pages/sequence-search.jsx"),
component: path.resolve("src/sections/sequence-search.jsx"),
context: {urlName, displayName, jsonUrl}
});
});
Expand Down
72 changes: 0 additions & 72 deletions static-site/src/components/Datasets/dataset-collapsible-menus.jsx

This file was deleted.

20 changes: 0 additions & 20 deletions static-site/src/components/Datasets/dataset-link.jsx

This file was deleted.

Loading

0 comments on commit 7f658e1

Please sign in to comment.