Version Info
This commit is contained in:
parent
08c53e2eb2
commit
cb73daf863
|
|
@ -4,8 +4,9 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve & http-server ../bizmatch-server",
|
"start": "ng serve & http-server ../bizmatch-server",
|
||||||
"build": "ng build",
|
"prebuild": "node version.js",
|
||||||
"build.dev": "ng build --configuration dev",
|
"build": "node version.js && ng build",
|
||||||
|
"build.dev": "node version.js && ng build --configuration dev",
|
||||||
"watch": "ng build --watch --configuration development",
|
"watch": "ng build --watch --configuration development",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"serve:ssr:bizmatch": "node dist/bizmatch/server/server.mjs"
|
"serve:ssr:bizmatch": "node dist/bizmatch/server/server.mjs"
|
||||||
|
|
@ -33,6 +34,7 @@
|
||||||
"angular-mixed-cdk-drag-drop": "^2.2.3",
|
"angular-mixed-cdk-drag-drop": "^2.2.3",
|
||||||
"browser-bunyan": "^1.8.0",
|
"browser-bunyan": "^1.8.0",
|
||||||
"cropperjs": "^1.6.1",
|
"cropperjs": "^1.6.1",
|
||||||
|
"dayjs": "^1.11.11",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"keycloak-js": "^23.0.7",
|
"keycloak-js": "^23.0.7",
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,21 @@
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
</div>
|
</div>
|
||||||
<footer></footer>
|
<footer></footer>
|
||||||
|
<p-confirmDialog #cd>
|
||||||
|
<ng-template pTemplate="headless" let-message>
|
||||||
|
<div class="flex flex-column align-items-center p-5 surface-overlay border-round">
|
||||||
|
<span class="font-bold text-2xl block mb-2 mt-4">
|
||||||
|
{{ message.header }}
|
||||||
|
</span>
|
||||||
|
<p class="mb-0">{{ message.message }}</p>
|
||||||
|
<div class="flex align-items-center gap-2 mt-4">
|
||||||
|
<button pButton label="OK" (click)="cd.accept()" size="small"></button>
|
||||||
</div>
|
</div>
|
||||||
<!-- @if (loadingService.isLoading$ | async) { -->
|
</div>
|
||||||
<!-- <div class="progress-spinner flex h-full align-items-center justify-content-center">
|
</ng-template>
|
||||||
<div class="spinner-text">Please wait - we're processing your image...</div>
|
</p-confirmDialog>
|
||||||
<p-progressSpinner></p-progressSpinner>
|
</div>
|
||||||
</div> -->
|
|
||||||
<!-- } -->
|
|
||||||
@if (loadingService.isLoading$ | async) {
|
@if (loadingService.isLoading$ | async) {
|
||||||
<div class="spinner-overlay">
|
<div class="spinner-overlay">
|
||||||
<div class="spinner-container">
|
<div class="spinner-container">
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,42 @@
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { Component } from '@angular/core';
|
import { Component, HostListener } from '@angular/core';
|
||||||
import { ActivatedRoute, NavigationEnd, Router, RouterOutlet } from '@angular/router';
|
import { ActivatedRoute, NavigationEnd, Router, RouterOutlet } from '@angular/router';
|
||||||
import onChange from 'on-change';
|
import onChange from 'on-change';
|
||||||
|
import { ConfirmationService } from 'primeng/api';
|
||||||
|
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
||||||
import { ProgressSpinnerModule } from 'primeng/progressspinner';
|
import { ProgressSpinnerModule } from 'primeng/progressspinner';
|
||||||
import { filter } from 'rxjs/operators';
|
import { filter } from 'rxjs/operators';
|
||||||
import { ListingCriteria } from '../../../bizmatch-server/src/models/main.model';
|
import { ListingCriteria } from '../../../bizmatch-server/src/models/main.model';
|
||||||
|
import build from '../build';
|
||||||
import { FooterComponent } from './components/footer/footer.component';
|
import { FooterComponent } from './components/footer/footer.component';
|
||||||
import { HeaderComponent } from './components/header/header.component';
|
import { HeaderComponent } from './components/header/header.component';
|
||||||
import { KeycloakService } from './services/keycloak.service';
|
import { KeycloakService } from './services/keycloak.service';
|
||||||
import { LoadingService } from './services/loading.service';
|
import { LoadingService } from './services/loading.service';
|
||||||
import { UserService } from './services/user.service';
|
import { UserService } from './services/user.service';
|
||||||
import { createDefaultListingCriteria } from './utils/utils';
|
import { createDefaultListingCriteria } from './utils/utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommonModule, RouterOutlet, HeaderComponent, ProgressSpinnerModule, FooterComponent],
|
imports: [CommonModule, RouterOutlet, HeaderComponent, ProgressSpinnerModule, FooterComponent, ConfirmDialogModule],
|
||||||
|
providers: [ConfirmationService],
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrl: './app.component.scss',
|
styleUrl: './app.component.scss',
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
|
build = build;
|
||||||
title = 'bizmatch';
|
title = 'bizmatch';
|
||||||
actualRoute = '';
|
actualRoute = '';
|
||||||
listingCriteria: ListingCriteria = onChange(createDefaultListingCriteria(), (path, value, previousValue, applyData) => {
|
listingCriteria: ListingCriteria = onChange(createDefaultListingCriteria(), (path, value, previousValue, applyData) => {
|
||||||
sessionStorage.setItem('criteria', JSON.stringify(value));
|
sessionStorage.setItem('criteria', JSON.stringify(value));
|
||||||
});
|
});
|
||||||
public constructor(public loadingService: LoadingService, private router: Router, private activatedRoute: ActivatedRoute, private keycloakService: KeycloakService, private userService: UserService) {
|
public constructor(
|
||||||
|
public loadingService: LoadingService,
|
||||||
|
private router: Router,
|
||||||
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private keycloakService: KeycloakService,
|
||||||
|
private userService: UserService,
|
||||||
|
private confirmationService: ConfirmationService,
|
||||||
|
) {
|
||||||
this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => {
|
this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => {
|
||||||
let currentRoute = this.activatedRoute.root;
|
let currentRoute = this.activatedRoute.root;
|
||||||
while (currentRoute.children[0] !== undefined) {
|
while (currentRoute.children[0] !== undefined) {
|
||||||
|
|
@ -36,4 +47,21 @@ export class AppComponent {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
ngOnInit() {}
|
ngOnInit() {}
|
||||||
|
@HostListener('window:keydown', ['$event'])
|
||||||
|
handleKeyboardEvent(event: KeyboardEvent) {
|
||||||
|
if (event.shiftKey && event.ctrlKey && event.key === 'V') {
|
||||||
|
this.showVersionDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
showVersionDialog() {
|
||||||
|
this.confirmationService.confirm({
|
||||||
|
target: event.target as EventTarget,
|
||||||
|
message: `App Version: ${this.build.timestamp}`,
|
||||||
|
header: 'Version Info',
|
||||||
|
icon: 'pi pi-info-circle',
|
||||||
|
accept: () => {},
|
||||||
|
reject: () => {},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue