From 2f5d2ec5ea4fedf2466e1db2d16878b1467b1e05 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Feb 2020 10:00:34 +0100 Subject: Update to angular 9 --- .../src/app/+my-account/shared/actor-avatar-info.component.ts | 2 +- client/src/app/+video-channels/video-channels.component.ts | 2 +- client/src/app/app.component.ts | 4 ++-- client/src/app/core/routing/custom-reuse-strategy.ts | 2 ++ client/src/app/core/routing/preload-selected-modules-list.ts | 2 ++ .../shared/moderation/user-moderation-dropdown.component.ts | 2 +- .../video-playlist-element-miniature.component.ts | 2 +- .../src/app/shared/video/video-actions-dropdown.component.ts | 10 +++++----- .../video-add-components/video-import-torrent.component.ts | 2 +- .../+video-edit/video-add-components/video-upload.component.ts | 2 +- client/src/app/videos/+video-edit/video-add.component.ts | 6 +++--- .../videos/+video-watch/comment/video-comments.component.ts | 2 +- client/src/app/videos/+video-watch/video-watch.component.ts | 6 +++--- client/src/ngsw-config.json | 3 ++- 14 files changed, 26 insertions(+), 21 deletions(-) (limited to 'client/src') diff --git a/client/src/app/+my-account/shared/actor-avatar-info.component.ts b/client/src/app/+my-account/shared/actor-avatar-info.component.ts index 101dfa556..8e034bb82 100644 --- a/client/src/app/+my-account/shared/actor-avatar-info.component.ts +++ b/client/src/app/+my-account/shared/actor-avatar-info.component.ts @@ -11,7 +11,7 @@ import { ServerConfig } from '@shared/models' styleUrls: [ './actor-avatar-info.component.scss' ] }) export class ActorAvatarInfoComponent implements OnInit { - @ViewChild('avatarfileInput', { static: false }) avatarfileInput: ElementRef + @ViewChild('avatarfileInput') avatarfileInput: ElementRef @Input() actor: VideoChannel | Account diff --git a/client/src/app/+video-channels/video-channels.component.ts b/client/src/app/+video-channels/video-channels.component.ts index 7b335b13f..5ca9581a8 100644 --- a/client/src/app/+video-channels/video-channels.component.ts +++ b/client/src/app/+video-channels/video-channels.component.ts @@ -15,7 +15,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill' styleUrls: [ './video-channels.component.scss' ] }) export class VideoChannelsComponent implements OnInit, OnDestroy { - @ViewChild('subscribeButton', { static: false }) subscribeButton: SubscribeButtonComponent + @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent videoChannel: VideoChannel hotkeys: Hotkey[] diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 03eb83cb8..59966243b 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -25,8 +25,8 @@ import { InstanceService } from '@app/shared/instance/instance.service' styleUrls: [ './app.component.scss' ] }) export class AppComponent implements OnInit { - @ViewChild('welcomeModal', { static: false }) welcomeModal: WelcomeModalComponent - @ViewChild('instanceConfigWarningModal', { static: false }) instanceConfigWarningModal: InstanceConfigWarningModalComponent + @ViewChild('welcomeModal') welcomeModal: WelcomeModalComponent + @ViewChild('instanceConfigWarningModal') instanceConfigWarningModal: InstanceConfigWarningModalComponent isMenuDisplayed = true isMenuChangedByUser = false diff --git a/client/src/app/core/routing/custom-reuse-strategy.ts b/client/src/app/core/routing/custom-reuse-strategy.ts index a9f61acec..cbba82f1f 100644 --- a/client/src/app/core/routing/custom-reuse-strategy.ts +++ b/client/src/app/core/routing/custom-reuse-strategy.ts @@ -1,5 +1,7 @@ import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router' +import { Injectable } from "@angular/core"; +@Injectable() export class CustomReuseStrategy implements RouteReuseStrategy { storedRouteHandles = new Map() recentlyUsed: string diff --git a/client/src/app/core/routing/preload-selected-modules-list.ts b/client/src/app/core/routing/preload-selected-modules-list.ts index 3bca60317..aa1c76516 100644 --- a/client/src/app/core/routing/preload-selected-modules-list.ts +++ b/client/src/app/core/routing/preload-selected-modules-list.ts @@ -1,7 +1,9 @@ import { Observable, timer as observableTimer, of as ofObservable } from 'rxjs' import { switchMap } from 'rxjs/operators' import { PreloadingStrategy, Route } from '@angular/router' +import { Injectable } from "@angular/core"; +@Injectable() export class PreloadSelectedModulesList implements PreloadingStrategy { preload (route: Route, load: Function): Observable { if (!route.data || !route.data.preload) return ofObservable(null) diff --git a/client/src/app/shared/moderation/user-moderation-dropdown.component.ts b/client/src/app/shared/moderation/user-moderation-dropdown.component.ts index 11d8588f4..9197556b0 100644 --- a/client/src/app/shared/moderation/user-moderation-dropdown.component.ts +++ b/client/src/app/shared/moderation/user-moderation-dropdown.component.ts @@ -14,7 +14,7 @@ import { ServerConfig } from '@shared/models' templateUrl: './user-moderation-dropdown.component.html' }) export class UserModerationDropdownComponent implements OnInit, OnChanges { - @ViewChild('userBanModal', { static: false }) userBanModal: UserBanModalComponent + @ViewChild('userBanModal') userBanModal: UserBanModalComponent @Input() user: User @Input() account: Account diff --git a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts index 4864581b5..a2c0724cd 100644 --- a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts +++ b/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts @@ -18,7 +18,7 @@ import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist- changeDetection: ChangeDetectionStrategy.OnPush }) export class VideoPlaylistElementMiniatureComponent implements OnInit { - @ViewChild('moreDropdown', { static: false }) moreDropdown: NgbDropdown + @ViewChild('moreDropdown') moreDropdown: NgbDropdown @Input() playlist: VideoPlaylist @Input() playlistElement: VideoPlaylistElement diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/video/video-actions-dropdown.component.ts index 390d74c52..69f45346e 100644 --- a/client/src/app/shared/video/video-actions-dropdown.component.ts +++ b/client/src/app/shared/video/video-actions-dropdown.component.ts @@ -32,12 +32,12 @@ export type VideoActionsDisplayType = { styleUrls: [ './video-actions-dropdown.component.scss' ] }) export class VideoActionsDropdownComponent implements OnChanges { - @ViewChild('playlistDropdown', { static: false }) playlistDropdown: NgbDropdown - @ViewChild('playlistAdd', { static: false }) playlistAdd: VideoAddToPlaylistComponent + @ViewChild('playlistDropdown') playlistDropdown: NgbDropdown + @ViewChild('playlistAdd') playlistAdd: VideoAddToPlaylistComponent - @ViewChild('videoDownloadModal', { static: false }) videoDownloadModal: VideoDownloadComponent - @ViewChild('videoReportModal', { static: false }) videoReportModal: VideoReportComponent - @ViewChild('videoBlacklistModal', { static: false }) videoBlacklistModal: VideoBlacklistComponent + @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent + @ViewChild('videoReportModal') videoReportModal: VideoReportComponent + @ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent @Input() video: Video | VideoDetails @Input() videoCaptions: VideoCaption[] = [] diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts index 74e1e755b..e47624dd6 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts @@ -25,7 +25,7 @@ import { scrollToTop } from '@app/shared/misc/utils' export class VideoImportTorrentComponent extends VideoSend implements OnInit, CanComponentDeactivate { @Output() firstStepDone = new EventEmitter() @Output() firstStepError = new EventEmitter() - @ViewChild('torrentfileInput', { static: false }) torrentfileInput: ElementRef + @ViewChild('torrentfileInput') torrentfileInput: ElementRef magnetUri = '' diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts index aa87f9581..efdd284e8 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts @@ -27,7 +27,7 @@ import { scrollToTop } from '@app/shared/misc/utils' export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy, CanComponentDeactivate { @Output() firstStepDone = new EventEmitter() @Output() firstStepError = new EventEmitter() - @ViewChild('videofileInput', { static: false }) videofileInput: ElementRef + @ViewChild('videofileInput') videofileInput: ElementRef // So that it can be accessed in the template readonly SPECIAL_SCHEDULED_PRIVACY = VideoEdit.SPECIAL_SCHEDULED_PRIVACY diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index 401d8a08f..30ab08ea0 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts @@ -12,9 +12,9 @@ import { ServerConfig } from '@shared/models' styleUrls: [ './video-add.component.scss' ] }) export class VideoAddComponent implements OnInit, CanComponentDeactivate { - @ViewChild('videoUpload', { static: false }) videoUpload: VideoUploadComponent - @ViewChild('videoImportUrl', { static: false }) videoImportUrl: VideoImportUrlComponent - @ViewChild('videoImportTorrent', { static: false }) videoImportTorrent: VideoImportTorrentComponent + @ViewChild('videoUpload') videoUpload: VideoUploadComponent + @ViewChild('videoImportUrl') videoImportUrl: VideoImportUrlComponent + @ViewChild('videoImportTorrent') videoImportTorrent: VideoImportTorrentComponent secondStepType: 'upload' | 'import-url' | 'import-torrent' videoName: string diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts index 974c61d6c..47720b0ea 100644 --- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts @@ -20,7 +20,7 @@ import { HooksService } from '@app/core/plugins/hooks.service' styleUrls: ['./video-comments.component.scss'] }) export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { - @ViewChild('commentHighlightBlock', { static: false }) commentHighlightBlock: ElementRef + @ViewChild('commentHighlightBlock') commentHighlightBlock: ElementRef @Input() video: VideoDetails @Input() user: User diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index e09e44809..ee3deb5e9 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -47,9 +47,9 @@ export class VideoWatchComponent implements OnInit, OnDestroy { private static LOCAL_STORAGE_PRIVACY_CONCERN_KEY = 'video-watch-privacy-concern' @ViewChild('videoWatchPlaylist', { static: true }) videoWatchPlaylist: VideoWatchPlaylistComponent - @ViewChild('videoShareModal', { static: false }) videoShareModal: VideoShareComponent - @ViewChild('videoSupportModal', { static: false }) videoSupportModal: VideoSupportComponent - @ViewChild('subscribeButton', { static: false }) subscribeButton: SubscribeButtonComponent + @ViewChild('videoShareModal') videoShareModal: VideoShareComponent + @ViewChild('videoSupportModal') videoSupportModal: VideoSupportComponent + @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent player: any playerElement: HTMLVideoElement diff --git a/client/src/ngsw-config.json b/client/src/ngsw-config.json index 25f099654..b5d11e59a 100644 --- a/client/src/ngsw-config.json +++ b/client/src/ngsw-config.json @@ -10,7 +10,8 @@ "/client/assets/images/favicon.png", "/client/*.bundle.css", "/client/*.bundle.js", - "/client/*.chunk.js" + "/client/*.chunk.js", + "/manifest.webmanifest" ] } }, -- cgit v1.2.3