aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r--client/src/app/shared/shared-main/account/account.model.ts2
-rw-r--r--client/src/app/shared/shared-main/account/actor.model.ts2
-rw-r--r--client/src/app/shared/shared-main/angular/autofocus.directive.ts2
-rw-r--r--client/src/app/shared/shared-main/angular/link.component.ts2
-rw-r--r--client/src/app/shared/shared-main/angular/peertube-template.directive.ts1
-rw-r--r--client/src/app/shared/shared-main/feeds/syndication.model.ts4
-rw-r--r--client/src/app/shared/shared-main/misc/help.component.ts12
-rw-r--r--client/src/app/shared/shared-main/misc/list-overflow.component.ts4
-rw-r--r--client/src/app/shared/shared-main/misc/simple-search-input.component.ts2
-rw-r--r--client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts2
-rw-r--r--client/src/app/shared/shared-main/users/user-notification.service.ts6
-rw-r--r--client/src/app/shared/shared-main/users/user-quota.component.ts2
-rw-r--r--client/src/app/shared/shared-main/video-channel/video-channel.model.ts5
-rw-r--r--client/src/app/shared/shared-main/video-channel/video-channel.service.ts12
-rw-r--r--client/src/app/shared/shared-main/video/redundancy.service.ts4
-rw-r--r--client/src/app/shared/shared-main/video/video-edit.model.ts12
-rw-r--r--client/src/app/shared/shared-main/video/video.model.ts2
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts18
18 files changed, 47 insertions, 47 deletions
diff --git a/client/src/app/shared/shared-main/account/account.model.ts b/client/src/app/shared/shared-main/account/account.model.ts
index 7b5611f35..92606e7fa 100644
--- a/client/src/app/shared/shared-main/account/account.model.ts
+++ b/client/src/app/shared/shared-main/account/account.model.ts
@@ -1,4 +1,4 @@
1import { Account as ServerAccount, Actor as ServerActor, ActorImage } from '@shared/models' 1import { Account as ServerAccount, ActorImage } from '@shared/models'
2import { Actor } from './actor.model' 2import { Actor } from './actor.model'
3 3
4export class Account extends Actor implements ServerAccount { 4export class Account extends Actor implements ServerAccount {
diff --git a/client/src/app/shared/shared-main/account/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.ts
index 2fccc472a..082f44fb9 100644
--- a/client/src/app/shared/shared-main/account/actor.model.ts
+++ b/client/src/app/shared/shared-main/account/actor.model.ts
@@ -20,7 +20,7 @@ export abstract class Actor implements ServerActor {
20 static GET_ACTOR_AVATAR_URL (actor: { avatar?: { url?: string, path: string } }) { 20 static GET_ACTOR_AVATAR_URL (actor: { avatar?: { url?: string, path: string } }) {
21 if (actor?.avatar?.url) return actor.avatar.url 21 if (actor?.avatar?.url) return actor.avatar.url
22 22
23 if (actor && actor.avatar) { 23 if (actor?.avatar) {
24 const absoluteAPIUrl = getAbsoluteAPIUrl() 24 const absoluteAPIUrl = getAbsoluteAPIUrl()
25 25
26 return absoluteAPIUrl + actor.avatar.path 26 return absoluteAPIUrl + actor.avatar.path
diff --git a/client/src/app/shared/shared-main/angular/autofocus.directive.ts b/client/src/app/shared/shared-main/angular/autofocus.directive.ts
index 5f087d79d..2da492ea1 100644
--- a/client/src/app/shared/shared-main/angular/autofocus.directive.ts
+++ b/client/src/app/shared/shared-main/angular/autofocus.directive.ts
@@ -1,7 +1,7 @@
1import { AfterViewInit, Directive, ElementRef } from '@angular/core' 1import { AfterViewInit, Directive, ElementRef } from '@angular/core'
2 2
3@Directive({ 3@Directive({
4 selector: '[autofocus]' 4 selector: '[myAutofocus]'
5}) 5})
6export class AutofocusDirective implements AfterViewInit { 6export class AutofocusDirective implements AfterViewInit {
7 constructor (private host: ElementRef) { } 7 constructor (private host: ElementRef) { }
diff --git a/client/src/app/shared/shared-main/angular/link.component.ts b/client/src/app/shared/shared-main/angular/link.component.ts
index 597a16871..ecbd9151c 100644
--- a/client/src/app/shared/shared-main/angular/link.component.ts
+++ b/client/src/app/shared/shared-main/angular/link.component.ts
@@ -1,4 +1,4 @@
1import { Component, Input, ViewEncapsulation } from '@angular/core' 1import { Component, Input } from '@angular/core'
2 2
3@Component({ 3@Component({
4 selector: 'my-link', 4 selector: 'my-link',
diff --git a/client/src/app/shared/shared-main/angular/peertube-template.directive.ts b/client/src/app/shared/shared-main/angular/peertube-template.directive.ts
index e04c25d9a..dc0cde12d 100644
--- a/client/src/app/shared/shared-main/angular/peertube-template.directive.ts
+++ b/client/src/app/shared/shared-main/angular/peertube-template.directive.ts
@@ -1,6 +1,7 @@
1import { Directive, Input, TemplateRef } from '@angular/core' 1import { Directive, Input, TemplateRef } from '@angular/core'
2 2
3@Directive({ 3@Directive({
4 // eslint-disable-next-line @angular-eslint/directive-selector
4 selector: '[ptTemplate]' 5 selector: '[ptTemplate]'
5}) 6})
6export class PeerTubeTemplateDirective <T extends string> { 7export class PeerTubeTemplateDirective <T extends string> {
diff --git a/client/src/app/shared/shared-main/feeds/syndication.model.ts b/client/src/app/shared/shared-main/feeds/syndication.model.ts
index 2466ae7c6..cd6fbdb48 100644
--- a/client/src/app/shared/shared-main/feeds/syndication.model.ts
+++ b/client/src/app/shared/shared-main/feeds/syndication.model.ts
@@ -1,7 +1,7 @@
1import { FeedFormat } from '@shared/models' 1import { FeedFormat } from '@shared/models'
2 2
3export interface Syndication { 3export interface Syndication {
4 format: FeedFormat, 4 format: FeedFormat
5 label: string, 5 label: string
6 url: string 6 url: string
7} 7}
diff --git a/client/src/app/shared/shared-main/misc/help.component.ts b/client/src/app/shared/shared-main/misc/help.component.ts
index 76e255d99..37e2abd97 100644
--- a/client/src/app/shared/shared-main/misc/help.component.ts
+++ b/client/src/app/shared/shared-main/misc/help.component.ts
@@ -71,18 +71,18 @@ export class HelpComponent implements OnInit, OnChanges, AfterContentInit {
71 } 71 }
72 72
73 private formatMarkdownSupport (rules: string[]) { 73 private formatMarkdownSupport (rules: string[]) {
74 // tslint:disable:max-line-length 74 /* eslint-disable max-len */
75 return $localize`<a href="https://en.wikipedia.org/wiki/Markdown#Example" target="_blank" rel="noopener noreferrer">Markdown</a> compatible that supports:` + 75 return $localize`<a href="https://en.wikipedia.org/wiki/Markdown#Example" target="_blank" rel="noopener noreferrer">Markdown</a> compatible that supports:` +
76 this.createMarkdownList(rules) 76 this.createMarkdownList(rules)
77 } 77 }
78 78
79 private createMarkdownList (rules: string[]) { 79 private createMarkdownList (rules: string[]) {
80 const rulesToText = { 80 const rulesToText = {
81 'emphasis': $localize`Emphasis`, 81 emphasis: $localize`Emphasis`,
82 'link': $localize`Links`, 82 link: $localize`Links`,
83 'newline': $localize`New lines`, 83 newline: $localize`New lines`,
84 'list': $localize`Lists`, 84 list: $localize`Lists`,
85 'image': $localize`Images` 85 image: $localize`Images`
86 } 86 }
87 87
88 const bullets = rules.map(r => rulesToText[r]) 88 const bullets = rules.map(r => rulesToText[r])
diff --git a/client/src/app/shared/shared-main/misc/list-overflow.component.ts b/client/src/app/shared/shared-main/misc/list-overflow.component.ts
index 144e0f156..fbc481093 100644
--- a/client/src/app/shared/shared-main/misc/list-overflow.component.ts
+++ b/client/src/app/shared/shared-main/misc/list-overflow.component.ts
@@ -22,7 +22,7 @@ export interface ListOverflowItem {
22} 22}
23 23
24@Component({ 24@Component({
25 selector: 'list-overflow', 25 selector: 'my-list-overflow',
26 templateUrl: './list-overflow.component.html', 26 templateUrl: './list-overflow.component.html',
27 styleUrls: [ './list-overflow.component.scss' ], 27 styleUrls: [ './list-overflow.component.scss' ],
28 changeDetection: ChangeDetectionStrategy.OnPush 28 changeDetection: ChangeDetectionStrategy.OnPush
@@ -65,7 +65,7 @@ export class ListOverflowComponent<T extends ListOverflowItem> implements AfterV
65 let showItemsUntilIndexExcluded: number 65 let showItemsUntilIndexExcluded: number
66 let accWidth = 0 66 let accWidth = 0
67 67
68 for (const [index, el] of this.itemsRendered.toArray().entries()) { 68 for (const [ index, el ] of this.itemsRendered.toArray().entries()) {
69 accWidth += el.nativeElement.getBoundingClientRect().width 69 accWidth += el.nativeElement.getBoundingClientRect().width
70 if (showItemsUntilIndexExcluded === undefined) { 70 if (showItemsUntilIndexExcluded === undefined) {
71 showItemsUntilIndexExcluded = (parentWidth < accWidth) ? index : undefined 71 showItemsUntilIndexExcluded = (parentWidth < accWidth) ? index : undefined
diff --git a/client/src/app/shared/shared-main/misc/simple-search-input.component.ts b/client/src/app/shared/shared-main/misc/simple-search-input.component.ts
index 224d71134..292ec4c82 100644
--- a/client/src/app/shared/shared-main/misc/simple-search-input.component.ts
+++ b/client/src/app/shared/shared-main/misc/simple-search-input.component.ts
@@ -4,7 +4,7 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild }
4import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
5 5
6@Component({ 6@Component({
7 selector: 'simple-search-input', 7 selector: 'my-simple-search-input',
8 templateUrl: './simple-search-input.component.html', 8 templateUrl: './simple-search-input.component.html',
9 styleUrls: [ './simple-search-input.component.scss' ] 9 styleUrls: [ './simple-search-input.component.scss' ]
10}) 10})
diff --git a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
index 2cafb6c55..e7e34ce1e 100644
--- a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
+++ b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
@@ -66,7 +66,7 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy {
66 .subscribe(() => this.updateChildLabels(window.location.pathname)) 66 .subscribe(() => this.updateChildLabels(window.location.pathname))
67 67
68 this.hasIcons = this.menuEntries.some( 68 this.hasIcons = this.menuEntries.some(
69 e => e.children && e.children.some(c => !!c.iconName) 69 e => e.children?.some(c => !!c.iconName)
70 ) 70 )
71 } 71 }
72 72
diff --git a/client/src/app/shared/shared-main/users/user-notification.service.ts b/client/src/app/shared/shared-main/users/user-notification.service.ts
index 9014b48a8..09fee87a3 100644
--- a/client/src/app/shared/shared-main/users/user-notification.service.ts
+++ b/client/src/app/shared/shared-main/users/user-notification.service.ts
@@ -1,11 +1,11 @@
1import { SortMeta } from 'primeng/api'
1import { catchError, map, tap } from 'rxjs/operators' 2import { catchError, map, tap } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { ComponentPaginationLight, RestExtractor, RestService, User, PeerTubeSocket, AuthService } from '@app/core' 5import { AuthService, ComponentPaginationLight, PeerTubeSocket, RestExtractor, RestService } from '@app/core'
5import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '@shared/models' 6import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '@shared/models'
6import { environment } from '../../../../environments/environment' 7import { environment } from '../../../../environments/environment'
7import { UserNotification } from './user-notification.model' 8import { UserNotification } from './user-notification.model'
8import { SortMeta } from 'primeng/api'
9 9
10@Injectable() 10@Injectable()
11export class UserNotificationService { 11export class UserNotificationService {
@@ -23,7 +23,7 @@ export class UserNotificationService {
23 listMyNotifications (parameters: { 23 listMyNotifications (parameters: {
24 pagination: ComponentPaginationLight 24 pagination: ComponentPaginationLight
25 ignoreLoadingBar?: boolean 25 ignoreLoadingBar?: boolean
26 unread?: boolean, 26 unread?: boolean
27 sort?: SortMeta 27 sort?: SortMeta
28 }) { 28 }) {
29 const { pagination, ignoreLoadingBar, unread, sort } = parameters 29 const { pagination, ignoreLoadingBar, unread, sort } = parameters
diff --git a/client/src/app/shared/shared-main/users/user-quota.component.ts b/client/src/app/shared/shared-main/users/user-quota.component.ts
index b38619186..5a95f1209 100644
--- a/client/src/app/shared/shared-main/users/user-quota.component.ts
+++ b/client/src/app/shared/shared-main/users/user-quota.component.ts
@@ -6,7 +6,7 @@ import { BytesPipe } from '../angular'
6@Component({ 6@Component({
7 selector: 'my-user-quota', 7 selector: 'my-user-quota',
8 templateUrl: './user-quota.component.html', 8 templateUrl: './user-quota.component.html',
9 styleUrls: ['./user-quota.component.scss'] 9 styleUrls: [ './user-quota.component.scss' ]
10}) 10})
11 11
12export class UserQuotaComponent implements OnInit { 12export class UserQuotaComponent implements OnInit {
diff --git a/client/src/app/shared/shared-main/video-channel/video-channel.model.ts b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts
index a9dcf2fa2..66d4cac68 100644
--- a/client/src/app/shared/shared-main/video-channel/video-channel.model.ts
+++ b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts
@@ -1,6 +1,5 @@
1import { getAbsoluteAPIUrl } from '@app/helpers' 1import { getAbsoluteAPIUrl } from '@app/helpers'
2import { Account as ServerAccount, ActorImage, VideoChannel as ServerVideoChannel, ViewsPerDate } from '@shared/models' 2import { Account as ServerAccount, ActorImage, VideoChannel as ServerVideoChannel, ViewsPerDate } from '@shared/models'
3import { Account } from '../account/account.model'
4import { Actor } from '../account/actor.model' 3import { Actor } from '../account/actor.model'
5 4
6export class VideoChannel extends Actor implements ServerVideoChannel { 5export class VideoChannel extends Actor implements ServerVideoChannel {
@@ -25,14 +24,14 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
25 24
26 viewsPerDay?: ViewsPerDate[] 25 viewsPerDay?: ViewsPerDate[]
27 26
28 static GET_ACTOR_AVATAR_URL (actor: object) { 27 static GET_ACTOR_AVATAR_URL (actor: { avatar?: { url?: string, path: string } }) {
29 return Actor.GET_ACTOR_AVATAR_URL(actor) 28 return Actor.GET_ACTOR_AVATAR_URL(actor)
30 } 29 }
31 30
32 static GET_ACTOR_BANNER_URL (channel: ServerVideoChannel) { 31 static GET_ACTOR_BANNER_URL (channel: ServerVideoChannel) {
33 if (channel?.banner?.url) return channel.banner.url 32 if (channel?.banner?.url) return channel.banner.url
34 33
35 if (channel && channel.banner) { 34 if (channel?.banner) {
36 const absoluteAPIUrl = getAbsoluteAPIUrl() 35 const absoluteAPIUrl = getAbsoluteAPIUrl()
37 36
38 return absoluteAPIUrl + channel.banner.path 37 return absoluteAPIUrl + channel.banner.path
diff --git a/client/src/app/shared/shared-main/video-channel/video-channel.service.ts b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts
index a89f1065a..7560a35a8 100644
--- a/client/src/app/shared/shared-main/video-channel/video-channel.service.ts
+++ b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts
@@ -15,6 +15,12 @@ export class VideoChannelService {
15 15
16 videoChannelLoaded = new ReplaySubject<VideoChannel>(1) 16 videoChannelLoaded = new ReplaySubject<VideoChannel>(1)
17 17
18 constructor (
19 private authHttp: HttpClient,
20 private restService: RestService,
21 private restExtractor: RestExtractor
22 ) { }
23
18 static extractVideoChannels (result: ResultList<VideoChannelServer>) { 24 static extractVideoChannels (result: ResultList<VideoChannelServer>) {
19 const videoChannels: VideoChannel[] = [] 25 const videoChannels: VideoChannel[] = []
20 26
@@ -25,12 +31,6 @@ export class VideoChannelService {
25 return { data: videoChannels, total: result.total } 31 return { data: videoChannels, total: result.total }
26 } 32 }
27 33
28 constructor (
29 private authHttp: HttpClient,
30 private restService: RestService,
31 private restExtractor: RestExtractor
32 ) { }
33
34 getVideoChannel (videoChannelName: string) { 34 getVideoChannel (videoChannelName: string) {
35 return this.authHttp.get<VideoChannel>(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelName) 35 return this.authHttp.get<VideoChannel>(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelName)
36 .pipe( 36 .pipe(
diff --git a/client/src/app/shared/shared-main/video/redundancy.service.ts b/client/src/app/shared/shared-main/video/redundancy.service.ts
index 6e839e655..966d7fafd 100644
--- a/client/src/app/shared/shared-main/video/redundancy.service.ts
+++ b/client/src/app/shared/shared-main/video/redundancy.service.ts
@@ -30,8 +30,8 @@ export class RedundancyService {
30 } 30 }
31 31
32 listVideoRedundancies (options: { 32 listVideoRedundancies (options: {
33 pagination: RestPagination, 33 pagination: RestPagination
34 sort: SortMeta, 34 sort: SortMeta
35 target?: VideoRedundanciesTarget 35 target?: VideoRedundanciesTarget
36 }): Observable<ResultList<VideoRedundancy>> { 36 }): Observable<ResultList<VideoRedundancy>> {
37 const { pagination, sort, target } = options 37 const { pagination, sort, target } = options
diff --git a/client/src/app/shared/shared-main/video/video-edit.model.ts b/client/src/app/shared/shared-main/video/video-edit.model.ts
index 757b686c0..ea0456942 100644
--- a/client/src/app/shared/shared-main/video/video-edit.model.ts
+++ b/client/src/app/shared/shared-main/video/video-edit.model.ts
@@ -29,11 +29,11 @@ export class VideoEdit implements VideoUpdate {
29 29
30 constructor ( 30 constructor (
31 video?: Video & { 31 video?: Video & {
32 tags: string[], 32 tags: string[]
33 commentsEnabled: boolean, 33 commentsEnabled: boolean
34 downloadEnabled: boolean, 34 downloadEnabled: boolean
35 support: string, 35 support: string
36 thumbnailUrl: string, 36 thumbnailUrl: string
37 previewUrl: string 37 previewUrl: string
38 }) { 38 }) {
39 if (video) { 39 if (video) {
@@ -64,7 +64,7 @@ export class VideoEdit implements VideoUpdate {
64 64
65 patch (values: { [ id: string ]: any }) { 65 patch (values: { [ id: string ]: any }) {
66 Object.keys(values).forEach((key) => { 66 Object.keys(values).forEach((key) => {
67 this[ key ] = values[ key ] 67 this[key] = values[key]
68 }) 68 })
69 69
70 // If schedule publication, the video is private and will be changed to public privacy 70 // If schedule publication, the video is private and will be changed to public privacy
diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts
index b7720c8d2..7471a933b 100644
--- a/client/src/app/shared/shared-main/video/video.model.ts
+++ b/client/src/app/shared/shared-main/video/video.model.ts
@@ -100,7 +100,7 @@ export class Video implements VideoServerModel {
100 return '/videos/update/' + video.uuid 100 return '/videos/update/' + video.uuid
101 } 101 }
102 102
103 constructor (hash: VideoServerModel, translations = {}) { 103 constructor (hash: VideoServerModel, translations: { [ id: string ]: string } = {}) {
104 const absoluteAPIUrl = getAbsoluteAPIUrl() 104 const absoluteAPIUrl = getAbsoluteAPIUrl()
105 105
106 this.createdAt = new Date(hash.createdAt.toString()) 106 this.createdAt = new Date(hash.createdAt.toString())
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts
index 4a97719fa..60cc9d160 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -30,10 +30,10 @@ import { Video } from './video.model'
30 30
31export interface VideosProvider { 31export interface VideosProvider {
32 getVideos (parameters: { 32 getVideos (parameters: {
33 videoPagination: ComponentPaginationLight, 33 videoPagination: ComponentPaginationLight
34 sort: VideoSortField, 34 sort: VideoSortField
35 filter?: VideoFilter, 35 filter?: VideoFilter
36 categoryOneOf?: number[], 36 categoryOneOf?: number[]
37 languageOneOf?: string[] 37 languageOneOf?: string[]
38 nsfwPolicy: NSFWPolicyType 38 nsfwPolicy: NSFWPolicyType
39 }): Observable<ResultList<Video>> 39 }): Observable<ResultList<Video>>
@@ -145,8 +145,8 @@ export class VideoService implements VideosProvider {
145 } 145 }
146 146
147 getAccountVideos (parameters: { 147 getAccountVideos (parameters: {
148 account: Pick<Account, 'nameWithHost'>, 148 account: Pick<Account, 'nameWithHost'>
149 videoPagination: ComponentPaginationLight, 149 videoPagination: ComponentPaginationLight
150 sort: VideoSortField 150 sort: VideoSortField
151 nsfwPolicy?: NSFWPolicyType 151 nsfwPolicy?: NSFWPolicyType
152 videoFilter?: VideoFilter 152 videoFilter?: VideoFilter
@@ -180,9 +180,9 @@ export class VideoService implements VideosProvider {
180 } 180 }
181 181
182 getVideoChannelVideos (parameters: { 182 getVideoChannelVideos (parameters: {
183 videoChannel: Pick<VideoChannel, 'nameWithHost'>, 183 videoChannel: Pick<VideoChannel, 'nameWithHost'>
184 videoPagination: ComponentPaginationLight, 184 videoPagination: ComponentPaginationLight
185 sort: VideoSortField, 185 sort: VideoSortField
186 nsfwPolicy?: NSFWPolicyType 186 nsfwPolicy?: NSFWPolicyType
187 videoFilter?: VideoFilter 187 videoFilter?: VideoFilter
188 }): Observable<ResultList<Video>> { 188 }): Observable<ResultList<Video>> {