From 9bffdd73344aadcd716b6869a8e3d8ef340060ff Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 8 Apr 2021 09:50:10 +0200 Subject: [PATCH] app version step 1 --- frontend/.env.dist | 3 ++- frontend/src/store/store.js | 7 ++++++- frontend/src/views/Layout/ContentFooter.vue | 1 + frontend/vue.config.js | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/.env.dist b/frontend/.env.dist index c8323c316..f7e65b9ce 100644 --- a/frontend/.env.dist +++ b/frontend/.env.dist @@ -1,4 +1,5 @@ LOGIN_API_URL=http://localhost/login_api/ COMMUNITY_API_STATE_BALANCE_URL=http://localhost/state-balances/ COMMUNITY_API_TRANSACTION_CREATION_URL=http://localhost/transaction-creations/ -VUE_PATH=/vue \ No newline at end of file +VUE_PATH=/vue +VUE_APP_VERSION=0 \ No newline at end of file diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index ecddfba22..7e122b54a 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -26,8 +26,13 @@ export const store = new Vuex.Store({ 'Access-Control-Allow-Credentials': 'true', }, }, + packageVersion: process.env.VUE_APP_VERSION|| '0', + }, + getters: { + appVersion: (state) => { + return state.packageVersion + } }, - getters: {}, // Syncronous mutation of the state mutations: { language: (state, language) => { diff --git a/frontend/src/views/Layout/ContentFooter.vue b/frontend/src/views/Layout/ContentFooter.vue index 5299b2f54..3de533001 100755 --- a/frontend/src/views/Layout/ContentFooter.vue +++ b/frontend/src/views/Layout/ContentFooter.vue @@ -25,6 +25,7 @@ --> + My Awesome App version {{ $store.getters.appVersion }} diff --git a/frontend/vue.config.js b/frontend/vue.config.js index ad2c10585..b4df9f99f 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -1,5 +1,7 @@ const path = require('path') const dotenv = require('dotenv-webpack') +process.env.VUE_APP_VERSION = require('./package.json').version + function resolveSrc(_path) { return path.join(__dirname, _path)