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/core | |
parent | f89189907bbdff6c4bc6d3460ed9ef4c49515f17 (diff) | |
download | PeerTube-52798aa5f277492d4dd2482bca9396d2e982fa19.tar.gz PeerTube-52798aa5f277492d4dd2482bca9396d2e982fa19.tar.zst PeerTube-52798aa5f277492d4dd2482bca9396d2e982fa19.zip |
Update angular
Diffstat (limited to 'client/src/app/core')
8 files changed, 15 insertions, 18 deletions
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, |