diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-15 11:55:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-16 09:42:54 +0200 |
commit | db400f447a9f7aae1c56fa25396e93069744483f (patch) | |
tree | f45af832a5d3f4eebafd2f885b7413d9f84fa374 /client/src/app/+my-account | |
parent | 54c3a22faa04bf13eea37f39be9149fc5eb95737 (diff) | |
download | PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.tar.gz PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.tar.zst PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.zip |
Upgrade to rxjs 6
Diffstat (limited to 'client/src/app/+my-account')
4 files changed, 11 insertions, 17 deletions
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts index fab9cacd8..c82bb39c8 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts +++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts | |||
@@ -1,8 +1,6 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { Router } from '@angular/router' | 2 | import { Router } from '@angular/router' |
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
4 | import 'rxjs/add/observable/from' | ||
5 | import 'rxjs/add/operator/concatAll' | ||
6 | import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' | 4 | import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' |
7 | import { FormBuilder, FormGroup } from '@angular/forms' | 5 | import { FormBuilder, FormGroup } from '@angular/forms' |
8 | import { VideoChannelCreate } from '../../../../../shared/models/videos' | 6 | import { VideoChannelCreate } from '../../../../../shared/models/videos' |
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts index 9adc38691..b4c8df3cd 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts +++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts | |||
@@ -1,8 +1,6 @@ | |||
1 | import { Component, OnInit, OnDestroy } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
4 | import 'rxjs/add/observable/from' | ||
5 | import 'rxjs/add/operator/concatAll' | ||
6 | import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' | 4 | import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' |
7 | import { FormBuilder, FormGroup } from '@angular/forms' | 5 | import { FormBuilder, FormGroup } from '@angular/forms' |
8 | import { VideoChannelUpdate } from '../../../../../shared/models/videos' | 6 | import { VideoChannelUpdate } from '../../../../../shared/models/videos' |
@@ -12,7 +10,7 @@ import { | |||
12 | VIDEO_CHANNEL_SUPPORT | 10 | VIDEO_CHANNEL_SUPPORT |
13 | } from '@app/shared/forms/form-validators/video-channel' | 11 | } from '@app/shared/forms/form-validators/video-channel' |
14 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 12 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
15 | import { Subscription } from 'rxjs/Subscription' | 13 | import { Subscription } from 'rxjs' |
16 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 14 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
17 | import { AuthService } from '@app/core' | 15 | import { AuthService } from '@app/core' |
18 | 16 | ||
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts index eeaca11df..7abf48826 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts +++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts | |||
@@ -1,12 +1,11 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { NotificationsService } from 'angular2-notifications' |
3 | import 'rxjs/add/observable/from' | ||
4 | import 'rxjs/add/operator/concatAll' | ||
5 | import { AuthService } from '../../core/auth' | 3 | import { AuthService } from '../../core/auth' |
6 | import { ConfirmService } from '../../core/confirm' | 4 | import { ConfirmService } from '../../core/confirm' |
7 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 5 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
8 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 6 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
9 | import { User } from '@app/shared' | 7 | import { User } from '@app/shared' |
8 | import { flatMap } from 'rxjs/operators' | ||
10 | 9 | ||
11 | @Component({ | 10 | @Component({ |
12 | selector: 'my-account-video-channels', | 11 | selector: 'my-account-video-channels', |
@@ -53,7 +52,7 @@ export class MyAccountVideoChannelsComponent implements OnInit { | |||
53 | 52 | ||
54 | private loadVideoChannels () { | 53 | private loadVideoChannels () { |
55 | this.authService.userInformationLoaded | 54 | this.authService.userInformationLoaded |
56 | .flatMap(() => this.videoChannelService.listAccountVideoChannels(this.user.account.id)) | 55 | .pipe(flatMap(() => this.videoChannelService.listAccountVideoChannels(this.user.account.id))) |
57 | .subscribe(res => this.videoChannels = res.data) | 56 | .subscribe(res => this.videoChannels = res.data) |
58 | } | 57 | } |
59 | } | 58 | } |
diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts index c1b53bcd5..d8c919fee 100644 --- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts +++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts | |||
@@ -1,12 +1,11 @@ | |||
1 | import { Component, OnInit, OnDestroy } from '@angular/core' | 1 | import { from as observableFrom, Observable } from 'rxjs' |
2 | import { concatAll, tap } from 'rxjs/operators' | ||
3 | import { Component, OnDestroy, OnInit } from '@angular/core' | ||
2 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { Location } from '@angular/common' | 5 | import { Location } from '@angular/common' |
4 | import { immutableAssign } from '@app/shared/misc/utils' | 6 | import { immutableAssign } from '@app/shared/misc/utils' |
5 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | 7 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' |
6 | import { NotificationsService } from 'angular2-notifications' | 8 | import { NotificationsService } from 'angular2-notifications' |
7 | import 'rxjs/add/observable/from' | ||
8 | import 'rxjs/add/operator/concatAll' | ||
9 | import { Observable } from 'rxjs/Observable' | ||
10 | import { AuthService } from '../../core/auth' | 9 | import { AuthService } from '../../core/auth' |
11 | import { ConfirmService } from '../../core/confirm' | 10 | import { ConfirmService } from '../../core/confirm' |
12 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | 11 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' |
@@ -78,14 +77,14 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni | |||
78 | const observables: Observable<any>[] = [] | 77 | const observables: Observable<any>[] = [] |
79 | for (const videoId of toDeleteVideosIds) { | 78 | for (const videoId of toDeleteVideosIds) { |
80 | const o = this.videoService | 79 | const o = this.videoService |
81 | .removeVideo(videoId) | 80 | .removeVideo(videoId) |
82 | .do(() => this.spliceVideosById(videoId)) | 81 | .pipe(tap(() => this.spliceVideosById(videoId))) |
83 | 82 | ||
84 | observables.push(o) | 83 | observables.push(o) |
85 | } | 84 | } |
86 | 85 | ||
87 | Observable.from(observables) | 86 | observableFrom(observables).pipe( |
88 | .concatAll() | 87 | concatAll()) |
89 | .subscribe( | 88 | .subscribe( |
90 | res => { | 89 | res => { |
91 | this.notificationsService.success('Success', `${toDeleteVideosIds.length} videos deleted.`) | 90 | this.notificationsService.success('Success', `${toDeleteVideosIds.length} videos deleted.`) |