Skip to content

Commit

Permalink
Afficher la version de l'application dans l'IHM #54
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpochat committed Dec 19, 2024
1 parent 51559dd commit 979b251
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ RUN npm run build:api
RUN npm run install:api

ARG REACT_APP_MODE
ARG REACT_APP_VERSION

RUN export REACT_APP_MODE=$REACT_APP_MODE && PUBLIC_URL="/" && npm run build
RUN export REACT_APP_MODE=$REACT_APP_MODE && export REACT_APP_VERSION=$REACT_APP_VERSION && PUBLIC_URL="/" && npm run build

FROM httpd:2.4.57

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/domains/commons/components/Footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

.footer-item {
margin-bottom: 1rem;
margin: 1rem;
}

.footer-contact {
Expand Down
7 changes: 6 additions & 1 deletion frontend/app/src/domains/commons/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export default function Footer() {
return <></>
}

function displayVersion() {
const versionLabel = process.env?.REACT_APP_VERSION || ' indéfinie'
return `version ${versionLabel}`
}

return <>
<div className="footer">
<div>
Expand Down Expand Up @@ -56,7 +61,7 @@ export default function Footer() {
&ensp;sur&ensp;
<a target='_blank' href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>
</div>
<div>{process?.env?.REACT_APP_MODE || 'version indéfinie'}</div>
<div className="footer-item">{displayVersion()}</div>
</div>
{displayGeneralTermsAndConditions()}
</>
Expand Down

0 comments on commit 979b251

Please sign in to comment.