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/+about/about-instance/about-instance.resolver.ts | 3 +-- client/src/app/+search/shared/abstract-lazy-load.resolver.ts | 4 ++-- client/src/app/+videos/+video-edit/video-update.resolver.ts | 4 ++-- 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 ++-- .../src/app/shared/shared-custom-markup/custom-markup.service.ts | 2 +- .../app/shared/shared-main/router/actor-redirect-guard.service.ts | 4 ++-- client/src/app/shared/shared-main/video/video.resolver.ts | 4 ++-- 14 files changed, 25 insertions(+), 29 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/+about/about-instance/about-instance.resolver.ts b/client/src/app/+about/about-instance/about-instance.resolver.ts index 94388e71d..5c09b0f46 100644 --- a/client/src/app/+about/about-instance/about-instance.resolver.ts +++ b/client/src/app/+about/about-instance/about-instance.resolver.ts @@ -1,7 +1,6 @@ import { forkJoin, Observable } from 'rxjs' import { map, switchMap } from 'rxjs/operators' import { Injectable } from '@angular/core' -import { Resolve } from '@angular/router' import { ServerService } from '@app/core' import { CustomMarkupService } from '@app/shared/shared-custom-markup' import { AboutHTML, InstanceService } from '@app/shared/shared-instance' @@ -17,7 +16,7 @@ export type ResolverData = { } @Injectable() -export class AboutInstanceResolver implements Resolve { +export class AboutInstanceResolver { constructor ( private instanceService: InstanceService, diff --git a/client/src/app/+search/shared/abstract-lazy-load.resolver.ts b/client/src/app/+search/shared/abstract-lazy-load.resolver.ts index 7551d977d..6940a7a9b 100644 --- a/client/src/app/+search/shared/abstract-lazy-load.resolver.ts +++ b/client/src/app/+search/shared/abstract-lazy-load.resolver.ts @@ -1,10 +1,10 @@ import { Observable } from 'rxjs' import { map } from 'rxjs/operators' -import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router' +import { ActivatedRouteSnapshot, Router } from '@angular/router' import { logger } from '@root-helpers/logger' import { ResultList } from '@shared/models' -export abstract class AbstractLazyLoadResolver implements Resolve { +export abstract class AbstractLazyLoadResolver { protected router: Router resolve (route: ActivatedRouteSnapshot) { diff --git a/client/src/app/+videos/+video-edit/video-update.resolver.ts b/client/src/app/+videos/+video-edit/video-update.resolver.ts index 524ceae10..6612d22de 100644 --- a/client/src/app/+videos/+video-edit/video-update.resolver.ts +++ b/client/src/app/+videos/+video-edit/video-update.resolver.ts @@ -1,14 +1,14 @@ import { forkJoin, of } from 'rxjs' import { map, switchMap } from 'rxjs/operators' import { Injectable } from '@angular/core' -import { ActivatedRouteSnapshot, Resolve } from '@angular/router' +import { ActivatedRouteSnapshot } from '@angular/router' import { AuthService } from '@app/core' import { listUserChannelsForSelect } from '@app/helpers' import { VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main' import { LiveVideoService } from '@app/shared/shared-video-live' @Injectable() -export class VideoUpdateResolver implements Resolve { +export class VideoUpdateResolver { constructor ( private videoService: VideoService, private liveVideoService: LiveVideoService, 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, diff --git a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts index 618c3dd4f..b49f64834 100644 --- a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts +++ b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts @@ -1,6 +1,7 @@ import { firstValueFrom } from 'rxjs' import { ComponentRef, Injectable } from '@angular/core' import { MarkdownService } from '@app/core' +import { logger } from '@root-helpers/logger' import { ButtonMarkupData, ChannelMiniatureMarkupData, @@ -20,7 +21,6 @@ import { VideosListMarkupComponent } from './peertube-custom-tags' import { CustomMarkupComponent } from './peertube-custom-tags/shared' -import { logger } from '@root-helpers/logger' type AngularBuilderFunction = (el: HTMLElement) => ComponentRef type HTMLBuilderFunction = (el: HTMLElement) => HTMLElement diff --git a/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts b/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts index ce185829c..53a48f8a1 100644 --- a/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts +++ b/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts @@ -1,12 +1,12 @@ import { forkJoin, of } from 'rxjs' import { catchError, map } from 'rxjs/operators' import { Injectable } from '@angular/core' -import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router' +import { ActivatedRouteSnapshot, Router } from '@angular/router' import { AccountService } from '../account' import { VideoChannelService } from '../video-channel' @Injectable() -export class ActorRedirectGuard implements CanActivate { +export class ActorRedirectGuard { constructor ( private router: Router, diff --git a/client/src/app/shared/shared-main/video/video.resolver.ts b/client/src/app/shared/shared-main/video/video.resolver.ts index 65b7230ce..dc07bb5da 100644 --- a/client/src/app/shared/shared-main/video/video.resolver.ts +++ b/client/src/app/shared/shared-main/video/video.resolver.ts @@ -1,9 +1,9 @@ import { Injectable } from '@angular/core' -import { ActivatedRouteSnapshot, Resolve } from '@angular/router' +import { ActivatedRouteSnapshot } from '@angular/router' import { VideoService } from './video.service' @Injectable() -export class VideoResolver implements Resolve { +export class VideoResolver { constructor ( private videoService: VideoService ) { -- cgit v1.2.3