diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-27 16:14:11 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-27 16:14:11 +0100 |
commit | 7ddd02c9b8c1e088f6679a2227f105e6439fc992 (patch) | |
tree | a1ff7af17f2a95abe85a2380834957e44032e8c2 /client/src/app/videos/video-watch/video-report.component.ts | |
parent | cddadde81f91219204cec1f4057a191c02a70894 (diff) | |
download | PeerTube-7ddd02c9b8c1e088f6679a2227f105e6439fc992.tar.gz PeerTube-7ddd02c9b8c1e088f6679a2227f105e6439fc992.tar.zst PeerTube-7ddd02c9b8c1e088f6679a2227f105e6439fc992.zip |
Client: better notifications for a beautiful world
Diffstat (limited to 'client/src/app/videos/video-watch/video-report.component.ts')
-rw-r--r-- | client/src/app/videos/video-watch/video-report.component.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/client/src/app/videos/video-watch/video-report.component.ts b/client/src/app/videos/video-watch/video-report.component.ts index 7a125f53e..19a7af148 100644 --- a/client/src/app/videos/video-watch/video-report.component.ts +++ b/client/src/app/videos/video-watch/video-report.component.ts | |||
@@ -2,6 +2,7 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core'; | |||
2 | import { FormBuilder, FormGroup } from '@angular/forms'; | 2 | import { FormBuilder, FormGroup } from '@angular/forms'; |
3 | 3 | ||
4 | import { ModalDirective } from 'ng2-bootstrap/modal'; | 4 | import { ModalDirective } from 'ng2-bootstrap/modal'; |
5 | import { NotificationsService } from 'angular2-notifications'; | ||
5 | 6 | ||
6 | import { FormReactive, VideoAbuseService, VIDEO_ABUSE_REASON } from '../../shared'; | 7 | import { FormReactive, VideoAbuseService, VIDEO_ABUSE_REASON } from '../../shared'; |
7 | import { Video, VideoService } from '../shared'; | 8 | import { Video, VideoService } from '../shared'; |
@@ -26,7 +27,8 @@ export class VideoReportComponent extends FormReactive implements OnInit { | |||
26 | 27 | ||
27 | constructor( | 28 | constructor( |
28 | private formBuilder: FormBuilder, | 29 | private formBuilder: FormBuilder, |
29 | private videoAbuseService: VideoAbuseService | 30 | private videoAbuseService: VideoAbuseService, |
31 | private notificationsService: NotificationsService | ||
30 | ) { | 32 | ) { |
31 | super(); | 33 | super(); |
32 | } | 34 | } |
@@ -56,13 +58,12 @@ export class VideoReportComponent extends FormReactive implements OnInit { | |||
56 | 58 | ||
57 | this.videoAbuseService.reportVideo(this.video.id, reason) | 59 | this.videoAbuseService.reportVideo(this.video.id, reason) |
58 | .subscribe( | 60 | .subscribe( |
59 | // TODO: move alert to beautiful notifications | 61 | () => { |
60 | ok => { | 62 | this.notificationsService.success('Success', 'Video reported.'); |
61 | alert('Video reported.'); | ||
62 | this.hide(); | 63 | this.hide(); |
63 | }, | 64 | }, |
64 | 65 | ||
65 | err => alert(err.text) | 66 | err => this.notificationsService.error('Error', err.text); |
66 | ) | 67 | ) |
67 | } | 68 | } |
68 | } | 69 | } |