From 851f5daa1eec66e1faa3c45238ec9ab91be05b00 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Jun 2019 14:50:27 +0200 Subject: Add ability to set a public to private in client --- client/src/app/videos/+video-edit/shared/video-edit.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'client/src/app/videos/+video-edit/shared') diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts index 95d397b52..a2776b73d 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts @@ -13,6 +13,7 @@ import { VideoCaptionAddModalComponent } from '@app/videos/+video-edit/shared/vi import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' import { removeElementFromArray } from '@app/shared/misc/utils' import { VideoConstant, VideoPrivacy } from '../../../../../../shared' +import { VideoService } from '@app/shared/video/video.service' @Component({ selector: 'my-video-edit', @@ -23,7 +24,6 @@ export class VideoEditComponent implements OnInit, OnDestroy { @Input() form: FormGroup @Input() formErrors: { [ id: string ]: string } = {} @Input() validationMessages: FormReactiveValidationMessages = {} - @Input() videoPrivacies: VideoConstant[] = [] @Input() userVideoChannels: { id: number, label: string, support: string }[] = [] @Input() schedulePublicationPossible = true @Input() videoCaptions: (VideoCaptionEdit & { captionPath?: string })[] = [] @@ -34,6 +34,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { // So that it can be accessed in the template readonly SPECIAL_SCHEDULED_PRIVACY = VideoEdit.SPECIAL_SCHEDULED_PRIVACY + videoPrivacies: VideoConstant[] = [] videoCategories: VideoConstant[] = [] videoLicences: VideoConstant[] = [] videoLanguages: VideoConstant[] = [] @@ -58,6 +59,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { private formValidatorService: FormValidatorService, private videoValidatorsService: VideoValidatorsService, private videoCaptionService: VideoCaptionService, + private videoService: VideoService, private route: ActivatedRoute, private router: Router, private notifier: Notifier, @@ -132,6 +134,9 @@ export class VideoEditComponent implements OnInit, OnDestroy { this.videoLicences = this.serverService.getVideoLicences() this.videoLanguages = this.serverService.getVideoLanguages() + const privacies = this.serverService.getVideoPrivacies() + this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies) + this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) this.ngZone.runOutsideAngular(() => { -- cgit v1.2.3