Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render git commit info if env var is set #462

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cypress/e2e/integration/browse_collections.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ describe("browse_collections: Browse collections page", () => {
cy.visit("/collections");
});

it("displays the correct page title", () => {
cy.get("h1").invoke("text").should("equal", "About Our Collections");
});

it("finds the first collection sorted by title as default", () => {
cy.get(".gallery-item")
.first()
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import AnalyticsConfig from "./components/AnalyticsConfig";
import Header from "./components/Header";
import NavBar from "./components/NavBar";
import Footer from "./components/Footer";
import { GitDetails } from "./components/GitDetails";
import LoadingScreen from "./components/LoadingScreen";
import { buildRoutes } from "./lib/CustomPageRoutes";
import HomePage from "./pages/HomePage";
Expand Down Expand Up @@ -192,6 +193,7 @@ class App extends Component {
</Routes>
</div>
</main>
<GitDetails />
<Footer />
</ThemeProvider>
</StyledEngineProvider>
Expand Down
25 changes: 25 additions & 0 deletions src/components/GitDetails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Link } from "react-router-dom";
import "../css/GitDetails.scss";

const GitDetails = () => {
const gitCommit = process.env.REACT_APP_GIT_COMMIT;
console.log("GitDetails gitCommit", gitCommit);
if (!gitCommit) {
return null;
}
return (
<div className="git-detail-section">
<p>
This site is running commit{" "}
<Link to={`https://github.com/VTUL/dlp-access/commit/${gitCommit}`}>
{gitCommit.length > 8 ? gitCommit.substring(0, 7) : gitCommit}
</Link>{" "}
of the{" "}
<Link to={"https://github.com/VTUL/dlp-access/"}>vtdlp-access</Link>{" "}
project
</p>
</div>
);
};

export { GitDetails };
20 changes: 20 additions & 0 deletions src/css/GitDetails.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.git-detail-section {
position: relative;
display: block;
background-color: var(--light-gray);
width: 100%;
margin-bottom: 15px;
padding: 10px;
p {
position: relative;
display: block;
text-align: center;
font-family: "gineso-condensed", sans-serif;
a,
a:visited {
position: relative;
color: var(--themeHighlightColor);
cursor: pointer;
}
}
}
Loading