Skip to content

Commit

Permalink
Add UI handling for group setting not found
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin authored and tsibley committed Feb 15, 2023
1 parent 22e49a3 commit 897aeb1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions static-site/src/sections/individual-group-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@ class Index extends React.Component {
let bannerTitle, bannerContents;
// Set up a banner if dataset doesn't exist
if (this.state.nonExistentPath) {
bannerTitle = this.state.nonExistentPath.startsWith("narratives/")
? `The narrative "nextstrain.org/groups/${groupName}/${this.state.nonExistentPath}" doesn't exist.`
: `The dataset "nextstrain.org/groups/${groupName}/${this.state.nonExistentPath}" doesn't exist.`;
if (this.state.nonExistentPath.startsWith("narratives/")) {
bannerTitle = `The narrative "nextstrain.org/groups/${groupName}/${this.state.nonExistentPath}" doesn't exist.`;
}
else if (this.state.nonExistentPath.startsWith("settings/")) {
bannerTitle = `The setting "nextstrain.org/groups/${groupName}/${this.state.nonExistentPath}" doesn't exist.`;
}
else {
bannerTitle = `The dataset "nextstrain.org/groups/${groupName}/${this.state.nonExistentPath}" doesn't exist.`;
}
bannerContents = `Here is the page for the "${groupName}" Nextstrain Group.`;
}
// Set up a banner or update the existing one if the group doesn't exist
Expand Down

0 comments on commit 897aeb1

Please sign in to comment.