Browse Source

Update angular

Chocobozzz 1 year ago
parent
commit
52798aa5f2

+ 0 - 1
client/angular.json

@@ -310,7 +310,6 @@
       }
     }
   },
-  "defaultProject": "PeerTube",
   "schematics": {
     "@schematics/angular:component": {
       "prefix": "my",

+ 23 - 23
client/package.json

@@ -26,25 +26,25 @@
   },
   "typings": "*.d.ts",
   "devDependencies": {
-    "@angular-devkit/build-angular": "^15.1.6",
-    "@angular-eslint/builder": "^15.2.1",
-    "@angular-eslint/eslint-plugin": "^15.2.1",
-    "@angular-eslint/eslint-plugin-template": "^15.2.1",
-    "@angular-eslint/schematics": "^15.2.1",
-    "@angular-eslint/template-parser": "^15.2.1",
-    "@angular/animations": "^15.1.5",
-    "@angular/cdk": "^15.1.4",
-    "@angular/cli": "^15.1.6",
-    "@angular/common": "^15.1.5",
-    "@angular/compiler": "^15.1.5",
-    "@angular/compiler-cli": "^15.1.5",
-    "@angular/core": "^15.1.5",
-    "@angular/forms": "^15.1.5",
-    "@angular/localize": "^15.1.5",
-    "@angular/platform-browser": "^15.1.5",
-    "@angular/platform-browser-dynamic": "^15.1.5",
-    "@angular/router": "^15.1.5",
-    "@angular/service-worker": "^15.1.5",
+    "@angular-devkit/build-angular": "^16.0.2",
+    "@angular-eslint/builder": "^16.0.2",
+    "@angular-eslint/eslint-plugin": "^16.0.2",
+    "@angular-eslint/eslint-plugin-template": "^16.0.2",
+    "@angular-eslint/schematics": "^16.0.2",
+    "@angular-eslint/template-parser": "^16.0.2",
+    "@angular/animations": "^16.0.2",
+    "@angular/cdk": "^16.0.1",
+    "@angular/cli": "^16.0.2",
+    "@angular/common": "^16.0.2",
+    "@angular/compiler": "^16.0.2",
+    "@angular/compiler-cli": "^16.0.2",
+    "@angular/core": "^16.0.2",
+    "@angular/forms": "^16.0.2",
+    "@angular/localize": "^16.0.2",
+    "@angular/platform-browser": "^16.0.2",
+    "@angular/platform-browser-dynamic": "^16.0.2",
+    "@angular/router": "^16.0.2",
+    "@angular/service-worker": "^16.0.2",
     "@babel/core": "^7.18.5",
     "@babel/preset-env": "^7.18.2",
     "@ng-bootstrap/ng-bootstrap": "^14.0.1",
@@ -79,7 +79,7 @@
     "@wdio/shared-store-service": "^7.25.2",
     "@wdio/spec-reporter": "^7.25.1",
     "angular2-hotkeys": "^13.1.0",
-    "angularx-qrcode": "15.0.1",
+    "angularx-qrcode": "16.0.0",
     "babel-loader": "^9.1.0",
     "bootstrap": "^5.1.3",
     "buffer": "^6.0.3",
@@ -93,7 +93,7 @@
     "dexie": "^3.2.2",
     "eslint": "^8.28.0",
     "eslint-plugin-import": "2.27.5",
-    "eslint-plugin-jsdoc": "^40.0.0",
+    "eslint-plugin-jsdoc": "^44.2.4",
     "eslint-plugin-prefer-arrow": "latest",
     "expect-webdriverio": "^3.4.0",
     "focus-visible": "^5.0.2",
@@ -109,10 +109,10 @@
     "lodash-es": "^4.17.4",
     "markdown-it": "13.0.1",
     "mini-css-extract-plugin": "^2.2.0",
-    "ngx-uploadx": "^5.1.0",
+    "ngx-uploadx": "^6.1.0",
     "path-browserify": "^1.0.0",
     "postcss": "^8.4.14",
-    "primeng": "^15.2.0",
+    "primeng": "^16.0.0-rc.2",
     "process": "^0.11.10",
     "purify-css": "^1.2.5",
     "querystring": "^0.2.1",

+ 1 - 2
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<any> {
+export class AboutInstanceResolver  {
 
   constructor (
     private instanceService: InstanceService,

+ 2 - 2
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 <T> implements Resolve<any> {
+export abstract class AbstractLazyLoadResolver <T>  {
   protected router: Router
 
   resolve (route: ActivatedRouteSnapshot) {

+ 2 - 2
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<any> {
+export class VideoUpdateResolver {
   constructor (
     private videoService: VideoService,
     private liveVideoService: LiveVideoService,

+ 4 - 3
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 <T = unknown> {
     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

+ 1 - 2
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> | boolean }
@@ -10,7 +9,7 @@ export interface CanComponentDeactivate {
 }
 
 @Injectable()
-export class CanDeactivateGuard implements CanDeactivate<CanComponentDeactivate> {
+export class CanDeactivateGuard {
 
   constructor (private confirmService: ConfirmService) { }
 

+ 2 - 2
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,

+ 1 - 2
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<any> {
+abstract class MenuGuard {
   canDeactivate = this.canActivate
 
   constructor (protected menu: MenuService, protected screen: ScreenService, protected display: boolean) {

+ 2 - 2
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) { }
 

+ 1 - 3
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<ServerConfig> {
+export class ServerConfigResolver {
   constructor (private server: ServerService) {}
 
   resolve () {

+ 2 - 2
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,

+ 2 - 2
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,

+ 1 - 1
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<CustomMarkupComponent>
 type HTMLBuilderFunction = (el: HTMLElement) => HTMLElement

+ 2 - 2
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,

+ 2 - 2
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<any> {
+export class VideoResolver {
   constructor (
     private videoService: VideoService
   ) {

File diff suppressed because it is too large
+ 484 - 374
client/yarn.lock


Some files were not shown because too many files changed in this diff