From 0f320037e689b2778959c12ddd4ce790f6e4ae4f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 11 May 2018 15:10:13 +0200 Subject: Add ability to update a video channel --- .../app/videos/+video-edit/shared/video-edit.component.html | 2 +- .../app/videos/+video-edit/shared/video-edit.component.scss | 4 ---- .../src/app/videos/+video-edit/shared/video-edit.component.ts | 2 +- client/src/app/videos/+video-edit/video-add.component.ts | 2 +- client/src/app/videos/+video-edit/video-update.component.ts | 10 +++------- 5 files changed, 6 insertions(+), 14 deletions(-) (limited to 'client/src/app/videos/+video-edit') diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html index 9cd3454a0..77b554ad5 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html @@ -33,7 +33,7 @@
-
+
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.scss b/client/src/app/videos/+video-edit/shared/video-edit.component.scss index cf64ff589..58ed5ab98 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.scss +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.scss @@ -5,10 +5,6 @@ @include peertube-select-container(auto); } -.peertube-select-disabled-container { - @include peertube-select-disabled-container(auto); -} - .form-group-checkbox { my-help { margin-left: 5px } } 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 6ab1a4a24..77e984855 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 @@ -75,7 +75,7 @@ export class VideoEditComponent implements OnInit { this.form.addControl('name', new FormControl('', VIDEO_NAME.VALIDATORS)) this.form.addControl('privacy', new FormControl('', VIDEO_PRIVACY.VALIDATORS)) - this.form.addControl('channelId', new FormControl({ value: '', disabled: true })) + this.form.addControl('channelId', new FormControl('', VIDEO_CHANNEL.VALIDATORS)) this.form.addControl('nsfw', new FormControl(false)) this.form.addControl('commentsEnabled', new FormControl(true)) this.form.addControl('category', new FormControl('', VIDEO_CATEGORY.VALIDATORS)) 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 ae5548897..fa967018d 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts @@ -220,7 +220,7 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy const video = new VideoEdit() video.patch(this.form.value) - video.channel = this.firstStepChannelId + video.channelId = this.firstStepChannelId video.id = this.videoUploadedIds.id video.uuid = this.videoUploadedIds.uuid 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 6cd204f72..73e2764c6 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts @@ -9,9 +9,9 @@ import { ServerService } from '../../core' import { AuthService } from '../../core/auth' import { FormReactive } from '../../shared' import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message' -import { populateAsyncUserVideoChannels } from '../../shared/misc/utils' import { VideoEdit } from '../../shared/video/video-edit.model' import { VideoService } from '../../shared/video/video.service' +import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils' @Component({ selector: 'my-videos-update', @@ -64,12 +64,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { video => { this.video = new VideoEdit(video) - this.userVideoChannels = [ - { - id: video.channel.id, - label: video.channel.displayName - } - ] + populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) + .catch(err => console.error(err)) // We cannot set private a video that was not private if (video.privacy.id !== VideoPrivacy.PRIVATE) { -- cgit v1.2.3