Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix ng-select labels

Chocobozzz7c9089ecc233
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html
index d96240339d..de9df8b56d 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html
@@ -76,7 +76,7 @@
<div>
<my-select-checkbox
- id="instanceCategories"
+ labelForId="instanceCategories"
formControlName="categories" [availableItems]="categoryItems"
[selectableGroup]="false"
i18n-placeholder placeholder="Add a new category"
@@ -90,7 +90,7 @@
<div>
<my-select-checkbox
- id="instanceLanguages"
+ labelForId="instanceLanguages"
formControlName="languages" [availableItems]="languageItems"
[selectableGroup]="false"
i18n-placeholder placeholder="Add a new language"
diff --git a/client/src/app/shared/shared-forms/select/select-categories.component.html b/client/src/app/shared/shared-forms/select/select-categories.component.html
index 2ec2f1264f..be842221a0 100644
--- a/client/src/app/shared/shared-forms/select/select-categories.component.html
+++ b/client/src/app/shared/shared-forms/select/select-categories.component.html
@@ -1,4 +1,5 @@
<my-select-checkbox-all
+ [labelForId]="labelForId"
[(ngModel)]="selectedCategories"
(ngModelChange)="onModelChange()"
[availableItems]="availableCategories"
diff --git a/client/src/app/shared/shared-forms/select/select-categories.component.ts b/client/src/app/shared/shared-forms/select/select-categories.component.ts
index 65162cf84d..e85205ebe2 100644
--- a/client/src/app/shared/shared-forms/select/select-categories.component.ts
+++ b/client/src/app/shared/shared-forms/select/select-categories.component.ts
@@ -1,4 +1,4 @@
-import { Component, forwardRef, OnInit } from '@angular/core'
+import { Component, forwardRef, Input, OnInit } from '@angular/core'
import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'
import { ServerService } from '@app/core'
import { SelectOptionsItem } from '../../../../types/select-options-item.model'
@@ -20,6 +20,8 @@ import { SelectCheckboxAllComponent } from './select-checkbox-all.component'
imports: [ SelectCheckboxAllComponent, FormsModule ]
})
export class SelectCategoriesComponent implements ControlValueAccessor, OnInit {
+ @Input({ required: true }) labelForId: string
+
selectedCategories: ItemSelectCheckboxValue[] = []
availableCategories: SelectOptionsItem[] = []
diff --git a/client/src/app/shared/shared-forms/select/select-checkbox-all.component.ts b/client/src/app/shared/shared-forms/select/select-checkbox-all.component.ts
index b60f300220..bc78185fe0 100644
--- a/client/src/app/shared/shared-forms/select/select-checkbox-all.component.ts
+++ b/client/src/app/shared/shared-forms/select/select-checkbox-all.component.ts
@@ -15,6 +15,7 @@ import { ItemSelectCheckboxValue, SelectCheckboxComponent } from './select-check
[availableItems]="availableItems"
[selectableGroup]="true" [selectableGroupAsModel]="true"
[placeholder]="placeholder"
+ [labelForId]="labelForId"
(focusout)="onBlur()"
>
</my-select-checkbox>`,
@@ -29,6 +30,7 @@ import { ItemSelectCheckboxValue, SelectCheckboxComponent } from './select-check
imports: [ SelectCheckboxComponent, FormsModule ]
})
export class SelectCheckboxAllComponent implements ControlValueAccessor {
+ @Input({ required: true }) labelForId: string
@Input() availableItems: SelectOptionsItem[] = []
@Input() allGroupLabel: string
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 7378ba54d0..cbc3fcf0a8 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
@@ -20,6 +20,7 @@ export type ItemSelectCheckboxValue = { id?: string, group?: string } | string
imports: [ NgSelectModule, FormsModule ]
})
export class SelectCheckboxComponent implements OnInit, ControlValueAccessor {
+ @Input({ required: true }) labelForId: string
@Input() availableItems: SelectOptionsItem[] = []
@Input() selectedItems: ItemSelectCheckboxValue[] = []
@Input() selectableGroup: boolean
diff --git a/client/src/app/shared/shared-forms/select/select-languages.component.html b/client/src/app/shared/shared-forms/select/select-languages.component.html
index 6eba26a569..69d57fa4ab 100644
--- a/client/src/app/shared/shared-forms/select/select-languages.component.html
+++ b/client/src/app/shared/shared-forms/select/select-languages.component.html
@@ -5,5 +5,6 @@
[maxItems]="maxLanguages"
i18n-placeholder placeholder="Add a new language"
[allGroupLabel]="allLanguagesGroup"
+ [labelForId]="labelForId"
>
</my-select-checkbox-all>
diff --git a/client/src/app/shared/shared-forms/select/select-languages.component.ts b/client/src/app/shared/shared-forms/select/select-languages.component.ts
index 47a6aab4c0..2d76a1a9f6 100644
--- a/client/src/app/shared/shared-forms/select/select-languages.component.ts
+++ b/client/src/app/shared/shared-forms/select/select-languages.component.ts
@@ -20,6 +20,7 @@ import { SelectCheckboxAllComponent } from './select-checkbox-all.component'
imports: [ SelectCheckboxAllComponent, FormsModule ]
})
export class SelectLanguagesComponent implements ControlValueAccessor, OnInit {
+ @Input({ required: true }) labelForId: string
@Input() maxLanguages: number
selectedLanguages: ItemSelectCheckboxValue[]
diff --git a/client/src/app/shared/shared-user-settings/user-video-settings.component.html b/client/src/app/shared/shared-user-settings/user-video-settings.component.html
index b3f4e2db08..0a58ff3539 100644
--- a/client/src/app/shared/shared-user-settings/user-video-settings.component.html
+++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.html
@@ -30,7 +30,7 @@
</my-help>
<div>
- <my-select-languages [maxLanguages]="20" formControlName="videoLanguages"></my-select-languages>
+ <my-select-languages labelForId="videoLanguages" [maxLanguages]="20" formControlName="videoLanguages"></my-select-languages>
</div>
</div>
diff --git a/client/src/app/shared/shared-video-miniature/video-filters-header.component.html b/client/src/app/shared/shared-video-miniature/video-filters-header.component.html
index 35fbc7e8ec..8aa4788f02 100644
--- a/client/src/app/shared/shared-video-miniature/video-filters-header.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-filters-header.component.html
@@ -80,7 +80,7 @@
<label class="with-description" for="languageOneOf" i18n>Languages:</label>
<ng-template *ngTemplateOutlet="updateSettings; context: { $implicit: 'video-languages-subtitles' }"></ng-template>
- <my-select-languages [maxLanguages]="20" formControlName="languageOneOf"></my-select-languages>
+ <my-select-languages labelForId="languageOneOf" [maxLanguages]="20" formControlName="languageOneOf"></my-select-languages>
</div>
<div class="form-group" role="radiogroup">
@@ -134,7 +134,7 @@
<div class="form-group">
<label for="categoryOneOf" i18n>Categories:</label>
- <my-select-categories formControlName="categoryOneOf"></my-select-categories>
+ <my-select-categories labelForId="categoryOneOf" formControlName="categoryOneOf"></my-select-categories>
</div>
<div class="form-group" *ngIf="canSeeAllVideos()">