X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2Fvideo-watch%2Fvideo-report.component.ts;h=528005b84126428e46095264ff552042aa94c7e9;hb=ab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd;hp=7a125f53e573dd548c7d9fca9a79ecd7d038f119;hpb=11ac88de40215783835cf6e6259ff0f6cee258dd;p=github%2FChocobozzz%2FPeerTube.git 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..528005b84 100644 --- a/client/src/app/videos/video-watch/video-report.component.ts +++ b/client/src/app/videos/video-watch/video-report.component.ts @@ -1,7 +1,8 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { ModalDirective } from 'ng2-bootstrap/modal'; +import { ModalDirective } from 'ngx-bootstrap/modal'; +import { NotificationsService } from 'angular2-notifications'; import { FormReactive, VideoAbuseService, VIDEO_ABUSE_REASON } from '../../shared'; import { Video, VideoService } from '../shared'; @@ -26,7 +27,8 @@ export class VideoReportComponent extends FormReactive implements OnInit { constructor( private formBuilder: FormBuilder, - private videoAbuseService: VideoAbuseService + private videoAbuseService: VideoAbuseService, + private notificationsService: NotificationsService ) { super(); } @@ -52,17 +54,16 @@ export class VideoReportComponent extends FormReactive implements OnInit { } report() { - const reason = this.form.value['reason'] + const reason = this.form.value['reason']; this.videoAbuseService.reportVideo(this.video.id, reason) - .subscribe( - // TODO: move alert to beautiful notifications - ok => { - alert('Video reported.'); - this.hide(); - }, + .subscribe( + () => { + this.notificationsService.success('Success', 'Video reported.'); + this.hide(); + }, - err => alert(err.text) - ) + err => this.notificationsService.error('Error', err.text) + ); } }