From db7af09bd8e9de57cdda88c2e32387551235b3a4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 9 Oct 2017 19:12:40 +0200 Subject: Client: fix loading server configurations --- client/src/app/videos/+video-edit/video-add.component.ts | 12 +++++++----- client/src/app/videos/+video-edit/video-update.component.ts | 13 ++++++------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'client/src/app/videos/+video-edit') diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index 21311b184..d930423c2 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts @@ -11,12 +11,13 @@ import { VIDEO_LICENCE, VIDEO_LANGUAGE, VIDEO_DESCRIPTION, - VIDEO_TAGS + VIDEO_TAGS, + VIDEO_FILE } from '../../shared' +import { ServerService} from '../../core' import { VideoService } from '../shared' import { VideoCreate } from '../../../../../shared' import { HttpEventType, HttpResponse } from '@angular/common/http' -import { VIDEO_FILE } from '../../shared/forms/form-validators/video' @Component({ selector: 'my-videos-add', @@ -59,6 +60,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { private formBuilder: FormBuilder, private router: Router, private notificationsService: NotificationsService, + private serverService: ServerService, private videoService: VideoService ) { super() @@ -84,9 +86,9 @@ export class VideoAddComponent extends FormReactive implements OnInit { } ngOnInit () { - this.videoCategories = this.videoService.videoCategories - this.videoLicences = this.videoService.videoLicences - this.videoLanguages = this.videoService.videoLanguages + this.videoCategories = this.serverService.getVideoCategories() + this.videoLicences = this.serverService.getVideoLicences() + this.videoLanguages = this.serverService.getVideoLanguages() this.buildForm() } diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index 141ed3522..6d45265e7 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts @@ -1,10 +1,10 @@ -import { Component, ElementRef, OnInit } from '@angular/core' +import { Component, OnInit } from '@angular/core' import { FormBuilder, FormGroup } from '@angular/forms' import { ActivatedRoute, Router } from '@angular/router' import { NotificationsService } from 'angular2-notifications' -import { AuthService } from '../../core' +import { ServerService } from '../../core' import { FormReactive, VIDEO_NAME, @@ -52,12 +52,11 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { fileError = '' constructor ( - private authService: AuthService, - private elementRef: ElementRef, private formBuilder: FormBuilder, private route: ActivatedRoute, private router: Router, private notificationsService: NotificationsService, + private serverService: ServerService, private videoService: VideoService ) { super() @@ -80,9 +79,9 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { ngOnInit () { this.buildForm() - this.videoCategories = this.videoService.videoCategories - this.videoLicences = this.videoService.videoLicences - this.videoLanguages = this.videoService.videoLanguages + this.videoCategories = this.serverService.getVideoCategories() + this.videoLicences = this.serverService.getVideoLicences() + this.videoLanguages = this.serverService.getVideoLanguages() const uuid: string = this.route.snapshot.params['uuid'] this.videoService.getVideo(uuid) -- cgit v1.2.3