Merge pull request #92 in TEA/mina-sidor-fa-web from feature/version-number to develop
Squashed commit of the following: commit 2b0f98a4151d3afddd6e717cf3495dd4f78fb79e Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Tue Sep 14 15:56:22 2021 +0200 Removed unused files commit 0c308eea737b181bb56628c964d6a15f8f142712 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Tue Sep 14 15:52:34 2021 +0200 Implemented version number so it is saved in environments file upon build
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { DOCUMENT } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
|
||||
import { environment } from '@msfa-environment';
|
||||
|
||||
@Component({
|
||||
selector: 'msfa-root',
|
||||
@@ -6,4 +8,8 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
styleUrls: ['./app.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AppComponent {}
|
||||
export class AppComponent {
|
||||
constructor(@Inject(DOCUMENT) private document: Document) {
|
||||
this.document.body.dataset.version = environment.version;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<digi-logo af-color="secondary"></digi-logo>
|
||||
<dl class="footer__version" *ngIf="versionInfoVisible">
|
||||
<dt>Aktuell version</dt>
|
||||
<dd><markdown src="assets/VERSION.md"></markdown></dd>
|
||||
<dd>{{version}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<nav class="footer__nav">
|
||||
|
||||
@@ -10,9 +10,10 @@ import { environment } from '@msfa-environment';
|
||||
})
|
||||
export class FooterComponent {
|
||||
activeFeatures: Feature[] = environment.activeFeatures;
|
||||
version: string = environment.version;
|
||||
|
||||
get versionInfoVisible(): boolean {
|
||||
return this.activeFeatures.includes(Feature.VERSION_INFO);
|
||||
return this.version && this.activeFeatures.includes(Feature.VERSION_INFO);
|
||||
}
|
||||
get releasesVisible(): boolean {
|
||||
return this.activeFeatures.includes(Feature.RELEASES);
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { MarkdownModule } from 'ngx-markdown';
|
||||
import { FooterComponent } from './footer.component';
|
||||
|
||||
@NgModule({
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
declarations: [FooterComponent],
|
||||
imports: [CommonModule, MarkdownModule.forChild(), RouterModule],
|
||||
imports: [CommonModule, RouterModule],
|
||||
exports: [FooterComponent],
|
||||
})
|
||||
export class FooterModule {}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Feature } from '@msfa-enums/feature.enum';
|
||||
|
||||
export interface Environment {
|
||||
environment: 'api' | 'local' | 'acc' | 'prod';
|
||||
version?: string;
|
||||
clientId: string;
|
||||
loginUrl: string;
|
||||
logoutUrl: string;
|
||||
|
||||
@@ -4,6 +4,7 @@ import { CIAM_TEST } from './ciam';
|
||||
|
||||
export const environment: Environment = {
|
||||
environment: 'acc',
|
||||
version: 'acc',
|
||||
production: true,
|
||||
api: {
|
||||
url: '/api',
|
||||
|
||||
@@ -4,6 +4,7 @@ import { CIAM_TEST } from './ciam';
|
||||
|
||||
export const environment: Environment = {
|
||||
environment: 'api',
|
||||
version: 'api',
|
||||
production: false,
|
||||
api: {
|
||||
url: '/api',
|
||||
|
||||
@@ -4,6 +4,7 @@ import { CIAM_PROD } from './ciam';
|
||||
|
||||
export const environment: Environment = {
|
||||
environment: 'prod',
|
||||
version: 'prod',
|
||||
production: true,
|
||||
api: {
|
||||
url: '/api',
|
||||
|
||||
@@ -5,6 +5,7 @@ import { CIAM_MOCK } from './ciam';
|
||||
|
||||
export const environment: Environment = {
|
||||
environment: 'local',
|
||||
version: 'local',
|
||||
production: false,
|
||||
api: {
|
||||
url: '/api',
|
||||
|
||||
Reference in New Issue
Block a user