diff --git a/src/app/layouts/footer.component.html b/src/app/layouts/footer.component.html
index 116376c426f..d8e28c86d94 100644
--- a/src/app/layouts/footer.component.html
+++ b/src/app/layouts/footer.component.html
@@ -7,7 +7,7 @@
- Version 2.0.0
+ {{'versionNumber' | i18n : version}}
diff --git a/src/app/layouts/footer.component.ts b/src/app/layouts/footer.component.ts
index 225beb1a4d0..e545d60bcc7 100644
--- a/src/app/layouts/footer.component.ts
+++ b/src/app/layouts/footer.component.ts
@@ -1,9 +1,20 @@
import {
Component,
+ OnInit,
} from '@angular/core';
+import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
+
@Component({
selector: 'app-footer',
templateUrl: 'footer.component.html',
})
-export class FooterComponent { }
+export class FooterComponent implements OnInit {
+ version: string;
+
+ constructor(private platformUtilsService: PlatformUtilsService) { }
+
+ ngOnInit() {
+ this.version = this.platformUtilsService.getApplicationVersion();
+ }
+}
diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json
index ff7207123f2..b7109035e00 100644
--- a/src/locales/en/messages.json
+++ b/src/locales/en/messages.json
@@ -547,5 +547,14 @@
},
"noItemsInList": {
"message": "There are no items to list."
+ },
+ "versionNumber": {
+ "message": "Version $VERSION_NUMBER$",
+ "placeholders": {
+ "version_number": {
+ "content": "$1",
+ "example": "1.2.3"
+ }
+ }
}
}
diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts
index 987232fb9d3..1606004cb3f 100644
--- a/src/services/webPlatformUtils.service.ts
+++ b/src/services/webPlatformUtils.service.ts
@@ -100,7 +100,7 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
}
getApplicationVersion(): string {
- return '1.2.3';
+ return process.env.APPLICATION_VERSION || '-';
}
supportsU2f(win: Window): boolean {
diff --git a/webpack.config.js b/webpack.config.js
index edde3aeb794..7ae42be275c 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -6,6 +6,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
+const pjson = require('./package.json');
if (process.env.NODE_ENV == null) {
process.env.NODE_ENV = 'development';
@@ -102,7 +103,8 @@ const plugins = [
extractCss,
new webpack.DefinePlugin({
'process.env': {
- 'ENV': JSON.stringify(ENV)
+ 'ENV': JSON.stringify(ENV),
+ 'APPLICATION_VERSION': JSON.stringify(pjson.version),
}
}),
];