Production release November 2023 #20
|
@ -1,20 +1,13 @@
|
|||
import {filter, map, mergeMap, take} from 'rxjs/operators';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
CanActivate,
|
||||
CanActivateChild,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
UrlTree
|
||||
} from '@angular/router';
|
||||
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
||||
import {Observable, of} from 'rxjs';
|
||||
import {Session} from '../../login/utils/helper.class';
|
||||
import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
|
||||
import {UserManagementService} from "../../services/user-management.service";
|
||||
|
||||
@Injectable()
|
||||
export class ConnectAdminLoginGuard implements CanActivate, CanActivateChild {
|
||||
export class ConnectAdminLoginGuard {
|
||||
|
||||
constructor(private router: Router,
|
||||
private userManagementService: UserManagementService) {
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
Router,
|
||||
CanActivate,
|
||||
ActivatedRouteSnapshot,
|
||||
RouterStateSnapshot,
|
||||
CanLoad, Route, UrlSegment, CanActivateChild, UrlTree
|
||||
} from '@angular/router';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree} from '@angular/router';
|
||||
import {Observable} from 'rxjs';
|
||||
|
||||
import {ConnectHelper} from '../connectHelper';
|
||||
|
@ -14,7 +8,7 @@ import {CommunityService} from "../community/community.service";
|
|||
import {map} from "rxjs/operators";
|
||||
|
||||
@Injectable()
|
||||
export class IsCommunity implements CanActivate, CanActivateChild {
|
||||
export class IsCommunity {
|
||||
|
||||
constructor(private router: Router,
|
||||
private communityService: CommunityService) {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import {Observable} from 'rxjs';
|
||||
import {take, tap} from 'rxjs/operators';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {ActivatedRouteSnapshot, CanActivate, Data, Router, RouterStateSnapshot, UrlTree} from '@angular/router';
|
||||
import { ActivatedRouteSnapshot, Data, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
||||
import {ConfigurationService} from '../utils/configuration/configuration.service';
|
||||
import {ConnectHelper} from '../connect/connectHelper';
|
||||
import {properties} from "../../../environments/environment";
|
||||
|
||||
@Injectable()
|
||||
export class IsRouteEnabled implements CanActivate {
|
||||
export class IsRouteEnabled {
|
||||
|
||||
constructor(private router: Router,
|
||||
private config: ConfigurationService) {
|
||||
|
|
|
@ -2,7 +2,7 @@ import {Injectable, Inject, PLATFORM_ID, Optional} from '@angular/core';
|
|||
import {HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpResponse, HttpHeaders} from '@angular/common/http';
|
||||
import {Observable, of} from 'rxjs';
|
||||
import {tap} from 'rxjs/operators';
|
||||
import {TransferState, makeStateKey, StateKey} from '@angular/platform-browser';
|
||||
import {TransferState, makeStateKey, StateKey} from '@angular/core';
|
||||
import {isPlatformServer} from '@angular/common';
|
||||
import {properties} from "../../environments/environment";
|
||||
import {REQUEST} from "./utils/tokens";
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
CanActivate,
|
||||
CanActivateChild, Data,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
UrlTree
|
||||
} from '@angular/router';
|
||||
import { ActivatedRouteSnapshot, Data, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
||||
import {Observable} from 'rxjs';
|
||||
import {Session} from './utils/helper.class';
|
||||
import {LoginErrorCodes} from './utils/guardHelper.class';
|
||||
|
@ -16,7 +9,7 @@ import {map, tap} from "rxjs/operators";
|
|||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AdminLoginGuard implements CanActivate, CanActivateChild {
|
||||
export class AdminLoginGuard {
|
||||
|
||||
constructor(private router: Router,
|
||||
private userManagementService: UserManagementService) {
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
Router,
|
||||
CanActivate,
|
||||
ActivatedRouteSnapshot,
|
||||
RouterStateSnapshot,
|
||||
UrlTree
|
||||
} from '@angular/router';
|
||||
import { Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router';
|
||||
import {Observable} from 'rxjs';
|
||||
import {LoginErrorCodes} from './utils/guardHelper.class';
|
||||
|
||||
@Injectable()
|
||||
export class FreeGuard implements CanActivate {
|
||||
export class FreeGuard {
|
||||
|
||||
constructor(private router: Router) {
|
||||
}
|
||||
|
|
|
@ -1,14 +1,5 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
CanActivate,
|
||||
CanActivateChild,
|
||||
CanLoad,
|
||||
Route,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
UrlTree
|
||||
} from '@angular/router';
|
||||
import { ActivatedRouteSnapshot, Route, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
||||
import {Observable} from 'rxjs';
|
||||
import {LoginErrorCodes} from './utils/guardHelper.class';
|
||||
import {map, tap} from "rxjs/operators";
|
||||
|
@ -17,7 +8,7 @@ import {UserManagementService} from "../services/user-management.service";
|
|||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LoginGuard implements CanActivate, CanLoad, CanActivateChild {
|
||||
export class LoginGuard {
|
||||
|
||||
constructor(private router: Router,
|
||||
private userManagementService: UserManagementService) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {Observable} from 'rxjs';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {CanDeactivate} from '@angular/router';
|
||||
|
||||
|
||||
export interface IDeactivateComponent {
|
||||
canExit: () => Observable<boolean> | Promise<boolean> | boolean;
|
||||
|
@ -9,7 +9,7 @@ export interface IDeactivateComponent {
|
|||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CanExitGuard implements CanDeactivate<IDeactivateComponent> {
|
||||
export class CanExitGuard {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CanDeactivate, Router} from '@angular/router';
|
||||
import { Router } from '@angular/router';
|
||||
import {Observable} from 'rxjs';
|
||||
import {properties} from "../../../../environments/environment";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
}) // do not forget to register this class as a provider
|
||||
export class PreviousRouteRecorder implements CanDeactivate<any> {
|
||||
export class PreviousRouteRecorder {
|
||||
constructor(private router: Router) {
|
||||
}
|
||||
canDeactivate(component: any): Observable<boolean> | boolean {
|
||||
|
|
Loading…
Reference in New Issue