From 9df52d660feb722404be00a50f3c8a612bec1c15 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Aug 2021 14:42:53 +0200 Subject: Migrate client to eslint --- .../+my-video-channels/my-video-channel-create.component.ts | 4 ++-- .../+my-video-channels/my-video-channel-update.component.ts | 8 ++++++-- .../+my-video-channels/my-video-channels.component.ts | 8 ++++---- client/src/app/+my-library/my-history/my-history.component.ts | 7 +++---- client/src/app/+my-library/my-library.component.ts | 2 +- .../my-accept-ownership/my-accept-ownership.component.ts | 2 +- .../my-video-playlists/my-video-playlist-create.component.ts | 6 ++++-- .../my-video-playlists/my-video-playlist-elements.component.ts | 4 +--- .../my-video-playlists/my-video-playlist-update.component.ts | 10 +++++++--- .../my-videos/modals/video-change-ownership.component.ts | 6 ++++-- client/src/app/+my-library/my-videos/my-videos.component.ts | 4 ++-- 11 files changed, 35 insertions(+), 26 deletions(-) (limited to 'client/src/app/+my-library') diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channel-create.component.ts b/client/src/app/+my-library/+my-video-channels/my-video-channel-create.component.ts index d983aacd9..fd00720d8 100644 --- a/client/src/app/+my-library/+my-video-channels/my-video-channel-create.component.ts +++ b/client/src/app/+my-library/+my-video-channels/my-video-channel-create.component.ts @@ -31,7 +31,7 @@ export class MyVideoChannelCreateComponent extends MyVideoChannelEdit implements private notifier: Notifier, private router: Router, private videoChannelService: VideoChannelService - ) { + ) { super() } @@ -64,7 +64,7 @@ export class MyVideoChannelCreateComponent extends MyVideoChannelEdit implements this.authService.refreshUserInformation() this.notifier.success($localize`Video channel ${videoChannelCreate.displayName} created.`) - this.router.navigate(['/my-library', 'video-channels']) + this.router.navigate([ '/my-library', 'video-channels' ]) }, error: err => { diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts b/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts index e8bfbf9ce..f9521b8b5 100644 --- a/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts +++ b/client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts @@ -66,7 +66,9 @@ export class MyVideoChannelUpdateComponent extends MyVideoChannelEdit implements }) }, - error: err => this.error = err.message + error: err => { + this.error = err.message + } }) }) } @@ -96,7 +98,9 @@ export class MyVideoChannelUpdateComponent extends MyVideoChannelEdit implements this.router.navigate([ '/my-library', 'video-channels' ]) }, - error: err => this.error = err.message + error: err => { + this.error = err.message + } }) } diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts index 8b665fd58..303f783fd 100644 --- a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts +++ b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts @@ -121,16 +121,16 @@ channel with the same name (${videoChannel.name})!`, display: false }, scales: { - xAxes: [{ + xAxes: [ { display: false - }], - yAxes: [{ + } ], + yAxes: [ { display: false, ticks: { min: Math.max(0, this.videoChannelsMinimumDailyViews - (3 * this.videoChannelsMaximumDailyViews / 100)), max: Math.max(1, this.videoChannelsMaximumDailyViews) } - }] + } ] }, layout: { padding: { diff --git a/client/src/app/+my-library/my-history/my-history.component.ts b/client/src/app/+my-library/my-history/my-history.component.ts index fe6e86346..a72d22e1c 100644 --- a/client/src/app/+my-library/my-history/my-history.component.ts +++ b/client/src/app/+my-library/my-history/my-history.component.ts @@ -1,4 +1,3 @@ -import { Subject } from 'rxjs' import { tap } from 'rxjs/operators' import { Component, ComponentFactoryResolver, OnInit, ViewChild } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' @@ -109,9 +108,9 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { this.userService.updateMyProfile({ videosHistoryEnabled: this.videosHistoryEnabled }) .subscribe({ next: () => { - const message = this.videosHistoryEnabled === true ? - $localize`Videos history is enabled` : - $localize`Videos history is disabled` + const message = this.videosHistoryEnabled === true + ? $localize`Videos history is enabled` + : $localize`Videos history is disabled` this.notifier.success(message) diff --git a/client/src/app/+my-library/my-library.component.ts b/client/src/app/+my-library/my-library.component.ts index 2ee3559a7..16a7f63e3 100644 --- a/client/src/app/+my-library/my-library.component.ts +++ b/client/src/app/+my-library/my-library.component.ts @@ -17,7 +17,7 @@ export class MyLibraryComponent implements OnInit { private serverService: ServerService, private authService: AuthService, private screenService: ScreenService - ) { } + ) { } get isBroadcastMessageDisplayed () { return this.screenService.isBroadcastMessageDisplayed diff --git a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts index b92377bca..764da2369 100644 --- a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts +++ b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts @@ -29,7 +29,7 @@ export class MyAcceptOwnershipComponent extends FormReactive implements OnInit { private notifier: Notifier, private authService: AuthService, private modalService: NgbModal - ) { + ) { super() } diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-create.component.ts b/client/src/app/+my-library/my-video-playlists/my-video-playlist-create.component.ts index 3e3c3c878..8bc78b2db 100644 --- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-create.component.ts +++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-create.component.ts @@ -29,7 +29,7 @@ export class MyVideoPlaylistCreateComponent extends MyVideoPlaylistEdit implemen private router: Router, private videoPlaylistService: VideoPlaylistService, private serverService: ServerService - ) { + ) { super() } @@ -78,7 +78,9 @@ export class MyVideoPlaylistCreateComponent extends MyVideoPlaylistEdit implemen this.router.navigate([ '/my-library', 'video-playlists' ]) }, - error: err => this.error = err.message + error: err => { + this.error = err.message + } }) } diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts b/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts index 6aff5dbd7..d6959a50e 100644 --- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts +++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts @@ -57,7 +57,7 @@ export class MyVideoPlaylistElementsComponent implements OnInit, OnDestroy { ] this.paramsSub = this.route.params.subscribe(routeParams => { - this.videoPlaylistId = routeParams[ 'videoPlaylistId' ] + this.videoPlaylistId = routeParams['videoPlaylistId'] this.loadElements() this.loadPlaylistInfo() @@ -145,8 +145,6 @@ export class MyVideoPlaylistElementsComponent implements OnInit, OnDestroy { * we add a delay to prevent unwanted drag&drop. * * @see {@link https://github.com/Chocobozzz/PeerTube/issues/2078} - * - * @returns {null|number} Null for no delay, or a number in milliseconds. */ getDragStartDelay (): null | number { if (this.screenService.isInTouchScreen()) { diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-update.component.ts b/client/src/app/+my-library/my-video-playlists/my-video-playlist-update.component.ts index a3f54279b..06ac3ad50 100644 --- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-update.component.ts +++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-update.component.ts @@ -65,14 +65,16 @@ export class MyVideoPlaylistUpdateComponent extends MyVideoPlaylistEdit implemen }) ) .subscribe({ - next: ([ videoPlaylistToUpdate, videoPlaylistPrivacies]) => { + next: ([ videoPlaylistToUpdate, videoPlaylistPrivacies ]) => { this.videoPlaylistToUpdate = videoPlaylistToUpdate this.videoPlaylistPrivacies = videoPlaylistPrivacies this.hydrateFormFromPlaylist() }, - error: err => this.error = err.message + error: err => { + this.error = err.message + } }) } @@ -99,7 +101,9 @@ export class MyVideoPlaylistUpdateComponent extends MyVideoPlaylistEdit implemen this.router.navigate([ '/my-library', 'video-playlists' ]) }, - error: err => this.error = err.message + error: err => { + this.error = err.message + } }) } diff --git a/client/src/app/+my-library/my-videos/modals/video-change-ownership.component.ts b/client/src/app/+my-library/my-videos/modals/video-change-ownership.component.ts index 8c1f94bf3..960c9a4f7 100644 --- a/client/src/app/+my-library/my-videos/modals/video-change-ownership.component.ts +++ b/client/src/app/+my-library/my-videos/modals/video-change-ownership.component.ts @@ -25,7 +25,7 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni private notifier: Notifier, private userService: UserService, private modalService: NgbModal - ) { + ) { super() } @@ -49,7 +49,9 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni const query = event.query this.userService.autocomplete(query) .subscribe({ - next: usernames => this.usernamePropositions = usernames, + next: usernames => { + this.usernamePropositions = usernames + }, error: err => this.notifier.error(err.message) }) diff --git a/client/src/app/+my-library/my-videos/my-videos.component.ts b/client/src/app/+my-library/my-videos/my-videos.component.ts index 4f9b71cc6..edb9392dd 100644 --- a/client/src/app/+my-library/my-videos/my-videos.component.ts +++ b/client/src/app/+my-library/my-videos/my-videos.component.ts @@ -49,7 +49,7 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { inputFilters: AdvancedInputFilter[] = [ { - queryParams: { 'search': 'isLive:true' }, + queryParams: { search: 'isLive:true' }, label: $localize`Only live videos` } ] @@ -107,7 +107,7 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { async deleteSelectedVideos () { const toDeleteVideosIds = Object.keys(this.selection) - .filter(k => this.selection[ k ] === true) + .filter(k => this.selection[k] === true) .map(k => parseInt(k, 10)) const res = await this.confirmService.confirm( -- cgit v1.2.3