From d06425c8cd230409c07e63125df1f7b74adf6f97 Mon Sep 17 00:00:00 2001 From: Jover Date: Fri, 3 Jan 2020 16:51:19 -0800 Subject: [PATCH 1/3] fix back button break that displays 404 page In the `changePage` action, use `chooseDisplayComponentFromURL(path)` to determine what to set as `displayComponent`. This has some hard coded known url parts that should display the Auspice splash page instead of a dataset. --- src/actions/navigation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions/navigation.js b/src/actions/navigation.js index 856534e18..c4247891d 100644 --- a/src/actions/navigation.js +++ b/src/actions/navigation.js @@ -63,7 +63,7 @@ export const changePage = ({ const action = { type: PAGE_CHANGE, path, - displayComponent: "datasetLoader", + displayComponent: chooseDisplayComponentFromURL(path), pushState: push, query }; From c9cdbaa252029e063a754c5c5c772794024c8473 Mon Sep 17 00:00:00 2001 From: Jover Date: Fri, 3 Jan 2020 16:57:37 -0800 Subject: [PATCH 2/3] add "groups" to hardcoded splash pages --- src/actions/navigation.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/actions/navigation.js b/src/actions/navigation.js index c4247891d..05233d5b5 100644 --- a/src/actions/navigation.js +++ b/src/actions/navigation.js @@ -16,7 +16,8 @@ export const chooseDisplayComponentFromURL = (url) => { (parts.length === 1 && parts[0] === "staging") || (parts.length === 1 && parts[0] === "community") || (parts.length === 1 && parts[0] === "narratives") || - (parts.length === 2 && parts[0] === "local" && parts[1] === "narratives") + (parts.length === 2 && parts[0] === "local" && parts[1] === "narratives") || + (parts.length === 2 && parts[0] === "groups") ) { return "splash"; } else if (parts[0] === "status") { From 8904f76e1c226066987ef06747eb4d8d059df401 Mon Sep 17 00:00:00 2001 From: james hadfield Date: Mon, 6 Jan 2020 12:32:27 +1300 Subject: [PATCH 3/3] remove (unused) local URLs The "local" prefix in URLs is left over from a former way of accessing datasets & narratives but is no longer used. --- src/actions/navigation.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/actions/navigation.js b/src/actions/navigation.js index 05233d5b5..2149f7c42 100644 --- a/src/actions/navigation.js +++ b/src/actions/navigation.js @@ -12,11 +12,9 @@ export const chooseDisplayComponentFromURL = (url) => { if ( !parts.length || (parts.length === 1 && parts[0] === "") || - (parts.length === 1 && parts[0] === "local") || (parts.length === 1 && parts[0] === "staging") || (parts.length === 1 && parts[0] === "community") || (parts.length === 1 && parts[0] === "narratives") || - (parts.length === 2 && parts[0] === "local" && parts[1] === "narratives") || (parts.length === 2 && parts[0] === "groups") ) { return "splash";