Skip to content

Commit

Permalink
Show build information
Browse files Browse the repository at this point in the history
This patch adds additional build information like the build date to the
footer and also adds the explanation we had on the old interface what
these values mean to the `title` attributes.

This fixes #332
  • Loading branch information
lkiesow committed Jun 4, 2024
1 parent ba8eaa8 commit 2d1310a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ const Footer: React.FC = () => {
{/* Only render if a version is set */}
{!!user.ocVersion && (
<li>
Opencast {user.ocVersion.version}
{"Opencast "}
<span title={t('BUILD.COMMIT')}>{user.ocVersion.version}</span>
{hasAccess("ROLE_ADMIN", user) && (
<span> - {user.ocVersion.buildNumber || "undefined"}</span>
<span>
{" – "} <span title={t('BUILD.COMMIT')}>{user.ocVersion.buildNumber || "undefined"}</span>
{" – "} <span title={t('BUILD.DATE_DESC')}>{t("BUILD.BUILT_ON")} {user.ocVersion.lastModified || "undefined"}</span>
</span>
)}
</li>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"MATTERHORN": "Opencast",
"NAV_HOME": "Start",
"NAV_ABOUT": "About",
"BUILD": {
"BUILT_ON": "built on",
"DATE_DESC":"Date this system's kernel module was built on.",
"COMMIT": "Git commit this version of Opencast was built from.",
"VERSION": "Common bundle version of Opencast modules"
},
"NO": "No",
"SUBMIT": "Submit",
"UPDATE": "Update",
Expand Down
1 change: 1 addition & 0 deletions src/slices/userInfoSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ const userInfoSlice = createSlice({
>) => {
state.statusOcVersion = 'succeeded';
const ocVersion = action.payload;
ocVersion.lastModified = new Date(ocVersion['last-modified']).toISOString().substring(0, 10);

Check failure on line 149 in src/slices/userInfoSlice.ts

View workflow job for this annotation

GitHub Actions / build

Type 'string' is not assignable to type 'number'.

Check failure on line 149 in src/slices/userInfoSlice.ts

View workflow job for this annotation

GitHub Actions / build

Property 'last-modified' does not exist on type 'OcVersion'. Did you mean 'lastModified'?
state.ocVersion = ocVersion;
})
.addCase(fetchOcVersion.rejected, (state, action) => {
Expand Down

0 comments on commit 2d1310a

Please sign in to comment.