Skip to content

Commit

Permalink
Merge pull request #134 from skounis/feat/issue-133-version
Browse files Browse the repository at this point in the history
feat(version) Load from package.json and display.
  • Loading branch information
skounis authored Feb 22, 2022
2 parents 204c308 + f992ade commit 7f7120f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "dcc-validation-wire",
"version": "0.0.0",
"version": "1.0.2",
"description": "EU DCC Validation Portal.",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand All @@ -11,6 +12,8 @@
"cypress:open": "cypress open",
"cypress:run": "cypress run"
},
"author": "Stavros Kounis",
"license": " EUPL-1.2 License",
"private": true,
"dependencies": {
"@angular/animations": "~13.1.0",
Expand Down
3 changes: 2 additions & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,9 @@
<div class="content" role="main">
<mat-drawer-container class="dcc-container" autosize>
<!-- Drawer -->
<mat-drawer #drawer class="dcc-sidenav" mode="side">
<mat-drawer #drawer class="dcc-sidenav" mode="side">
<app-qrtree></app-qrtree>
<div style="padding: 1rem;"><small>ver: {{version}}</small></div>
</mat-drawer>
<!-- Content -->
<div class="dcc-content">
Expand Down
3 changes: 3 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { MatDialog } from '@angular/material/dialog';
import { DownloadDialogComponent } from '../components/download-dialog/download-dialog.component';
import { WelcomeDialogComponent } from '../components/welcome-dialog/welcome-dialog.component';
import { ConfirmDialogComponent } from '../components/confirm-dialog/confirm-dialog.component';
import packageJSON from '../../package.json'

@Component({
selector: 'app-root',
Expand All @@ -23,6 +24,7 @@ export class AppComponent implements OnInit {
return this.store.platform;
}

version = packageJSON.version;
title = 'dcc-validation-wire';
showFiller = false;

Expand All @@ -32,6 +34,7 @@ export class AppComponent implements OnInit {
private sanitizer: DomSanitizer,
readonly snackBar: MatSnackBar,
public dialog: MatDialog) {

this.store.getMessage().subscribe((message: string) => {
if (!message) { return }
this.open(message);
Expand Down
4 changes: 4 additions & 0 deletions src/json-typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.json" {
const value: any;
export default value;
}
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"lib": [
"es2020",
"dom"
]
],
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
Expand Down

0 comments on commit 7f7120f

Please sign in to comment.