diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-ownership')
2 files changed, 10 insertions, 14 deletions
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts b/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts index a68b452ec..79d29b139 100644 --- a/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts +++ b/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { AuthService, Notifier } from '@app/core' |
3 | import { FormReactive } from '@app/shared' | 3 | import { FormReactive } from '@app/shared' |
4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
5 | import { VideoOwnershipService } from '@app/shared/video-ownership' | 5 | import { VideoOwnershipService } from '@app/shared/video-ownership' |
@@ -8,7 +8,6 @@ import { VideoAcceptOwnershipValidatorsService } from '@app/shared/forms/form-va | |||
8 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 8 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
9 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 9 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | 10 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { AuthService } from '@app/core' | ||
12 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 11 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
13 | 12 | ||
14 | @Component({ | 13 | @Component({ |
@@ -31,7 +30,7 @@ export class MyAccountAcceptOwnershipComponent extends FormReactive implements O | |||
31 | protected formValidatorService: FormValidatorService, | 30 | protected formValidatorService: FormValidatorService, |
32 | private videoChangeOwnershipValidatorsService: VideoAcceptOwnershipValidatorsService, | 31 | private videoChangeOwnershipValidatorsService: VideoAcceptOwnershipValidatorsService, |
33 | private videoOwnershipService: VideoOwnershipService, | 32 | private videoOwnershipService: VideoOwnershipService, |
34 | private notificationsService: NotificationsService, | 33 | private notifier: Notifier, |
35 | private authService: AuthService, | 34 | private authService: AuthService, |
36 | private videoChannelService: VideoChannelService, | 35 | private videoChannelService: VideoChannelService, |
37 | private modalService: NgbModal, | 36 | private modalService: NgbModal, |
@@ -68,12 +67,12 @@ export class MyAccountAcceptOwnershipComponent extends FormReactive implements O | |||
68 | .acceptOwnership(videoChangeOwnership.id, { channelId: channel }) | 67 | .acceptOwnership(videoChangeOwnership.id, { channelId: channel }) |
69 | .subscribe( | 68 | .subscribe( |
70 | () => { | 69 | () => { |
71 | this.notificationsService.success(this.i18n('Success'), this.i18n('Ownership accepted')) | 70 | this.notifier.success(this.i18n('Ownership accepted')) |
72 | if (this.accepted) this.accepted.emit() | 71 | if (this.accepted) this.accepted.emit() |
73 | this.videoChangeOwnership = undefined | 72 | this.videoChangeOwnership = undefined |
74 | }, | 73 | }, |
75 | 74 | ||
76 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 75 | err => this.notifier.error(err.message) |
77 | ) | 76 | ) |
78 | } | 77 | } |
79 | } | 78 | } |
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts index 0b51ac13c..77857c4fd 100644 --- a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts +++ b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts | |||
@@ -1,13 +1,11 @@ | |||
1 | import { Component, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, OnInit, ViewChild } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { Notifier } from '@app/core' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
4 | import { RestPagination, RestTable } from '@app/shared' | 3 | import { RestPagination, RestTable } from '@app/shared' |
5 | import { SortMeta } from 'primeng/components/common/sortmeta' | 4 | import { SortMeta } from 'primeng/components/common/sortmeta' |
6 | import { VideoChangeOwnership } from '../../../../../shared' | 5 | import { VideoChangeOwnership } from '../../../../../shared' |
7 | import { VideoOwnershipService } from '@app/shared/video-ownership' | 6 | import { VideoOwnershipService } from '@app/shared/video-ownership' |
8 | import { Account } from '@app/shared/account/account.model' | 7 | import { Account } from '@app/shared/account/account.model' |
9 | import { MyAccountAcceptOwnershipComponent } | 8 | import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component' |
10 | from '@app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component' | ||
11 | 9 | ||
12 | @Component({ | 10 | @Component({ |
13 | selector: 'my-account-ownership', | 11 | selector: 'my-account-ownership', |
@@ -23,9 +21,8 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit { | |||
23 | @ViewChild('myAccountAcceptOwnershipComponent') myAccountAcceptOwnershipComponent: MyAccountAcceptOwnershipComponent | 21 | @ViewChild('myAccountAcceptOwnershipComponent') myAccountAcceptOwnershipComponent: MyAccountAcceptOwnershipComponent |
24 | 22 | ||
25 | constructor ( | 23 | constructor ( |
26 | private notificationsService: NotificationsService, | 24 | private notifier: Notifier, |
27 | private videoOwnershipService: VideoOwnershipService, | 25 | private videoOwnershipService: VideoOwnershipService |
28 | private i18n: I18n | ||
29 | ) { | 26 | ) { |
30 | super() | 27 | super() |
31 | } | 28 | } |
@@ -50,7 +47,7 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit { | |||
50 | this.videoOwnershipService.refuseOwnership(videoChangeOwnership.id) | 47 | this.videoOwnershipService.refuseOwnership(videoChangeOwnership.id) |
51 | .subscribe( | 48 | .subscribe( |
52 | () => this.loadData(), | 49 | () => this.loadData(), |
53 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 50 | err => this.notifier.error(err.message) |
54 | ) | 51 | ) |
55 | } | 52 | } |
56 | 53 | ||
@@ -62,7 +59,7 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit { | |||
62 | this.totalRecords = resultList.total | 59 | this.totalRecords = resultList.total |
63 | }, | 60 | }, |
64 | 61 | ||
65 | err => this.notificationsService.error(this.i18n('Error'), err.message) | 62 | err => this.notifier.error(err.message) |
66 | ) | 63 | ) |
67 | } | 64 | } |
68 | } | 65 | } |