diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:42:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-18 08:35:06 +0200 |
commit | 9df52d660feb722404be00a50f3c8a612bec1c15 (patch) | |
tree | dde52880fa012874d24c60f64eb596b0a789cc8b /client/src/app/+accounts | |
parent | adb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff) | |
download | PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip |
Migrate client to eslint
Diffstat (limited to 'client/src/app/+accounts')
4 files changed, 21 insertions, 13 deletions
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts index e146a5cd2..f6df38857 100644 --- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts +++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { from, Subject, Subscription } from 'rxjs' | 1 | import { from, Subject, Subscription } from 'rxjs' |
2 | import { concatMap, map, switchMap, tap } from 'rxjs/operators' | 2 | import { concatMap, map, switchMap, tap } from 'rxjs/operators' |
3 | import { Component, OnDestroy, OnInit } from '@angular/core' | 3 | import { Component, OnDestroy, OnInit } from '@angular/core' |
4 | import { ComponentPagination, hasMoreItems, MarkdownService, ScreenService, User, UserService } from '@app/core' | 4 | import { ComponentPagination, hasMoreItems, MarkdownService, User, UserService } from '@app/core' |
5 | import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' | 5 | import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' |
6 | import { NSFWPolicyType, VideoSortField } from '@shared/models' | ||
7 | import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature' | 6 | import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature' |
7 | import { NSFWPolicyType, VideoSortField } from '@shared/models' | ||
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | selector: 'my-account-video-channels', | 10 | selector: 'my-account-video-channels', |
@@ -87,7 +87,9 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy { | |||
87 | 87 | ||
88 | this.videoChannelService.listAccountVideoChannels(options) | 88 | this.videoChannelService.listAccountVideoChannels(options) |
89 | .pipe( | 89 | .pipe( |
90 | tap(res => this.channelPagination.totalItems = res.total), | 90 | tap(res => { |
91 | this.channelPagination.totalItems = res.total | ||
92 | }), | ||
91 | switchMap(res => from(res.data)), | 93 | switchMap(res => from(res.data)), |
92 | concatMap(videoChannel => { | 94 | concatMap(videoChannel => { |
93 | const options = { | 95 | const options = { |
@@ -113,14 +115,14 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy { | |||
113 | } | 115 | } |
114 | 116 | ||
115 | getVideosOf (videoChannel: VideoChannel) { | 117 | getVideosOf (videoChannel: VideoChannel) { |
116 | const obj = this.videos[ videoChannel.id ] | 118 | const obj = this.videos[videoChannel.id] |
117 | if (!obj) return [] | 119 | if (!obj) return [] |
118 | 120 | ||
119 | return obj.videos | 121 | return obj.videos |
120 | } | 122 | } |
121 | 123 | ||
122 | getTotalVideosOf (videoChannel: VideoChannel) { | 124 | getTotalVideosOf (videoChannel: VideoChannel) { |
123 | const obj = this.videos[ videoChannel.id ] | 125 | const obj = this.videos[videoChannel.id] |
124 | if (!obj) return undefined | 126 | if (!obj) return undefined |
125 | 127 | ||
126 | return obj.total | 128 | return obj.total |
diff --git a/client/src/app/+accounts/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.ts index 75af45e90..4ab6d2147 100644 --- a/client/src/app/+accounts/account-videos/account-videos.component.ts +++ b/client/src/app/+accounts/account-videos/account-videos.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { forkJoin, Subscription } from 'rxjs' | 1 | import { forkJoin, Subscription } from 'rxjs' |
2 | import { first, tap } from 'rxjs/operators' | 2 | import { first } from 'rxjs/operators' |
3 | import { Component, ComponentFactoryResolver, OnDestroy, OnInit } from '@angular/core' | 3 | import { Component, ComponentFactoryResolver, OnDestroy, OnInit } from '@angular/core' |
4 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
5 | import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' | 5 | import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
diff --git a/client/src/app/+accounts/accounts.component.html b/client/src/app/+accounts/accounts.component.html index cb3e79a18..0906992fe 100644 --- a/client/src/app/+accounts/accounts.component.html +++ b/client/src/app/+accounts/accounts.component.html | |||
@@ -71,14 +71,14 @@ | |||
71 | <a [routerLink]="item.routerLink" routerLinkActive="active" class="title-page">{{ item.label }}</a> | 71 | <a [routerLink]="item.routerLink" routerLinkActive="active" class="title-page">{{ item.label }}</a> |
72 | </ng-template> | 72 | </ng-template> |
73 | 73 | ||
74 | <list-overflow [hidden]="hideMenu" [items]="links" [itemTemplate]="linkTemplate"></list-overflow> | 74 | <my-list-overflow [hidden]="hideMenu" [items]="links" [itemTemplate]="linkTemplate"></my-list-overflow> |
75 | 75 | ||
76 | <simple-search-input | 76 | <my-simple-search-input |
77 | [alwaysShow]="!isInSmallView()" (searchChanged)="searchChanged($event)" | 77 | [alwaysShow]="!isInSmallView()" (searchChanged)="searchChanged($event)" |
78 | (inputDisplayChanged)="onSearchInputDisplayChanged($event)" name="search-videos" | 78 | (inputDisplayChanged)="onSearchInputDisplayChanged($event)" name="search-videos" |
79 | i18n-iconTitle icon-title="Search account videos" | 79 | i18n-iconTitle icon-title="Search account videos" |
80 | i18n-placeholder placeholder="Search account videos" | 80 | i18n-placeholder placeholder="Search account videos" |
81 | ></simple-search-input> | 81 | ></my-simple-search-input> |
82 | </div> | 82 | </div> |
83 | 83 | ||
84 | <router-outlet (activate)="onOutletLoaded($event)"></router-outlet> | 84 | <router-outlet (activate)="onOutletLoaded($event)"></router-outlet> |
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index 25eb13588..733cff8d5 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts | |||
@@ -61,7 +61,7 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
61 | ngOnInit () { | 61 | ngOnInit () { |
62 | this.routeSub = this.route.params | 62 | this.routeSub = this.route.params |
63 | .pipe( | 63 | .pipe( |
64 | map(params => params[ 'accountId' ]), | 64 | map(params => params['accountId']), |
65 | distinctUntilChanged(), | 65 | distinctUntilChanged(), |
66 | switchMap(accountId => this.accountService.getAccount(accountId)), | 66 | switchMap(accountId => this.accountService.getAccount(accountId)), |
67 | tap(account => this.onAccount(account)), | 67 | tap(account => this.onAccount(account)), |
@@ -72,7 +72,9 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
72 | ])) | 72 | ])) |
73 | ) | 73 | ) |
74 | .subscribe({ | 74 | .subscribe({ |
75 | next: videoChannels => this.videoChannels = videoChannels.data, | 75 | next: videoChannels => { |
76 | this.videoChannels = videoChannels.data | ||
77 | }, | ||
76 | 78 | ||
77 | error: err => this.notifier.error(err.message) | 79 | error: err => this.notifier.error(err.message) |
78 | }) | 80 | }) |
@@ -176,7 +178,9 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
176 | if (user.hasRight(UserRight.MANAGE_USERS)) { | 178 | if (user.hasRight(UserRight.MANAGE_USERS)) { |
177 | this.userService.getUser(account.userId) | 179 | this.userService.getUser(account.userId) |
178 | .subscribe({ | 180 | .subscribe({ |
179 | next: accountUser => this.accountUser = accountUser, | 181 | next: accountUser => { |
182 | this.accountUser = accountUser | ||
183 | }, | ||
180 | 184 | ||
181 | error: err => this.notifier.error(err.message) | 185 | error: err => this.notifier.error(err.message) |
182 | }) | 186 | }) |
@@ -209,6 +213,8 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
209 | itemsPerPage: 0 | 213 | itemsPerPage: 0 |
210 | }, | 214 | }, |
211 | sort: '-publishedAt' | 215 | sort: '-publishedAt' |
212 | }).subscribe(res => this.accountVideosCount = res.total) | 216 | }).subscribe(res => { |
217 | this.accountVideosCount = res.total | ||
218 | }) | ||
213 | } | 219 | } |
214 | } | 220 | } |