Skip to content

Commit

Permalink
Merge pull request #167 from BBMRI-ERIC/feat/add_display_od_versions_…
Browse files Browse the repository at this point in the history
…FE_BE

add current version to footer
  • Loading branch information
tmilost-bbmri-eric committed Mar 19, 2024
2 parents ae16bb0 + 5a1bb70 commit aa08ee0
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_GIT_COMMIT_HASH=''
VITE_GIT_TAG=''
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"bootstrap-vue-next": "^0.8.10",
"core-js": "^3.8.3",
"dotenv": "^16.0.3",
"git-rev-sync": "^3.0.2",
"http-server": "^14.1.1",
"jspdf": "^2.5.1",
"moment": "^2.29.4",
Expand Down
30 changes: 21 additions & 9 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<a href="https://bbmri-eric.eu">
<img
width="150"
height="40"
:src="logoSrc"
alt="logo negotiator"
>
Expand Down Expand Up @@ -115,12 +116,11 @@
<div class="col text-center">
<p>&copy; 2024 BBMRI-ERIC</p>
</div>
<div class="col d-none d-lg-block" />
<div class="col text-center ">
UI version: <span class="text-warning pe-2">{{ gitTag }}</span>Server version: <span class="text-warning">{{ backendVersion }}</span>
</div>
<div class="col text-center ms-5">
Need help? <a
class="text-primary"
href="mailto:negotiator@helpdesk.bbmri-eric.eu"
>Contact us</a>.
Need help? <a href="mailto:negotiator@helpdesk.bbmri-eric.eu">Contact us</a>.
</div>
</div>
</div>
Expand All @@ -130,17 +130,29 @@

