Compare commits

...

6 Commits

Author SHA1 Message Date
Lorenz Hilpert
03815586f7 Merge branch 'release/3.2' 2024-09-24 16:47:03 +02:00
Lorenz Hilpert
9b7a1b1c21 Merge branch 'hotfix/skip-open-camera-when-offline' 2024-09-24 14:39:11 +02:00
Lorenz Hilpert
a290d3b249 Kamera öffnet sich nur wenn man Online ist 2024-09-24 14:37:48 +02:00
Lorenz Hilpert
ad348af551 Merge branch 'master' into release/3.2 2024-09-17 10:56:13 +02:00
Lorenz Hilpert
3c6833988c Change Variables in pipeline Minor from 1 to 2 2024-09-04 17:58:00 +02:00
Lorenz Hilpert
28fb4ebb48 Merge tag '3.1' into develop 2024-09-04 17:56:06 +02:00
4 changed files with 25 additions and 6 deletions

View File

@@ -9,12 +9,20 @@ import { Config } from '@core/config';
import { ComponentPortal } from '@angular/cdk/portal';
import { ScanditOverlayComponent } from './scandit-overlay.component';
import { EnvironmentService } from '@core/environment';
import { injectNetworkStatus$ } from 'apps/isa-app/src/app/services/network-status.service';
import { toSignal } from '@angular/core/rxjs-interop';
@Injectable()
export class ScanditScanAdapter implements ScanAdapter {
readonly name = 'Scandit';
constructor(private readonly _config: Config, private _overlay: Overlay, private _environmentService: EnvironmentService) {}
private $networkStatus = toSignal(injectNetworkStatus$());
constructor(
private readonly _config: Config,
private _overlay: Overlay,
private _environmentService: EnvironmentService,
) {}
async init(): Promise<boolean> {
if (this._environmentService.isTablet()) {
@@ -30,6 +38,11 @@ export class ScanditScanAdapter implements ScanAdapter {
scan(): Observable<string> {
return new Observable((observer) => {
if (this.$networkStatus() === 'offline') {
observer.error(new Error('No network connection'));
return;
}
const overlay = this.createOverlay();
const portal = this.createPortal();
@@ -49,7 +62,7 @@ export class ScanditScanAdapter implements ScanAdapter {
sub.add(
overlay.backdropClick().subscribe(() => {
complete();
})
}),
);
ref.instance.onScan((code) => {

View File

@@ -17,7 +17,10 @@ export class AuthService {
private _authConfig: AuthConfig;
constructor(private _config: Config, private readonly _oAuthService: OAuthService) {
constructor(
private _config: Config,
private readonly _oAuthService: OAuthService,
) {
this._oAuthService.events?.subscribe((event) => {
if (event.type === 'token_received') {
console.log('SSO Token Expiration:', new Date(this._oAuthService.getAccessTokenExpiration()));
@@ -45,6 +48,8 @@ export class AuthService {
await this._oAuthService.loadDiscoveryDocumentAndTryLogin();
} catch (error) {
this.login();
throw error;
}
this._initialized.next(true);

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
import { AuthService } from '@core/auth';
import { ScanAdapterService } from '@adapter/scan';
import { AuthService as IsaAuthService } from '@swagger/isa';
@@ -9,11 +9,12 @@ import { EnvironmentService } from '@core/environment';
@Injectable({ providedIn: 'root' })
export class IsAuthenticatedGuard {
constructor(
private _router: Router,
private _authService: AuthService,
private _scanService: ScanAdapterService,
private _isaAuthService: IsaAuthService,
private _modal: UiModalService,
private _environmentService: EnvironmentService
private _environmentService: EnvironmentService,
) {}
async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {

View File

@@ -12,7 +12,7 @@ variables:
value: '3'
# Minor Version einstellen
- name: 'Minor'
value: '1'
value: '2'
- name: 'Patch'
value: "$[counter(format('{0}.{1}', variables['Major'], variables['Minor']),0)]"
- name: 'BuildUniqueID'