diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-23 11:15:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-05-23 11:27:09 +0200 |
commit | 52798aa5f277492d4dd2482bca9396d2e982fa19 (patch) | |
tree | c3b8057acf3860aacc92743b9d92214ad0364fcb /client/src/app | |
parent | f89189907bbdff6c4bc6d3460ed9ef4c49515f17 (diff) | |
download | PeerTube-52798aa5f277492d4dd2482bca9396d2e982fa19.tar.gz PeerTube-52798aa5f277492d4dd2482bca9396d2e982fa19.tar.zst PeerTube-52798aa5f277492d4dd2482bca9396d2e982fa19.zip |
Update angular
Diffstat (limited to 'client/src/app')
14 files changed, 25 insertions, 29 deletions
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 @@ | |||
1 | import { forkJoin, Observable } from 'rxjs' | 1 | import { forkJoin, Observable } from 'rxjs' |
2 | import { map, switchMap } from 'rxjs/operators' | 2 | import { map, switchMap } from 'rxjs/operators' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { Resolve } from '@angular/router' | ||
5 | import { ServerService } from '@app/core' | 4 | import { ServerService } from '@app/core' |
6 | import { CustomMarkupService } from '@app/shared/shared-custom-markup' | 5 | import { CustomMarkupService } from '@app/shared/shared-custom-markup' |
7 | import { AboutHTML, InstanceService } from '@app/shared/shared-instance' | 6 | import { AboutHTML, InstanceService } from '@app/shared/shared-instance' |
@@ -17,7 +16,7 @@ export type ResolverData = { | |||
17 | } | 16 | } |
18 | 17 | ||
19 | @Injectable() | 18 | @Injectable() |
20 | export class AboutInstanceResolver implements Resolve<any> { | 19 | export class AboutInstanceResolver { |
21 | 20 | ||
22 | constructor ( | 21 | constructor ( |
23 | private instanceService: InstanceService, | 22 | 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 @@ | |||
1 | import { Observable } from 'rxjs' | 1 | import { Observable } from 'rxjs' |
2 | import { map } from 'rxjs/operators' | 2 | import { map } from 'rxjs/operators' |
3 | import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router' | 3 | import { ActivatedRouteSnapshot, Router } from '@angular/router' |
4 | import { logger } from '@root-helpers/logger' | 4 | import { logger } from '@root-helpers/logger' |
5 | import { ResultList } from '@shared/models' | 5 | import { ResultList } from '@shared/models' |
6 | 6 | ||
7 | export abstract class AbstractLazyLoadResolver <T> implements Resolve<any> { | 7 | export abstract class AbstractLazyLoadResolver <T> { |
8 | protected router: Router | 8 | protected router: Router |
9 | 9 | ||
10 | resolve (route: ActivatedRouteSnapshot) { | 10 | 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 @@ | |||
1 | import { forkJoin, of } from 'rxjs' | 1 | import { forkJoin, of } from 'rxjs' |
2 | import { map, switchMap } from 'rxjs/operators' | 2 | import { map, switchMap } from 'rxjs/operators' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' | 4 | import { ActivatedRouteSnapshot } from '@angular/router' |
5 | import { AuthService } from '@app/core' | 5 | import { AuthService } from '@app/core' |
6 | import { listUserChannelsForSelect } from '@app/helpers' | 6 | import { listUserChannelsForSelect } from '@app/helpers' |
7 | import { VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main' | 7 | import { VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main' |
8 | import { LiveVideoService } from '@app/shared/shared-video-live' | 8 | import { LiveVideoService } from '@app/shared/shared-video-live' |
9 | 9 | ||
10 | @Injectable() | 10 | @Injectable() |
11 | export class VideoUpdateResolver implements Resolve<any> { | 11 | export class VideoUpdateResolver { |
12 | constructor ( | 12 | constructor ( |
13 | private videoService: VideoService, | 13 | private videoService: VideoService, |
14 | private liveVideoService: LiveVideoService, | 14 | 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 @@ | |||
1 | import debug from 'debug' | 1 | import debug from 'debug' |
2 | import { LazyLoadEvent, SortMeta } from 'primeng/api' | 2 | import { SortMeta } from 'primeng/api' |
3 | import { TableLazyLoadEvent } from 'primeng/table' | ||
3 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { logger } from '@root-helpers/logger' | 5 | import { logger } from '@root-helpers/logger' |
5 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' | 6 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' |
@@ -46,12 +47,12 @@ export abstract class RestTable <T = unknown> { | |||
46 | peertubeLocalStorage.setItem(this.getSortLocalStorageKey(), JSON.stringify(this.sort)) | 47 | peertubeLocalStorage.setItem(this.getSortLocalStorageKey(), JSON.stringify(this.sort)) |
47 | } | 48 | } |
48 | 49 | ||
49 | loadLazy (event: LazyLoadEvent) { | 50 | loadLazy (event: TableLazyLoadEvent) { |
50 | debugLogger('Load lazy %o.', event) | 51 | debugLogger('Load lazy %o.', event) |
51 | 52 | ||
52 | this.sort = { | 53 | this.sort = { |
53 | order: event.sortOrder, | 54 | order: event.sortOrder, |
54 | field: event.sortField | 55 | field: event.sortField as string |
55 | } | 56 | } |
56 | 57 | ||
57 | this.rowsPerPage = event.rows | 58 | 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 @@ | |||
1 | import { Observable } from 'rxjs' | 1 | import { Observable } from 'rxjs' |
2 | import { Injectable } from '@angular/core' | 2 | import { Injectable } from '@angular/core' |
3 | import { CanDeactivate } from '@angular/router' | ||
4 | import { ConfirmService } from '@app/core/confirm' | 3 | import { ConfirmService } from '@app/core/confirm' |
5 | 4 | ||
6 | export type CanComponentDeactivateResult = { text?: string, canDeactivate: Observable<boolean> | boolean } | 5 | export type CanComponentDeactivateResult = { text?: string, canDeactivate: Observable<boolean> | boolean } |
@@ -10,7 +9,7 @@ export interface CanComponentDeactivate { | |||
10 | } | 9 | } |
11 | 10 | ||
12 | @Injectable() | 11 | @Injectable() |
13 | export class CanDeactivateGuard implements CanDeactivate<CanComponentDeactivate> { | 12 | export class CanDeactivateGuard { |
14 | 13 | ||
15 | constructor (private confirmService: ConfirmService) { } | 14 | constructor (private confirmService: ConfirmService) { } |
16 | 15 | ||
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 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router' | 2 | import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router' |
3 | import { AuthService } from '../auth/auth.service' | 3 | import { AuthService } from '../auth/auth.service' |
4 | import { RedirectService } from './redirect.service' | 4 | import { RedirectService } from './redirect.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class LoginGuard implements CanActivate, CanActivateChild { | 7 | export class LoginGuard { |
8 | 8 | ||
9 | constructor ( | 9 | constructor ( |
10 | private auth: AuthService, | 10 | 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 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { CanActivate, CanDeactivate } from '@angular/router' | ||
3 | import { MenuService } from '../menu' | 2 | import { MenuService } from '../menu' |
4 | import { ScreenService } from '../wrappers' | 3 | import { ScreenService } from '../wrappers' |
5 | 4 | ||
6 | abstract class MenuGuard implements CanActivate, CanDeactivate<any> { | 5 | abstract class MenuGuard { |
7 | canDeactivate = this.canActivate | 6 | canDeactivate = this.canActivate |
8 | 7 | ||
9 | constructor (protected menu: MenuService, protected screen: ScreenService, protected display: boolean) { | 8 | 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 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild } from '@angular/router' | 2 | import { ActivatedRouteSnapshot } from '@angular/router' |
3 | import { MetaService } from './meta.service' | 3 | import { MetaService } from './meta.service' |
4 | 4 | ||
5 | @Injectable() | 5 | @Injectable() |
6 | export class MetaGuard implements CanActivate, CanActivateChild { | 6 | export class MetaGuard { |
7 | 7 | ||
8 | constructor (private meta: MetaService) { } | 8 | constructor (private meta: MetaService) { } |
9 | 9 | ||
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 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { Resolve } from '@angular/router' | ||
3 | import { ServerService } from '../server' | 2 | import { ServerService } from '../server' |
4 | import { ServerConfig } from '@shared/models' | ||
5 | 3 | ||
6 | @Injectable() | 4 | @Injectable() |
7 | export class ServerConfigResolver implements Resolve<ServerConfig> { | 5 | export class ServerConfigResolver { |
8 | constructor (private server: ServerService) {} | 6 | constructor (private server: ServerService) {} |
9 | 7 | ||
10 | resolve () { | 8 | 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 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router' | 2 | import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router' |
3 | import { AuthService } from '../auth/auth.service' | 3 | import { AuthService } from '../auth/auth.service' |
4 | import { RedirectService } from './redirect.service' | 4 | import { RedirectService } from './redirect.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class UnloggedGuard implements CanActivate, CanActivateChild { | 7 | export class UnloggedGuard { |
8 | 8 | ||
9 | constructor ( | 9 | constructor ( |
10 | private auth: AuthService, | 10 | 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 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router' | 2 | import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router' |
3 | import { AuthService } from '../auth/auth.service' | 3 | import { AuthService } from '../auth/auth.service' |
4 | import { RedirectService } from './redirect.service' | 4 | import { RedirectService } from './redirect.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class UserRightGuard implements CanActivate, CanActivateChild { | 7 | export class UserRightGuard { |
8 | 8 | ||
9 | constructor ( | 9 | constructor ( |
10 | private redirectService: RedirectService, | 10 | 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 @@ | |||
1 | import { firstValueFrom } from 'rxjs' | 1 | import { firstValueFrom } from 'rxjs' |
2 | import { ComponentRef, Injectable } from '@angular/core' | 2 | import { ComponentRef, Injectable } from '@angular/core' |
3 | import { MarkdownService } from '@app/core' | 3 | import { MarkdownService } from '@app/core' |
4 | import { logger } from '@root-helpers/logger' | ||
4 | import { | 5 | import { |
5 | ButtonMarkupData, | 6 | ButtonMarkupData, |
6 | ChannelMiniatureMarkupData, | 7 | ChannelMiniatureMarkupData, |
@@ -20,7 +21,6 @@ import { | |||
20 | VideosListMarkupComponent | 21 | VideosListMarkupComponent |
21 | } from './peertube-custom-tags' | 22 | } from './peertube-custom-tags' |
22 | import { CustomMarkupComponent } from './peertube-custom-tags/shared' | 23 | import { CustomMarkupComponent } from './peertube-custom-tags/shared' |
23 | import { logger } from '@root-helpers/logger' | ||
24 | 24 | ||
25 | type AngularBuilderFunction = (el: HTMLElement) => ComponentRef<CustomMarkupComponent> | 25 | type AngularBuilderFunction = (el: HTMLElement) => ComponentRef<CustomMarkupComponent> |
26 | type HTMLBuilderFunction = (el: HTMLElement) => HTMLElement | 26 | 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 @@ | |||
1 | import { forkJoin, of } from 'rxjs' | 1 | import { forkJoin, of } from 'rxjs' |
2 | import { catchError, map } from 'rxjs/operators' | 2 | import { catchError, map } from 'rxjs/operators' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router' | 4 | import { ActivatedRouteSnapshot, Router } from '@angular/router' |
5 | import { AccountService } from '../account' | 5 | import { AccountService } from '../account' |
6 | import { VideoChannelService } from '../video-channel' | 6 | import { VideoChannelService } from '../video-channel' |
7 | 7 | ||
8 | @Injectable() | 8 | @Injectable() |
9 | export class ActorRedirectGuard implements CanActivate { | 9 | export class ActorRedirectGuard { |
10 | 10 | ||
11 | constructor ( | 11 | constructor ( |
12 | private router: Router, | 12 | 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 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' | 2 | import { ActivatedRouteSnapshot } from '@angular/router' |
3 | import { VideoService } from './video.service' | 3 | import { VideoService } from './video.service' |
4 | 4 | ||
5 | @Injectable() | 5 | @Injectable() |
6 | export class VideoResolver implements Resolve<any> { | 6 | export class VideoResolver { |
7 | constructor ( | 7 | constructor ( |
8 | private videoService: VideoService | 8 | private videoService: VideoService |
9 | ) { | 9 | ) { |