Skip to content

Commit

Permalink
Merge branch 'version-display' of lkiesow/opencast-admin-interface in…
Browse files Browse the repository at this point in the history
…to main

Pull request #584

  Show build information
  • Loading branch information
gregorydlogan committed Jun 11, 2024
2 parents b28bac0 + c309b5c commit f3e3770
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,24 @@ const Footer: React.FC = () => {
const user = useAppSelector(state => getUserInformation(state));
const orgProperties = useAppSelector(state => getOrgProperties(state));

const lastModified = user?.ocVersion?.['last-modified']
? new Date(user.ocVersion['last-modified']).toISOString().substring(0, 10)
: 'unknown';

return (
<footer id="main-footer">
<div className="default-footer">
<ul>
{/* Only render if a version is set */}
{!!user.ocVersion && (
<li>
Opencast {user.ocVersion.version}
{"Opencast "}
<span title={t('BUILD.VERSION')}>{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")} {lastModified}</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
4 changes: 2 additions & 2 deletions src/slices/userInfoSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { addNotification } from './notificationSlice';
type OcVersion = {
buildNumber: string | undefined,
consistent: boolean | undefined,
lastModified: number | undefined,
'last-modified': number | undefined,
version: string | undefined,
}

Expand Down Expand Up @@ -67,7 +67,7 @@ const initialState: UserInfoState = {
ocVersion: {
buildNumber: undefined,
consistent: undefined,
lastModified: undefined,
"last-modified": undefined,
version: undefined,
},
};
Expand Down

0 comments on commit f3e3770

Please sign in to comment.