Skip to content

Commit

Permalink
Add pathname filter parsing to SARS-CoV-2 page
Browse files Browse the repository at this point in the history
Will allow URLs such as sars-cov-2/a/b/c to show as sars-cov-2 and
have a/b/c interpreted as filters. Note that this doesn't quite work as
intended yet due to how the filtering options are collected from the
sars-cov-2 YAML
  • Loading branch information
jameshadfield committed Apr 9, 2021
1 parent 00b58bc commit 953651d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion static-site/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ exports.createPages = ({graphql, actions}) => {
// Create page detailing all things SARS-CoV-2
createPage({
path: "/sars-cov-2",
component: path.resolve("src/pages/sars-cov-2.jsx")
matchPath: "/sars-cov-2/*",
component: path.resolve("src/pages/sars-cov-2-page.jsx")
});

/* NOTE: we are using "influenza" URLs for dev purposes only. This will be switched to "flu"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,14 @@ class Index extends React.Component {
<MediumSpacer />
<div className="col-md-1"/>
<div className="col-md-10">
{this.state.filterParsed && <DatasetSelect datasets={this.state.filterList} noDates/>}
{this.state.filterParsed && (
<DatasetSelect
datasets={this.state.filterList}
noDates
urlDefinedFilterPath={this.props["*"]}
intendedUri={this.props.uri}
/>
)}
</div>
</div>
</div>
Expand Down

0 comments on commit 953651d

Please sign in to comment.