diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-videos')
2 files changed, 13 insertions, 21 deletions
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 2d88ac760..41608f796 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 | |||
@@ -5,7 +5,7 @@ import { ActivatedRoute, Router } from '@angular/router' | |||
5 | import { Location } from '@angular/common' | 5 | import { Location } from '@angular/common' |
6 | import { immutableAssign } from '@app/shared/misc/utils' | 6 | import { immutableAssign } from '@app/shared/misc/utils' |
7 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | 7 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' |
8 | import { NotificationsService } from 'angular2-notifications' | 8 | import { Notifier } from '@app/core' |
9 | import { AuthService } from '../../core/auth' | 9 | import { AuthService } from '../../core/auth' |
10 | import { ConfirmService } from '../../core/confirm' | 10 | import { ConfirmService } from '../../core/confirm' |
11 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | 11 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' |
@@ -40,7 +40,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni | |||
40 | protected router: Router, | 40 | protected router: Router, |
41 | protected route: ActivatedRoute, | 41 | protected route: ActivatedRoute, |
42 | protected authService: AuthService, | 42 | protected authService: AuthService, |
43 | protected notificationsService: NotificationsService, | 43 | protected notifier: Notifier, |
44 | protected location: Location, | 44 | protected location: Location, |
45 | protected screenService: ScreenService, | 45 | protected screenService: ScreenService, |
46 | protected i18n: I18n, | 46 | protected i18n: I18n, |
@@ -102,16 +102,13 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni | |||
102 | .pipe(concatAll()) | 102 | .pipe(concatAll()) |
103 | .subscribe( | 103 | .subscribe( |
104 | res => { | 104 | res => { |
105 | this.notificationsService.success( | 105 | this.notifier.success(this.i18n('{{deleteLength}} videos deleted.', { deleteLength: toDeleteVideosIds.length })) |
106 | this.i18n('Success'), | ||
107 | this.i18n('{{deleteLength}} videos deleted.', { deleteLength: toDeleteVideosIds.length }) | ||
108 | ) | ||
109 | 106 | ||
110 | this.abortSelectionMode() | 107 | this.abortSelectionMode() |
111 | this.reloadVideos() | 108 | this.reloadVideos() |
112 | }, | 109 | }, |
113 | 110 | ||
114 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 111 | err => this.notifier.error(err.message) |
115 | ) | 112 | ) |
116 | } | 113 | } |
117 | 114 | ||
@@ -124,15 +121,12 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni | |||
124 | 121 | ||
125 | this.videoService.removeVideo(video.id) | 122 | this.videoService.removeVideo(video.id) |
126 | .subscribe( | 123 | .subscribe( |
127 | status => { | 124 | () => { |
128 | this.notificationsService.success( | 125 | this.notifier.success(this.i18n('Video {{videoName}} deleted.', { videoName: video.name })) |
129 | this.i18n('Success'), | ||
130 | this.i18n('Video {{videoName}} deleted.', { videoName: video.name }) | ||
131 | ) | ||
132 | this.reloadVideos() | 126 | this.reloadVideos() |
133 | }, | 127 | }, |
134 | 128 | ||
135 | error => this.notificationsService.error(this.i18n('Error'), error.message) | 129 | error => this.notifier.error(error.message) |
136 | ) | 130 | ) |
137 | } | 131 | } |
138 | 132 | ||
diff --git a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts index 9f94f3c13..37d7cf2a4 100644 --- a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts +++ b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { Notifier } from '@app/core' |
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { FormReactive, UserService } from '../../../shared/index' | 4 | import { FormReactive, UserService } from '../../../shared/index' |
5 | import { Video } from '@app/shared/video/video.model' | 5 | import { Video } from '@app/shared/video/video.model' |
@@ -25,7 +25,7 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni | |||
25 | protected formValidatorService: FormValidatorService, | 25 | protected formValidatorService: FormValidatorService, |
26 | private videoChangeOwnershipValidatorsService: VideoChangeOwnershipValidatorsService, | 26 | private videoChangeOwnershipValidatorsService: VideoChangeOwnershipValidatorsService, |
27 | private videoOwnershipService: VideoOwnershipService, | 27 | private videoOwnershipService: VideoOwnershipService, |
28 | private notificationsService: NotificationsService, | 28 | private notifier: Notifier, |
29 | private userService: UserService, | 29 | private userService: UserService, |
30 | private modalService: NgbModal, | 30 | private modalService: NgbModal, |
31 | private i18n: I18n | 31 | private i18n: I18n |
@@ -53,11 +53,9 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni | |||
53 | const query = event.query | 53 | const query = event.query |
54 | this.userService.autocomplete(query) | 54 | this.userService.autocomplete(query) |
55 | .subscribe( | 55 | .subscribe( |
56 | usernames => { | 56 | usernames => this.usernamePropositions = usernames, |
57 | this.usernamePropositions = usernames | ||
58 | }, | ||
59 | 57 | ||
60 | err => this.notificationsService.error('Error', err.message) | 58 | err => this.notifier.error(err.message) |
61 | ) | 59 | ) |
62 | } | 60 | } |
63 | 61 | ||
@@ -67,9 +65,9 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni | |||
67 | this.videoOwnershipService | 65 | this.videoOwnershipService |
68 | .changeOwnership(this.video.id, username) | 66 | .changeOwnership(this.video.id, username) |
69 | .subscribe( | 67 | .subscribe( |
70 | () => this.notificationsService.success(this.i18n('Success'), this.i18n('Ownership change request sent.')), | 68 | () => this.notifier.success(this.i18n('Ownership change request sent.')), |
71 | 69 | ||
72 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 70 | err => this.notifier.error(err.message) |
73 | ) | 71 | ) |
74 | } | 72 | } |
75 | } | 73 | } |