<script>
import activeTheme from "../config/theme.js"
import bbmriLogo from "../assets/images/bbmri/footer-bbmri.svg"
import eucaimLogo from "../assets/images/eucaim/footer-eucaim.png"
import canservLogo from "../assets/images/canserv/footer-canserv.png"
import bbmriLogo from "../assets/images/bbmri/home-bbmri.png"
import eucaimLogo from "../assets/images/eucaim/home-eucaim.png"
import canservLogo from "../assets/images/canserv/home-canserv.png"
import { mapActions } from "vuex"
const viteGitTag = import.meta.env.VITE_GIT_TAG
export default {
name: "FooterPage",
data () {
return {
logoSrc: activeTheme.activeLogosFiles === "eucaim" ? eucaimLogo : (activeTheme.activeLogosFiles === "canserv" ? canservLogo : bbmriLogo),
isFooterFollowUsVisible: activeTheme.isFooterFollowUsVisible
isFooterFollowUsVisible: activeTheme.isFooterFollowUsVisible,
gitTag: viteGitTag,
backendVersion: ""
}
},
async beforeMount () {
this.backendVersion = await this.retrieveBackendVersion()
},
methods: {
...mapActions([
"retrieveBackendVersion"
])
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavigationBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default {
data () {
return {
roles: [],
logoSrc: activeTheme.activeLogosFiles === "eucaim" ? eucaimLogo : (activeTheme.activeLogosFiles=== 'canserv' ? canservLogo : bbmriLogo),
logoSrc: activeTheme.activeLogosFiles === "eucaim" ? eucaimLogo : (activeTheme.activeLogosFiles === "canserv" ? canservLogo : bbmriLogo),
featureFlagsFAQ: allFeatureFlags.faqPage
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/PDFButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
},
data () {
return {
logoSrc: activeTheme.activeLogosFiles === "eucaim" ? eucaimLogo : (activeTheme.activeLogosFiles=== 'canserv' ? canservLogo : bbmriLogo)
logoSrc: activeTheme.activeLogosFiles === "eucaim" ? eucaimLogo : (activeTheme.activeLogosFiles === "canserv" ? canservLogo : bbmriLogo)
}
},
methods: {
Expand Down
12 changes: 12 additions & 0 deletions src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const USER_PATH = `${BASE_API_PATH}/users`
const USER_ROLES_PATH = `${BASE_API_PATH}/users/roles`
const USER_RESOURCES_PATH = `${BASE_API_PATH}/users/resources`
const ATTACHMENTS_PATH = `${BASE_API_PATH}/attachments`
const BACKEND_VERSION_PATH = `${BASE_API_PATH}/actuator/info`

function getBearerHeaders (token) {
return { Authorization: `Bearer ${token}` }
Expand All @@ -31,6 +32,17 @@ export default {
}
})
},
retrieveBackendVersion (store) {
return axios.get(`${BACKEND_VERSION_PATH}`)
.then((response) => {
return response.data.version
})
.catch((error) => {
if (error.response) {
return "Error"
}
})
},
retrieveAccessCriteriaByResourceId ({ state, commit }, { resourceId }) {
return axios.get(`${ACCESS_CRITERIA_PATH}`, { headers: getBearerHeaders(state.oidc.access_token), params: { resourceId } })
.then((response) => {
Expand Down
27 changes: 21 additions & 6 deletions src/views/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,20 @@
</a>
</div>
<div class="text-center text-primary-text mb-2">
<a href="https://www.bbmri-eric.eu/wp-content/uploads/AoM_10_8_Access-Policy_FINAL_EU.pdf">Privacy Policy</a>
Need help? <a
class="text-primary"
href="mailto:negotiator@helpdesk.bbmri-eric.eu"
>Contact us</a>.
</div>
<div class="text-center text-primary-text mb-2">
Need help? <a href="mailto:negotiator@helpdesk.bbmri-eric.eu">Contact us</a>.
<div class="text-center text-primary-text col mb-2">
<i class="bi bi-github" />
<a
class="text-primary"
href="https://github.com/BBMRI-ERIC/negotiator-v3-frontend"
> GitHub</a>
</div>
<div class="text-center ">
UI version: <span class="text-warning pe-2">{{ gitTag }}</span>Server version: <span class="text-warning">{{ backendVersion }}</span>
</div>
<div class="text-center text-primary-text mb-5">
<p>&copy; 2024 BBMRI-ERIC</p>
Expand All @@ -97,25 +107,30 @@ import activeTheme from "../config/theme.js"
import bbmriLogo from "../assets/images/bbmri/home-bbmri.png"
import eucaimLogo from "../assets/images/eucaim/home-eucaim.png"
import canservLogo from "../assets/images/canserv/home-canserv.png"
const viteGitTag = import.meta.env.VITE_GIT_TAG
export default {
name: "HomePage",
data () {
return {
logoSrc: activeTheme.activeLogosFiles === "eucaim" ? eucaimLogo : (activeTheme.activeLogosFiles === "canserv" ? canservLogo : bbmriLogo)
logoSrc: activeTheme.activeLogosFiles === "eucaim" ? eucaimLogo : (activeTheme.activeLogosFiles === "canserv" ? canservLogo : bbmriLogo),
gitTag: viteGitTag,
backendVersion: ""
}
},
computed: {
...mapGetters(["oidcIsAuthenticated", "oidcUser"])
},
beforeMount () {
async beforeMount () {
if (this.oidcIsAuthenticated) {
this.$router.push("/researcher")
}
this.backendVersion = await this.retrieveBackendVersion()
},
methods: {
...mapActions([
"authenticateOidc"
"authenticateOidc",
"retrieveBackendVersion"
])
}
}
Expand Down
4 changes: 4 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import Components from "unplugin-vue-components/vite"
import { BootstrapVueNextResolver } from "unplugin-vue-components/resolvers"
import git from "git-rev-sync"

const PROXY_TARGET = "http://localhost:8081"

process.env.VITE_GIT_COMMIT_HASH = git.short()
process.env.VITE_GIT_TAG = git.tag()

export default defineConfig({
plugins: [
vue(),
Expand Down
44 changes: 41 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3699,7 +3699,7 @@ escape-html@~1.0.3:
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==

escape-string-regexp@^1.0.5:
escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
Expand Down Expand Up @@ -4329,6 +4329,15 @@ get-symbol-description@^1.0.2:
es-errors "^1.3.0"
get-intrinsic "^1.2.4"

git-rev-sync@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/git-rev-sync/-/git-rev-sync-3.0.2.tgz#9763c730981187c3419b75dd270088cc5f0e161b"
integrity sha512-Nd5RiYpyncjLv0j6IONy0lGzAqdRXUaBctuGBbrEA2m6Bn4iDrN/9MeQTXuiquw8AEKL9D2BW0nw5m/lQvxqnQ==
dependencies:
escape-string-regexp "1.0.5"
graceful-fs "4.1.15"
shelljs "0.8.5"

glob-parent@^5.1.2, glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
Expand Down Expand Up @@ -4359,7 +4368,7 @@ glob@^10.3.3:
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
path-scurry "^1.10.1"

glob@^7.1.3:
glob@^7.0.0, glob@^7.1.3:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
Expand Down Expand Up @@ -4409,6 +4418,11 @@ gopd@^1.0.1:
dependencies:
get-intrinsic "^1.1.3"

graceful-fs@4.1.15:
version "4.1.15"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==

graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9:
version "4.2.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
Expand Down Expand Up @@ -4752,6 +4766,11 @@ internal-slot@^1.0.7:
hasown "^2.0.0"
side-channel "^1.0.4"

interpret@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==

ipaddr.js@1.9.1:
version "1.9.1"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"
Expand Down Expand Up @@ -6454,6 +6473,13 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"

rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==
dependencies:
resolve "^1.1.6"

regenerate-unicode-properties@^10.1.0:
version "10.1.1"
resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz#6b0e05489d9076b04c436f318d9b067bba459480"
Expand Down Expand Up @@ -6553,7 +6579,7 @@ resolve-from@^4.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==

resolve@^1.10.0, resolve@^1.14.2, resolve@^1.22.1, resolve@^1.22.2, resolve@^1.22.4:
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.22.1, resolve@^1.22.2, resolve@^1.22.4:
version "1.22.8"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d"
integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==
Expand Down Expand Up @@ -6856,6 +6882,15 @@ shell-quote@^1.8.1:
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680"
integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==

shelljs@0.8.5:
version "0.8.5"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c"
integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"

side-channel@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2"
Expand Down Expand Up @@ -7013,6 +7048,7 @@ statuses@2.0.1:
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
name string-width-cjs
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -7080,6 +7116,7 @@ string_decoder@~1.1.1:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
name strip-ansi-cjs
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -7975,6 +8012,7 @@ wildcard@^2.0.0:
integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
name wrap-ansi-cjs
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down

0 comments on commit aa08ee0

Please sign in to comment.