From 52798aa5f277492d4dd2482bca9396d2e982fa19 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 May 2023 11:15:00 +0200 Subject: Update angular --- client/src/app/core/rest/rest-table.ts | 7 ++++--- client/src/app/core/routing/can-deactivate-guard.service.ts | 3 +-- client/src/app/core/routing/login-guard.service.ts | 4 ++-- client/src/app/core/routing/menu-guard.service.ts | 3 +-- client/src/app/core/routing/meta-guard.service.ts | 4 ++-- client/src/app/core/routing/server-config-resolver.service.ts | 4 +--- client/src/app/core/routing/unlogged-guard.service.ts | 4 ++-- client/src/app/core/routing/user-right-guard.service.ts | 4 ++-- 8 files changed, 15 insertions(+), 18 deletions(-) (limited to 'client/src/app/core') diff --git a/client/src/app/core/rest/rest-table.ts b/client/src/app/core/rest/rest-table.ts index 707110d7f..ec4c570d4 100644 --- a/client/src/app/core/rest/rest-table.ts +++ b/client/src/app/core/rest/rest-table.ts @@ -1,5 +1,6 @@ import debug from 'debug' -import { LazyLoadEvent, SortMeta } from 'primeng/api' +import { SortMeta } from 'primeng/api' +import { TableLazyLoadEvent } from 'primeng/table' import { ActivatedRoute, Router } from '@angular/router' import { logger } from '@root-helpers/logger' import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' @@ -46,12 +47,12 @@ export abstract class RestTable { peertubeLocalStorage.setItem(this.getSortLocalStorageKey(), JSON.stringify(this.sort)) } - loadLazy (event: LazyLoadEvent) { + loadLazy (event: TableLazyLoadEvent) { debugLogger('Load lazy %o.', event) this.sort = { order: event.sortOrder, - field: event.sortField + field: event.sortField as string } this.rowsPerPage = event.rows diff --git a/client/src/app/core/routing/can-deactivate-guard.service.ts b/client/src/app/core/routing/can-deactivate-guard.service.ts index 8fce495e9..638e8e699 100644 --- a/client/src/app/core/routing/can-deactivate-guard.service.ts +++ b/client/src/app/core/routing/can-deactivate-guard.service.ts @@ -1,6 +1,5 @@ import { Observable } from 'rxjs' import { Injectable } from '@angular/core' -import { CanDeactivate } from '@angular/router' import { ConfirmService } from '@app/core/confirm' export type CanComponentDeactivateResult = { text?: string, canDeactivate: Observable | boolean } @@ -10,7 +9,7 @@ export interface CanComponentDeactivate { } @Injectable() -export class CanDeactivateGuard implements CanDeactivate { +export class CanDeactivateGuard { constructor (private confirmService: ConfirmService) { } diff --git a/client/src/app/core/routing/login-guard.service.ts b/client/src/app/core/routing/login-guard.service.ts index 2f5a31e7f..ecb902625 100644 --- a/client/src/app/core/routing/login-guard.service.ts +++ b/client/src/app/core/routing/login-guard.service.ts @@ -1,10 +1,10 @@ import { Injectable } from '@angular/core' -import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router' +import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router' import { AuthService } from '../auth/auth.service' import { RedirectService } from './redirect.service' @Injectable() -export class LoginGuard implements CanActivate, CanActivateChild { +export class LoginGuard { constructor ( private auth: AuthService, diff --git a/client/src/app/core/routing/menu-guard.service.ts b/client/src/app/core/routing/menu-guard.service.ts index 58ad31cf4..765862b59 100644 --- a/client/src/app/core/routing/menu-guard.service.ts +++ b/client/src/app/core/routing/menu-guard.service.ts @@ -1,9 +1,8 @@ import { Injectable } from '@angular/core' -import { CanActivate, CanDeactivate } from '@angular/router' import { MenuService } from '../menu' import { ScreenService } from '../wrappers' -abstract class MenuGuard implements CanActivate, CanDeactivate { +abstract class MenuGuard { canDeactivate = this.canActivate constructor (protected menu: MenuService, protected screen: ScreenService, protected display: boolean) { diff --git a/client/src/app/core/routing/meta-guard.service.ts b/client/src/app/core/routing/meta-guard.service.ts index 851404959..b68e06abe 100644 --- a/client/src/app/core/routing/meta-guard.service.ts +++ b/client/src/app/core/routing/meta-guard.service.ts @@ -1,9 +1,9 @@ import { Injectable } from '@angular/core' -import { ActivatedRouteSnapshot, CanActivate, CanActivateChild } from '@angular/router' +import { ActivatedRouteSnapshot } from '@angular/router' import { MetaService } from './meta.service' @Injectable() -export class MetaGuard implements CanActivate, CanActivateChild { +export class MetaGuard { constructor (private meta: MetaService) { } diff --git a/client/src/app/core/routing/server-config-resolver.service.ts b/client/src/app/core/routing/server-config-resolver.service.ts index 0ce2023a0..8d2390d38 100644 --- a/client/src/app/core/routing/server-config-resolver.service.ts +++ b/client/src/app/core/routing/server-config-resolver.service.ts @@ -1,10 +1,8 @@ import { Injectable } from '@angular/core' -import { Resolve } from '@angular/router' import { ServerService } from '../server' -import { ServerConfig } from '@shared/models' @Injectable() -export class ServerConfigResolver implements Resolve { +export class ServerConfigResolver { constructor (private server: ServerService) {} resolve () { diff --git a/client/src/app/core/routing/unlogged-guard.service.ts b/client/src/app/core/routing/unlogged-guard.service.ts index 0be7911a0..9920ee41d 100644 --- a/client/src/app/core/routing/unlogged-guard.service.ts +++ b/client/src/app/core/routing/unlogged-guard.service.ts @@ -1,10 +1,10 @@ import { Injectable } from '@angular/core' -import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router' +import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router' import { AuthService } from '../auth/auth.service' import { RedirectService } from './redirect.service' @Injectable() -export class UnloggedGuard implements CanActivate, CanActivateChild { +export class UnloggedGuard { constructor ( private auth: AuthService, diff --git a/client/src/app/core/routing/user-right-guard.service.ts b/client/src/app/core/routing/user-right-guard.service.ts index c6bd05bb6..9f293f628 100644 --- a/client/src/app/core/routing/user-right-guard.service.ts +++ b/client/src/app/core/routing/user-right-guard.service.ts @@ -1,10 +1,10 @@ import { Injectable } from '@angular/core' -import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router' +import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router' import { AuthService } from '../auth/auth.service' import { RedirectService } from './redirect.service' @Injectable() -export class UserRightGuard implements CanActivate, CanActivateChild { +export class UserRightGuard { constructor ( private redirectService: RedirectService, -- cgit v1.2.3