X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-forms%2Fselect%2Fselect-checkbox.component.ts;h=eb0c49034c126dbe4e0f7416d48c3fc68bf16bf4;hb=66357162f8e1227495f09bd4f68446aad7071c6d;hp=93653fef13de24239ee21b9a93a7731acd1ea72a;hpb=52c4976fcf4ee255a3af68ff9778e4f5c4f84bd4;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-forms/select/select-checkbox.component.ts b/client/src/app/shared/shared-forms/select/select-checkbox.component.ts index 93653fef1..eb0c49034 100644 --- a/client/src/app/shared/shared-forms/select/select-checkbox.component.ts +++ b/client/src/app/shared/shared-forms/select/select-checkbox.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, OnInit } from '@angular/core' +import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' import { SelectOptionsItem } from './select-options.component' export type ItemSelectCheckboxValue = { id?: string | number, group?: string } | string @@ -16,12 +16,17 @@ export type ItemSelectCheckboxValue = { id?: string | number, group?: string } | } ] }) -export class SelectCheckboxComponent implements ControlValueAccessor { +export class SelectCheckboxComponent implements OnInit, ControlValueAccessor { @Input() availableItems: SelectOptionsItem[] = [] @Input() selectedItems: ItemSelectCheckboxValue[] = [] @Input() selectableGroup: boolean @Input() selectableGroupAsModel: boolean @Input() maxSelectedItems: number + @Input() placeholder: string + + ngOnInit () { + if (!this.placeholder) this.placeholder = $localize`Add a new option` + } propagateChange = (_: any) => { /* empty */ }