diff options
Diffstat (limited to 'client/src')
10 files changed, 25 insertions, 20 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.ts index bdbb10814..787f4b689 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.ts +++ b/client/src/app/+admin/users/user-edit/user-edit.ts | |||
@@ -6,6 +6,7 @@ import { USER_ROLE_LABELS } from '@shared/core-utils/users' | |||
6 | import { ServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@shared/models' | 6 | import { ServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@shared/models' |
7 | 7 | ||
8 | @Directive() | 8 | @Directive() |
9 | // tslint:disable-next-line: directive-class-suffix | ||
9 | export abstract class UserEdit extends FormReactive implements OnInit { | 10 | export abstract class UserEdit extends FormReactive implements OnInit { |
10 | videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = [] | 11 | videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = [] |
11 | videoQuotaDailyOptions: { value: string, label: string, disabled?: boolean }[] = [] | 12 | videoQuotaDailyOptions: { value: string, label: string, disabled?: boolean }[] = [] |
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts index 668a23d8f..ba95b6c8b 100644 --- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts +++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Subject } from 'rxjs' | 1 | import { Subject } from 'rxjs' |
2 | import { debounceTime, flatMap } from 'rxjs/operators' | 2 | import { debounceTime, mergeMap } from 'rxjs/operators' |
3 | import { Component, OnInit } from '@angular/core' | 3 | import { Component, OnInit } from '@angular/core' |
4 | import { AuthService, ComponentPagination, ConfirmService, Notifier, User } from '@app/core' | 4 | import { AuthService, ComponentPagination, ConfirmService, Notifier, User } from '@app/core' |
5 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' | 5 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' |
@@ -95,7 +95,7 @@ export class MyAccountVideoPlaylistsComponent implements OnInit { | |||
95 | 95 | ||
96 | private loadVideoPlaylists (reset = false) { | 96 | private loadVideoPlaylists (reset = false) { |
97 | this.authService.userInformationLoaded | 97 | this.authService.userInformationLoaded |
98 | .pipe(flatMap(() => { | 98 | .pipe(mergeMap(() => { |
99 | return this.videoPlaylistService.listAccountPlaylists(this.user.account, this.pagination, '-updatedAt', this.videoPlaylistsSearch) | 99 | return this.videoPlaylistService.listAccountPlaylists(this.user.account, this.pagination, '-updatedAt', this.videoPlaylistsSearch) |
100 | })) | 100 | })) |
101 | .subscribe(res => { | 101 | .subscribe(res => { |
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 538a187a8..3a8e6eecc 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 | |||
@@ -84,11 +84,11 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca | |||
84 | channelId: this.firstStepChannelId | 84 | channelId: this.firstStepChannelId |
85 | } | 85 | } |
86 | 86 | ||
87 | this.loadingBar.start() | 87 | this.loadingBar.useRef().start() |
88 | 88 | ||
89 | this.videoImportService.importVideoTorrent(torrentfile || this.magnetUri, videoUpdate).subscribe( | 89 | this.videoImportService.importVideoTorrent(torrentfile || this.magnetUri, videoUpdate).subscribe( |
90 | res => { | 90 | res => { |
91 | this.loadingBar.complete() | 91 | this.loadingBar.useRef().complete() |
92 | this.firstStepDone.emit(res.video.name) | 92 | this.firstStepDone.emit(res.video.name) |
93 | this.isImportingVideo = false | 93 | this.isImportingVideo = false |
94 | this.hasImportedVideo = true | 94 | this.hasImportedVideo = true |
@@ -105,7 +105,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca | |||
105 | }, | 105 | }, |
106 | 106 | ||
107 | err => { | 107 | err => { |
108 | this.loadingBar.complete() | 108 | this.loadingBar.useRef().complete() |
109 | this.isImportingVideo = false | 109 | this.isImportingVideo = false |
110 | this.firstStepError.emit() | 110 | this.firstStepError.emit() |
111 | this.notifier.error(err.message) | 111 | this.notifier.error(err.message) |
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts index 6508eef7e..da25663d7 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts | |||
@@ -71,7 +71,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom | |||
71 | channelId: this.firstStepChannelId | 71 | channelId: this.firstStepChannelId |
72 | } | 72 | } |
73 | 73 | ||
74 | this.loadingBar.start() | 74 | this.loadingBar.useRef().start() |
75 | 75 | ||
76 | this.videoImportService | 76 | this.videoImportService |
77 | .importVideoUrl(this.targetUrl, videoUpdate) | 77 | .importVideoUrl(this.targetUrl, videoUpdate) |
@@ -86,7 +86,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom | |||
86 | ) | 86 | ) |
87 | .subscribe( | 87 | .subscribe( |
88 | ({ video, videoCaptions }) => { | 88 | ({ video, videoCaptions }) => { |
89 | this.loadingBar.complete() | 89 | this.loadingBar.useRef().complete() |
90 | this.firstStepDone.emit(video.name) | 90 | this.firstStepDone.emit(video.name) |
91 | this.isImportingVideo = false | 91 | this.isImportingVideo = false |
92 | this.hasImportedVideo = true | 92 | this.hasImportedVideo = true |
@@ -115,7 +115,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom | |||
115 | }, | 115 | }, |
116 | 116 | ||
117 | err => { | 117 | err => { |
118 | this.loadingBar.complete() | 118 | this.loadingBar.useRef().complete() |
119 | this.isImportingVideo = false | 119 | this.isImportingVideo = false |
120 | this.firstStepError.emit() | 120 | this.firstStepError.emit() |
121 | this.notifier.error(err.message) | 121 | this.notifier.error(err.message) |
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts index 5d11ba7ce..2e658dfae 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { catchError, switchMap, tap } from 'rxjs/operators' | 1 | import { catchError, switchMap, tap } from 'rxjs/operators' |
2 | import { EventEmitter, OnInit, Directive } from '@angular/core' | 2 | import { Directive, EventEmitter, OnInit } from '@angular/core' |
3 | import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core' | 3 | import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core' |
4 | import { populateAsyncUserVideoChannels } from '@app/helpers' | 4 | import { populateAsyncUserVideoChannels } from '@app/helpers' |
5 | import { FormReactive } from '@app/shared/shared-forms' | 5 | import { FormReactive } from '@app/shared/shared-forms' |
@@ -8,6 +8,7 @@ import { LoadingBarService } from '@ngx-loading-bar/core' | |||
8 | import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' | 8 | import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' |
9 | 9 | ||
10 | @Directive() | 10 | @Directive() |
11 | // tslint:disable-next-line: directive-class-suffix | ||
11 | export abstract class VideoSend extends FormReactive implements OnInit { | 12 | export abstract class VideoSend extends FormReactive implements OnInit { |
12 | userVideoChannels: { id: number, label: string, support: string }[] = [] | 13 | userVideoChannels: { id: number, label: string, support: string }[] = [] |
13 | videoPrivacies: VideoConstant<VideoPrivacy>[] = [] | 14 | videoPrivacies: VideoConstant<VideoPrivacy>[] = [] |
@@ -56,15 +57,15 @@ export abstract class VideoSend extends FormReactive implements OnInit { | |||
56 | } | 57 | } |
57 | 58 | ||
58 | protected updateVideoAndCaptions (video: VideoEdit) { | 59 | protected updateVideoAndCaptions (video: VideoEdit) { |
59 | this.loadingBar.start() | 60 | this.loadingBar.useRef().start() |
60 | 61 | ||
61 | return this.videoService.updateVideo(video) | 62 | return this.videoService.updateVideo(video) |
62 | .pipe( | 63 | .pipe( |
63 | // Then update captions | 64 | // Then update captions |
64 | switchMap(() => this.videoCaptionService.updateCaptions(video.id, this.videoCaptions)), | 65 | switchMap(() => this.videoCaptionService.updateCaptions(video.id, this.videoCaptions)), |
65 | tap(() => this.loadingBar.complete()), | 66 | tap(() => this.loadingBar.useRef().complete()), |
66 | catchError(err => { | 67 | catchError(err => { |
67 | this.loadingBar.complete() | 68 | this.loadingBar.useRef().complete() |
68 | throw err | 69 | throw err |
69 | }) | 70 | }) |
70 | ) | 71 | ) |
diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts index 7bd6eb553..581199d65 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.ts +++ b/client/src/app/+videos/+video-edit/video-update.component.ts | |||
@@ -101,7 +101,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
101 | 101 | ||
102 | this.video.patch(this.form.value) | 102 | this.video.patch(this.form.value) |
103 | 103 | ||
104 | this.loadingBar.start() | 104 | this.loadingBar.useRef().start() |
105 | this.isUpdatingVideo = true | 105 | this.isUpdatingVideo = true |
106 | 106 | ||
107 | // Update the video | 107 | // Update the video |
@@ -114,13 +114,13 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
114 | () => { | 114 | () => { |
115 | this.updateDone = true | 115 | this.updateDone = true |
116 | this.isUpdatingVideo = false | 116 | this.isUpdatingVideo = false |
117 | this.loadingBar.complete() | 117 | this.loadingBar.useRef().complete() |
118 | this.notifier.success(this.i18n('Video updated.')) | 118 | this.notifier.success(this.i18n('Video updated.')) |
119 | this.router.navigate([ '/videos/watch', this.video.uuid ]) | 119 | this.router.navigate([ '/videos/watch', this.video.uuid ]) |
120 | }, | 120 | }, |
121 | 121 | ||
122 | err => { | 122 | err => { |
123 | this.loadingBar.complete() | 123 | this.loadingBar.useRef().complete() |
124 | this.isUpdatingVideo = false | 124 | this.isUpdatingVideo = false |
125 | this.notifier.error(err.message) | 125 | this.notifier.error(err.message) |
126 | console.error(err) | 126 | console.error(err) |
diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts index 5efc6e1ab..5679d28a9 100644 --- a/client/src/app/core/auth/auth-user.model.ts +++ b/client/src/app/core/auth/auth-user.model.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Observable, of } from 'rxjs' | 1 | import { Observable, of } from 'rxjs' |
2 | import { map } from 'rxjs/operators' | 2 | import { map } from 'rxjs/operators' |
3 | import { User } from '@app/core/users/user.model' | 3 | import { User } from '@app/core/users/user.model' |
4 | import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage' | 4 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' |
5 | import { hasUserRight } from '@shared/core-utils/users' | 5 | import { hasUserRight } from '@shared/core-utils/users' |
6 | import { | 6 | import { |
7 | MyUser as ServerMyUserModel, | 7 | MyUser as ServerMyUserModel, |
@@ -12,7 +12,7 @@ import { | |||
12 | UserRole, | 12 | UserRole, |
13 | UserVideoQuota | 13 | UserVideoQuota |
14 | } from '@shared/models' | 14 | } from '@shared/models' |
15 | import { TokenOptions, Tokens } from '../../../root-helpers/pure-auth-user.model' | 15 | import { TokenOptions, Tokens } from '@root-helpers/pure-auth-user.model' |
16 | 16 | ||
17 | export class AuthUser extends User implements ServerMyUserModel { | 17 | export class AuthUser extends User implements ServerMyUserModel { |
18 | tokens: Tokens | 18 | tokens: Tokens |
diff --git a/client/src/app/shared/shared-moderation/account-blocklist.component.ts b/client/src/app/shared/shared-moderation/account-blocklist.component.ts index 11e554978..a5a3c27cd 100644 --- a/client/src/app/shared/shared-moderation/account-blocklist.component.ts +++ b/client/src/app/shared/shared-moderation/account-blocklist.component.ts | |||
@@ -7,6 +7,7 @@ import { AccountBlock } from './account-block.model' | |||
7 | import { BlocklistComponentType, BlocklistService } from './blocklist.service' | 7 | import { BlocklistComponentType, BlocklistService } from './blocklist.service' |
8 | 8 | ||
9 | @Directive() | 9 | @Directive() |
10 | // tslint:disable-next-line: directive-class-suffix | ||
10 | export class GenericAccountBlocklistComponent extends RestTable implements OnInit { | 11 | export class GenericAccountBlocklistComponent extends RestTable implements OnInit { |
11 | // @ts-ignore: "Abstract methods can only appear within an abstract class" | 12 | // @ts-ignore: "Abstract methods can only appear within an abstract class" |
12 | abstract mode: BlocklistComponentType | 13 | abstract mode: BlocklistComponentType |
diff --git a/client/src/app/shared/shared-moderation/server-blocklist.component.ts b/client/src/app/shared/shared-moderation/server-blocklist.component.ts index 694b03762..8f65cdb71 100644 --- a/client/src/app/shared/shared-moderation/server-blocklist.component.ts +++ b/client/src/app/shared/shared-moderation/server-blocklist.component.ts | |||
@@ -1,12 +1,13 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { OnInit, ViewChild, Directive } from '@angular/core' | 2 | import { Directive, OnInit, ViewChild } from '@angular/core' |
3 | import { BatchDomainsModalComponent } from '@app/shared/shared-moderation/batch-domains-modal.component' | ||
4 | import { Notifier, RestPagination, RestTable } from '@app/core' | 3 | import { Notifier, RestPagination, RestTable } from '@app/core' |
4 | import { BatchDomainsModalComponent } from '@app/shared/shared-moderation/batch-domains-modal.component' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { ServerBlock } from '@shared/models' | 6 | import { ServerBlock } from '@shared/models' |
7 | import { BlocklistComponentType, BlocklistService } from './blocklist.service' | 7 | import { BlocklistComponentType, BlocklistService } from './blocklist.service' |
8 | 8 | ||
9 | @Directive() | 9 | @Directive() |
10 | // tslint:disable-next-line: directive-class-suffix | ||
10 | export class GenericServerBlocklistComponent extends RestTable implements OnInit { | 11 | export class GenericServerBlocklistComponent extends RestTable implements OnInit { |
11 | @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent | 12 | @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent |
12 | 13 | ||
diff --git a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts index 405af5fa6..e18002b74 100644 --- a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts +++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { fromEvent, Observable, Subject, Subscription } from 'rxjs' | 1 | import { fromEvent, Observable, Subject, Subscription } from 'rxjs' |
2 | import { debounceTime, switchMap, tap } from 'rxjs/operators' | 2 | import { debounceTime, switchMap, tap } from 'rxjs/operators' |
3 | import { OnDestroy, OnInit, Directive } from '@angular/core' | 3 | import { Directive, OnDestroy, OnInit } from '@angular/core' |
4 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
5 | import { | 5 | import { |
6 | AuthService, | 6 | AuthService, |
@@ -31,6 +31,7 @@ enum GroupDate { | |||
31 | } | 31 | } |
32 | 32 | ||
33 | @Directive() | 33 | @Directive() |
34 | // tslint:disable-next-line: directive-class-suffix | ||
34 | export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableForReuseHook { | 35 | export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableForReuseHook { |
35 | pagination: ComponentPaginationLight = { | 36 | pagination: ComponentPaginationLight = { |
36 | currentPage: 1, | 37 | currentPage: 1, |