From 30b1e1060371f5f2578910f3f4a2cdf95fe78274 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 4 Sep 2020 10:47:52 +0200 Subject: Fix privacy/channel select on upload --- .../+video-edit/video-add-components/video-upload.component.ts | 4 ++-- .../src/app/shared/shared-forms/select/select-options.component.html | 1 + .../src/app/shared/shared-forms/select/select-options.component.ts | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'client/src') diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index 416b655a4..32a17052a 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts @@ -185,9 +185,9 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy this.form.patchValue({ name, - privacy, + privacy: this.firstStepPrivacyId, nsfw, - channelId, + channelId: this.firstStepChannelId, previewfile: this.previewfileUpload }) diff --git a/client/src/app/shared/shared-forms/select/select-options.component.html b/client/src/app/shared/shared-forms/select/select-options.component.html index 48eca1cf5..6d0d7e925 100644 --- a/client/src/app/shared/shared-forms/select/select-options.component.html +++ b/client/src/app/shared/shared-forms/select/select-options.component.html @@ -4,6 +4,7 @@ [(ngModel)]="selectedId" (ngModelChange)="onModelChange()" [clearable]="clearable" + [labelForId]="labelForId" [searchable]="searchable" bindLabel="label" diff --git a/client/src/app/shared/shared-forms/select/select-options.component.ts b/client/src/app/shared/shared-forms/select/select-options.component.ts index 3ba24c732..f0abd1a68 100644 --- a/client/src/app/shared/shared-forms/select/select-options.component.ts +++ b/client/src/app/shared/shared-forms/select/select-options.component.ts @@ -1,5 +1,5 @@ -import { Component, Input, forwardRef } from '@angular/core' -import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms' +import { Component, forwardRef, Input } from '@angular/core' +import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' export type SelectOptionsItem = { id: string | number @@ -26,6 +26,7 @@ export class SelectOptionsComponent implements ControlValueAccessor { @Input() clearable = false @Input() searchable = false @Input() groupBy: string + @Input() labelForId: string selectedId: number | string -- cgit v1.2.3