From 336147b371721433d6f90d1a6d57e2271692d495 Mon Sep 17 00:00:00 2001 From: Anil Natha Date: Tue, 17 Dec 2024 10:07:46 -0800 Subject: [PATCH 1/5] Updated application to use BrowserRouter instead of HashRouter to improve the structure of our URLs. --- etc/apache2/sites-available/unity-ui.conf | 6 +++++- src/main.tsx | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/etc/apache2/sites-available/unity-ui.conf b/etc/apache2/sites-available/unity-ui.conf index 74a9458..ef9f324 100644 --- a/etc/apache2/sites-available/unity-ui.conf +++ b/etc/apache2/sites-available/unity-ui.conf @@ -13,10 +13,14 @@ Header add Set-Cookie oidc_claim_email=%{OIDC_CLAIM_EMAIL}e;Domain=${ENV_UNITY_UI_WWW_DOMAIN};Path=/;SameSite=strict; + Options -Indexes AllowOverride All Order allow,deny - allow from all + Allow from all + + FallbackResource /index.html + diff --git a/src/main.tsx b/src/main.tsx index ff43d5b..92c978e 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,19 +1,20 @@ import React from 'react' import ReactDOM from 'react-dom/client' -import { HashRouter, Routes, Route } from 'react-router-dom' +import { BrowserRouter, Routes, Route } from 'react-router-dom' import { HelmetProvider } from 'react-helmet-async' import AuthorizationWrapper from './AuthorizationWrapper' +import Config from "./Config" import './index.css' ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( - + - + ) From fea8c6b0aebe90b3de23587d77a984c56b4ccc1d Mon Sep 17 00:00:00 2001 From: Anil Natha Date: Tue, 17 Dec 2024 10:10:31 -0800 Subject: [PATCH 2/5] Updated homepage so that it exists at /home and anytime the path at "/" is visited, it redirects to "/home". --- src/Root.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Root.tsx b/src/Root.tsx index d23561f..3a1df5d 100644 --- a/src/Root.tsx +++ b/src/Root.tsx @@ -1,4 +1,5 @@ import { + Navigate, Route, Routes, } from "react-router-dom" @@ -28,7 +29,6 @@ function Root() { useEffect(() => { - if (healthState.status === "idle") { // Fetch the health data dispatch(getHealthData()); @@ -72,9 +72,9 @@ function Root() { return } /> }) } - {/*} />*/} + } /> } /> - } /> + } /> } /> From fde9610c9e6b808a96d333f89d8fe84c1b84ab66 Mon Sep 17 00:00:00 2001 From: Anil Natha Date: Tue, 17 Dec 2024 11:13:59 -0800 Subject: [PATCH 3/5] Updated the "dashboard" proxy name to be "ui" instead to correspond to changes made to our terraform configuration. --- src/main.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.tsx b/src/main.tsx index 92c978e..697992c 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -10,7 +10,7 @@ import './index.css' ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( - + From a75f9fda860c4c04c3af6ccd4cfd82c3f1f12ec8 Mon Sep 17 00:00:00 2001 From: Anil Natha Date: Wed, 18 Dec 2024 12:24:16 -0800 Subject: [PATCH 4/5] Updated CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1645742..4ceaa5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added health check URL to health dashboard [#40](https://github.com/unity-sds/unity-ui/issues/40) - Fixed health dashboard column resizer element z-index - Added cards to homepage [#38](https://github.com/unity-sds/unity-ui/issues/38) +- Updated router configuration to improve URL readability. URLs no longer contain router information using a hash (#39). [#39](https://github.com/unity-sds/unity-ui/issues/39 +- Updated home page route to be located at `/home` and the route `/` redirects to it. [#39](https://github.com/unity-sds/unity-ui/issues/39) +- Updated application basename configuration to use the proxy name `ui` instead of `dashboard` [#45](https://github.com/unity-sds/unity-ui/issues/45) ## [0.7.0] 2024-09-27 - Updated node version lts/iron From e53fc5d759de2ee5c0995a051847667ae057778c Mon Sep 17 00:00:00 2001 From: Anil Natha Date: Wed, 18 Dec 2024 13:06:53 -0800 Subject: [PATCH 5/5] Added hard-coded links for STAC Browser for unity/dev and unity/test. --- CHANGELOG.md | 1 + src/state/slices/healthSlice.ts | 41 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ceaa5c..4c2127b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated router configuration to improve URL readability. URLs no longer contain router information using a hash (#39). [#39](https://github.com/unity-sds/unity-ui/issues/39 - Updated home page route to be located at `/home` and the route `/` redirects to it. [#39](https://github.com/unity-sds/unity-ui/issues/39) - Updated application basename configuration to use the proxy name `ui` instead of `dashboard` [#45](https://github.com/unity-sds/unity-ui/issues/45) +- Added hard-coded links for STAC Browser for the unity/dev and unity/test venues [#47](https://github.com/unity-sds/unity-ui/issues/47) ## [0.7.0] 2024-09-27 - Updated node version lts/iron diff --git a/src/state/slices/healthSlice.ts b/src/state/slices/healthSlice.ts index 28899d3..32a4200 100644 --- a/src/state/slices/healthSlice.ts +++ b/src/state/slices/healthSlice.ts @@ -44,6 +44,46 @@ const getItems = () => { let serviceItems:Service[] = Array(); + if( project === "UNITY" && venue === 'DEV') { + + serviceItems = [ + { + componentName: "STAC Browser", + ssmKey: "", + healthCheckUrl: "", + landingPageUrl: "https://www.dev.mdps.mcp.nasa.gov:4443/data/stac_browser/", + healthChecks: [ + { + status: "UNKNOWN", + httpResponseCode: "", + date: "" + } + ] + } + ]; + + } + + if( project === "UNITY" && venue === 'TEST') { + + serviceItems = [ + { + componentName: "STAC Browser", + ssmKey: "", + healthCheckUrl: "", + landingPageUrl: "https://www.test.mdps.mcp.nasa.gov:4443/data/stac_browser/", + healthChecks: [ + { + status: "UNKNOWN", + httpResponseCode: "", + date: "" + } + ] + } + ]; + + } + if( project === "UNITY" && venue === 'OPS') { serviceItems = [ @@ -61,6 +101,7 @@ const getItems = () => { ] } ]; + } if( project === "EMIT" && venue === "DEV" ) {