Skip to content

Commit 523a501

Browse files
authored
Merge pull request #49 from unity-sds/develop
Merging `develop` branch to `main`.
2 parents 0d6ddf2 + b863f7e commit 523a501

File tree

5 files changed

+57
-7
lines changed

5 files changed

+57
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Added health check URL to health dashboard [#40](https://github.com/unity-sds/unity-ui/issues/40)
1313
- Fixed health dashboard column resizer element z-index
1414
- Added cards to homepage [#38](https://github.com/unity-sds/unity-ui/issues/38)
15+
- 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
16+
- 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)
17+
- Updated application basename configuration to use the proxy name `ui` instead of `dashboard` [#45](https://github.com/unity-sds/unity-ui/issues/45)
18+
- 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)
1519

1620
## [0.7.0] 2024-09-27
1721
- Updated node version lts/iron

etc/apache2/sites-available/unity-ui.conf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@
1313
Header add Set-Cookie oidc_claim_email=%{OIDC_CLAIM_EMAIL}e;Domain=${ENV_UNITY_UI_WWW_DOMAIN};Path=/;SameSite=strict;
1414

1515
<Directory /var/www/unity-ui/>
16+
1617
Options -Indexes
1718
AllowOverride All
1819
Order allow,deny
19-
allow from all
20+
Allow from all
21+
22+
FallbackResource /index.html
23+
2024
</Directory>
2125

2226
</VirtualHost>

src/Root.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
Navigate,
23
Route,
34
Routes,
45
} from "react-router-dom"
@@ -28,7 +29,6 @@ function Root() {
2829

2930
useEffect(() => {
3031

31-
3232
if (healthState.status === "idle") {
3333
// Fetch the health data
3434
dispatch(getHealthData());
@@ -72,9 +72,9 @@ function Root() {
7272
return <Route key={index} path={"/applications/" + formatRoute(item.componentName)} element={<WebView url={item.landingPageUrl} />} />
7373
})
7474
}
75-
{/*<Route path="/applications/catalog" element={<WebView url={Config.ads.url} />} />*/}
75+
<Route path="/" element={<Navigate to="/home" replace={true} />} />
7676
<Route path="/health-dashboard" element={<HealthDashboard />} />
77-
<Route path="/" element={<Home />} />
77+
<Route path="/home" element={<Home />} />
7878
<Route path="*" element={<NotFound />} />
7979
</Routes>
8080
</div>

src/main.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import React from 'react'
22
import ReactDOM from 'react-dom/client'
3-
import { HashRouter, Routes, Route } from 'react-router-dom'
3+
import { BrowserRouter, Routes, Route } from 'react-router-dom'
44
import { HelmetProvider } from 'react-helmet-async'
55
import AuthorizationWrapper from './AuthorizationWrapper'
6+
import Config from "./Config"
67

78
import './index.css'
89

910
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
1011
<React.StrictMode>
1112
<HelmetProvider>
12-
<HashRouter>
13+
<BrowserRouter basename={`${Config['general']['project']}/${Config['general']['venue']}/ui`}>
1314
<Routes>
1415
<Route path="*" Component={AuthorizationWrapper}/>
1516
</Routes>
16-
</HashRouter>
17+
</BrowserRouter>
1718
</HelmetProvider>
1819
</React.StrictMode>
1920
)

src/state/slices/healthSlice.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,46 @@ const getItems = () => {
4444

4545
let serviceItems:Service[] = Array<Service>();
4646

47+
if( project === "UNITY" && venue === 'DEV') {
48+
49+
serviceItems = [
50+
{
51+
componentName: "STAC Browser",
52+
ssmKey: "",
53+
healthCheckUrl: "",
54+
landingPageUrl: "https://www.dev.mdps.mcp.nasa.gov:4443/data/stac_browser/",
55+
healthChecks: [
56+
{
57+
status: "UNKNOWN",
58+
httpResponseCode: "",
59+
date: ""
60+
}
61+
]
62+
}
63+
];
64+
65+
}
66+
67+
if( project === "UNITY" && venue === 'TEST') {
68+
69+
serviceItems = [
70+
{
71+
componentName: "STAC Browser",
72+
ssmKey: "",
73+
healthCheckUrl: "",
74+
landingPageUrl: "https://www.test.mdps.mcp.nasa.gov:4443/data/stac_browser/",
75+
healthChecks: [
76+
{
77+
status: "UNKNOWN",
78+
httpResponseCode: "",
79+
date: ""
80+
}
81+
]
82+
}
83+
];
84+
85+
}
86+
4787
if( project === "UNITY" && venue === 'OPS') {
4888

4989
serviceItems = [
@@ -61,6 +101,7 @@ const getItems = () => {
61101
]
62102
}
63103
];
104+
64105
}
65106

66107
if( project === "EMIT" && venue === "DEV" ) {

0 commit comments

Comments
 (0)