mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
Allow configuration to be static/readonly (#4315)
* Allow configuration to be static/readonly * Make all components disableable * Improve disabled component styling * Rename edits allowed field in configuration * Fix CI
This commit is contained in:
parent
badacdbb4a
commit
8d8a037e3f
23 changed files with 304 additions and 195 deletions
|
@ -23,6 +23,8 @@ export class SelectCheckboxComponent implements OnInit, ControlValueAccessor {
|
|||
@Input() selectableGroupAsModel: boolean
|
||||
@Input() placeholder: string
|
||||
|
||||
disabled = false
|
||||
|
||||
ngOnInit () {
|
||||
if (!this.placeholder) this.placeholder = $localize`Add a new option`
|
||||
}
|
||||
|
@ -59,6 +61,10 @@ export class SelectCheckboxComponent implements OnInit, ControlValueAccessor {
|
|||
this.propagateChange(this.selectedItems)
|
||||
}
|
||||
|
||||
setDisabledState (isDisabled: boolean) {
|
||||
this.disabled = isDisabled
|
||||
}
|
||||
|
||||
compareFn (item: SelectOptionsItem, selected: ItemSelectCheckboxValue) {
|
||||
if (typeof selected === 'string' || typeof selected === 'number') {
|
||||
return item.id === selected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue