Skip to content

Commit

Permalink
feat: add version tag to toolbar in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Oct 10, 2024
1 parent 6a26ea6 commit 6f6d04d
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ services:
working_dir: /web
volumes:
- ./web:/web
- ./.git:/web/.git # allow fetching version tag
ports:
- 8080:8080
environment:
Expand Down
53 changes: 53 additions & 0 deletions web/package-lock.json

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

1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"axios": "^1.4.0",
"buffer": "^6.0.3",
"core-js": "^3.8.3",
"git-describe": "^4.1.1",
"lodash": "^4.17.21",
"maplibre-gl": "^4.6.0",
"shpjs": "^4.0.4",
Expand Down
9 changes: 8 additions & 1 deletion web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default defineComponent({
setup() {
const drawer = ref(true);
const showError = computed(() => currentError.value !== undefined);
const version = process.env.VUE_APP_VERSION;
function onReady() {
if (currentUser.value) {
Expand All @@ -49,6 +50,7 @@ export default defineComponent({
return {
login,
logout,
version,
currentUser,
drawer,
currentProject,
Expand Down Expand Up @@ -103,7 +105,12 @@ export default defineComponent({
@click.stop="drawer = !drawer"
v-if="!projectConfigMode"
/>
<v-toolbar-title>UVDAT</v-toolbar-title>
<v-toolbar-title>
UVDAT
<v-card-subtitle style="display: inline-block; vertical-align: bottom">
{{ version }}
</v-card-subtitle>
</v-toolbar-title>
<v-spacer />
<div v-if="currentUser" class="px-3">
{{ currentUser.first_name }}
Expand Down
4 changes: 4 additions & 0 deletions web/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const { ProvidePlugin } = require("webpack");

const { gitDescribeSync } = require("git-describe");
const describe = gitDescribeSync();
process.env.VUE_APP_VERSION = describe.dirty ? describe.raw : describe.tag;

module.exports = {
transpileDependencies: true,
configureWebpack: {
Expand Down

0 comments on commit 6f6d04d

Please sign in to comment.