Skip to content

Commit

Permalink
Merge pull request #517 from codeforboston/mattdelsordo/ui-staging
Browse files Browse the repository at this point in the history
add metadata page with git revision to see if the deploy worked
  • Loading branch information
mattdelsordo authored Dec 15, 2023
2 parents 345d337 + f63e6c7 commit 3875672
Show file tree
Hide file tree
Showing 4 changed files with 10,697 additions and 14,755 deletions.
9 changes: 6 additions & 3 deletions frontend/front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
"web-vitals": "^2.1.0"
},
"scripts": {
"start": "PORT=3001 react-scripts start",
"build": "react-scripts build",
"start": "cross-env REACT_APP_GIT_SHA=$(git rev-parse --short HEAD) PORT=3001 react-scripts start",
"build": "cross-env REACT_APP_GIT_SHA=$(git rev-parse --short HEAD) react-scripts build",
"serve": "serve -l 3001 build/",
"test": "react-scripts test",
"test-style": "run-s lint prettier",
"eject": "react-scripts eject",
Expand Down Expand Up @@ -63,8 +64,10 @@
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"cross-env": "^7.0.3",
"eslint": "^8.44.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8"
"prettier": "^2.8.8",
"serve": "^14.2.1"
}
}
3 changes: 3 additions & 0 deletions frontend/front/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Login from "./features/login/Login";
import { ProtectedRoute } from "./routing/ProtectedRoute";
import PublicContainer from "./pages/Public/PublicContainer";
import SurveyorContainer from "./pages/Surveyor/SurveyorContainer";
import { Metadata } from "./pages/Metadata";

function App() {
// update jwt
Expand Down Expand Up @@ -49,6 +50,8 @@ function App() {
}
/>
<Route path={`${routes.LOGIN_ROUTE}`} element={<Login />} />

<Route path="/metadata" element={<Metadata />} />
</Routes>
</BrowserRouter>
</Box>
Expand Down
12 changes: 12 additions & 0 deletions frontend/front/src/pages/Metadata.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { useMemo } from "react";

export const Metadata = () => {
const metadata = useMemo(
() => ({
gitRevision: process.env.REACT_APP_GIT_SHA,
}),
[]
);

return <pre>{JSON.stringify(metadata, null, 4)}</pre>;
};
Loading

0 comments on commit 3875672

Please sign in to comment.