1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Correctly display multi select header

This commit is contained in:
Chocobozzz 2025-04-10 10:07:28 +02:00
parent e7753c1b62
commit 7d99a6b857
No known key found for this signature in database
GPG key ID: 583A612D890159BE
14 changed files with 19 additions and 41 deletions

View file

@ -1,14 +1,13 @@
import { NgClass, NgIf } from '@angular/common'
import { Component, input } from '@angular/core' import { Component, input } from '@angular/core'
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms' import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'
import { PeerTubeTemplateDirective } from '../../../shared/shared-main/common/peertube-template.directive'
import { HelpComponent } from '../../../shared/shared-main/buttons/help.component' import { HelpComponent } from '../../../shared/shared-main/buttons/help.component'
import { NgClass, NgIf } from '@angular/common'
@Component({ @Component({
selector: 'my-edit-advanced-configuration', selector: 'my-edit-advanced-configuration',
templateUrl: './edit-advanced-configuration.component.html', templateUrl: './edit-advanced-configuration.component.html',
styleUrls: [ './edit-custom-config.component.scss' ], styleUrls: [ './edit-custom-config.component.scss' ],
imports: [ FormsModule, ReactiveFormsModule, NgClass, NgIf, HelpComponent, PeerTubeTemplateDirective ] imports: [ FormsModule, ReactiveFormsModule, NgClass, NgIf, HelpComponent ]
}) })
export class EditAdvancedConfigurationComponent { export class EditAdvancedConfigurationComponent {
readonly form = input<FormGroup>(undefined) readonly form = input<FormGroup>(undefined)

View file

@ -24,7 +24,6 @@ import { PeertubeCheckboxComponent } from '../../../../shared/shared-forms/peert
import { SelectCustomValueComponent } from '../../../../shared/shared-forms/select/select-custom-value.component' import { SelectCustomValueComponent } from '../../../../shared/shared-forms/select/select-custom-value.component'
import { HelpComponent } from '../../../../shared/shared-main/buttons/help.component' import { HelpComponent } from '../../../../shared/shared-main/buttons/help.component'
import { BytesPipe } from '../../../../shared/shared-main/common/bytes.pipe' import { BytesPipe } from '../../../../shared/shared-main/common/bytes.pipe'
import { PeerTubeTemplateDirective } from '../../../../shared/shared-main/common/peertube-template.directive'
import { UserRealQuotaInfoComponent } from '../../../shared/user-real-quota-info.component' import { UserRealQuotaInfoComponent } from '../../../shared/user-real-quota-info.component'
import { UserEdit } from './user-edit' import { UserEdit } from './user-edit'
import { UserPasswordComponent } from './user-password.component' import { UserPasswordComponent } from './user-password.component'
@ -42,7 +41,6 @@ import { UserPasswordComponent } from './user-password.component'
ReactiveFormsModule, ReactiveFormsModule,
NgClass, NgClass,
HelpComponent, HelpComponent,
PeerTubeTemplateDirective,
InputTextComponent, InputTextComponent,
NgFor, NgFor,
SelectCustomValueComponent, SelectCustomValueComponent,

View file

@ -22,7 +22,6 @@ import { PeertubeCheckboxComponent } from '../../../../shared/shared-forms/peert
import { SelectCustomValueComponent } from '../../../../shared/shared-forms/select/select-custom-value.component' import { SelectCustomValueComponent } from '../../../../shared/shared-forms/select/select-custom-value.component'
import { HelpComponent } from '../../../../shared/shared-main/buttons/help.component' import { HelpComponent } from '../../../../shared/shared-main/buttons/help.component'
import { BytesPipe } from '../../../../shared/shared-main/common/bytes.pipe' import { BytesPipe } from '../../../../shared/shared-main/common/bytes.pipe'
import { PeerTubeTemplateDirective } from '../../../../shared/shared-main/common/peertube-template.directive'
import { UserRealQuotaInfoComponent } from '../../../shared/user-real-quota-info.component' import { UserRealQuotaInfoComponent } from '../../../shared/user-real-quota-info.component'
import { UserEdit } from './user-edit' import { UserEdit } from './user-edit'
import { UserPasswordComponent } from './user-password.component' import { UserPasswordComponent } from './user-password.component'
@ -40,7 +39,6 @@ import { UserPasswordComponent } from './user-password.component'
ReactiveFormsModule, ReactiveFormsModule,
NgClass, NgClass,
HelpComponent, HelpComponent,
PeerTubeTemplateDirective,
InputTextComponent, InputTextComponent,
NgFor, NgFor,
SelectCustomValueComponent, SelectCustomValueComponent,

View file

@ -9,7 +9,6 @@ import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.serv
import { TextareaAutoResizeDirective } from '@app/shared/shared-forms/textarea-autoresize.directive' import { TextareaAutoResizeDirective } from '@app/shared/shared-forms/textarea-autoresize.directive'
import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component' import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component'
import { HelpComponent } from '@app/shared/shared-main/buttons/help.component' import { HelpComponent } from '@app/shared/shared-main/buttons/help.component'
import { PeerTubeTemplateDirective } from '@app/shared/shared-main/common/peertube-template.directive'
import { LoginLinkComponent } from '@app/shared/shared-main/users/login-link.component' import { LoginLinkComponent } from '@app/shared/shared-main/users/login-link.component'
import { Video } from '@app/shared/shared-main/video/video.model' import { Video } from '@app/shared/shared-main/video/video.model'
import { RemoteSubscribeComponent } from '@app/shared/shared-user-subscription/remote-subscribe.component' import { RemoteSubscribeComponent } from '@app/shared/shared-user-subscription/remote-subscribe.component'
@ -30,7 +29,6 @@ import { Observable } from 'rxjs'
TextareaAutoResizeDirective, TextareaAutoResizeDirective,
NgClass, NgClass,
HelpComponent, HelpComponent,
PeerTubeTemplateDirective,
NgIf, NgIf,
GlobalIconComponent, GlobalIconComponent,
RemoteSubscribeComponent, RemoteSubscribeComponent,

View file

@ -16,7 +16,6 @@ import { SelectChannelItem } from 'src/types'
import { SelectChannelComponent } from '../../../shared/shared-forms/select/select-channel.component' import { SelectChannelComponent } from '../../../shared/shared-forms/select/select-channel.component'
import { GlobalIconComponent } from '../../../shared/shared-icons/global-icon.component' import { GlobalIconComponent } from '../../../shared/shared-icons/global-icon.component'
import { HelpComponent } from '../../../shared/shared-main/buttons/help.component' import { HelpComponent } from '../../../shared/shared-main/buttons/help.component'
import { PeerTubeTemplateDirective } from '../../../shared/shared-main/common/peertube-template.directive'
import { VideoManageContainerComponent } from '../../shared-manage/video-manage-container.component' import { VideoManageContainerComponent } from '../../shared-manage/video-manage-container.component'
import { DragDropDirective } from '../shared/drag-drop.directive' import { DragDropDirective } from '../shared/drag-drop.directive'
@ -33,7 +32,6 @@ const debugLogger = debug('peertube:video-publish')
GlobalIconComponent, GlobalIconComponent,
NgbTooltip, NgbTooltip,
HelpComponent, HelpComponent,
PeerTubeTemplateDirective,
FormsModule, FormsModule,
DragDropDirective, DragDropDirective,
SelectChannelComponent, SelectChannelComponent,

View file

@ -19,7 +19,6 @@ import { SelectChannelItem } from 'src/types'
import { SelectChannelComponent } from '../../../shared/shared-forms/select/select-channel.component' import { SelectChannelComponent } from '../../../shared/shared-forms/select/select-channel.component'
import { GlobalIconComponent } from '../../../shared/shared-icons/global-icon.component' import { GlobalIconComponent } from '../../../shared/shared-icons/global-icon.component'
import { HelpComponent } from '../../../shared/shared-main/buttons/help.component' import { HelpComponent } from '../../../shared/shared-main/buttons/help.component'
import { PeerTubeTemplateDirective } from '../../../shared/shared-main/common/peertube-template.directive'
import { VideoManageContainerComponent } from '../../shared-manage/video-manage-container.component' import { VideoManageContainerComponent } from '../../shared-manage/video-manage-container.component'
const debugLogger = debug('peertube:video-publish') const debugLogger = debug('peertube:video-publish')
@ -32,7 +31,6 @@ const debugLogger = debug('peertube:video-publish')
NgIf, NgIf,
GlobalIconComponent, GlobalIconComponent,
HelpComponent, HelpComponent,
PeerTubeTemplateDirective,
FormsModule, FormsModule,
RouterLink, RouterLink,
SelectChannelComponent, SelectChannelComponent,

View file

@ -7,9 +7,8 @@ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'
import { GlobalIconComponent } from '../../shared/shared-icons/global-icon.component' import { GlobalIconComponent } from '../../shared/shared-icons/global-icon.component'
import { getReplaceFileUnavailability, getStudioUnavailability } from './common/unavailable-features' import { getReplaceFileUnavailability, getStudioUnavailability } from './common/unavailable-features'
import { VideoEdit } from './common/video-edit.model' import { VideoEdit } from './common/video-edit.model'
import { VideoManageController } from './video-manage-controller.service'
import { HelpComponent } from '../../shared/shared-main/buttons/help.component'
import { UnavailableMenuEntryComponent } from './unavailable-menu-entry.component' import { UnavailableMenuEntryComponent } from './unavailable-menu-entry.component'
import { VideoManageController } from './video-manage-controller.service'
@Component({ @Component({
selector: 'my-video-manage-menu', selector: 'my-video-manage-menu',
@ -22,7 +21,6 @@ import { UnavailableMenuEntryComponent } from './unavailable-menu-entry.componen
ReactiveFormsModule, ReactiveFormsModule,
NgbTooltipModule, NgbTooltipModule,
GlobalIconComponent, GlobalIconComponent,
HelpComponent,
UnavailableMenuEntryComponent UnavailableMenuEntryComponent
] ]
}) })

View file

@ -1,7 +1,7 @@
import { AfterContentInit, Component, forwardRef, TemplateRef, input, model, contentChildren } from '@angular/core'
import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'
import { HelpComponent } from '../shared-main/buttons/help.component'
import { NgIf, NgTemplateOutlet } from '@angular/common' import { NgIf, NgTemplateOutlet } from '@angular/common'
import { AfterContentInit, Component, contentChildren, forwardRef, input, model, TemplateRef } from '@angular/core'
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms'
import { HelpComponent } from '../shared-main/buttons/help.component'
import { PeerTubeTemplateDirective } from '../shared-main/common/peertube-template.directive' import { PeerTubeTemplateDirective } from '../shared-main/common/peertube-template.directive'
@Component({ @Component({
@ -15,7 +15,7 @@ import { PeerTubeTemplateDirective } from '../shared-main/common/peertube-templa
multi: true multi: true
} }
], ],
imports: [ FormsModule, NgIf, NgTemplateOutlet, HelpComponent, PeerTubeTemplateDirective ] imports: [ FormsModule, NgIf, NgTemplateOutlet, HelpComponent ]
}) })
export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterContentInit { export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterContentInit {
readonly checked = model(false) readonly checked = model(false)

View file

@ -18,6 +18,7 @@ import { SelectCheckboxComponent } from './select-checkbox.component'
[selectedItemsLabel]="selectedItemsLabel" [selectedItemsLabel]="selectedItemsLabel"
showClear="false" showClear="false"
showToggleAll="true"
[virtualScroll]="virtualScroll()" [virtualScroll]="virtualScroll()"

View file

@ -8,13 +8,11 @@
[placeholder]="placeholder()" [placeholder]="placeholder()"
[showClear]="showClear()" [showClear]="showClear()"
[showHeader]="showHeader()"
[showToggleAll]="showToggleAll()" [showToggleAll]="showToggleAll()"
optionValue="id" optionValue="id"
[selectedItemsLabel]="selectedItemsLabel()" [selectedItemsLabel]="selectedItemsLabel()"
[selectionLimit]="selectionLimit()"
[virtualScroll]="virtualScroll()" [virtualScroll]="virtualScroll()"
[virtualScrollItemSize]="virtualScrollItemSize()" [virtualScrollItemSize]="virtualScrollItemSize()"

View file

@ -26,15 +26,12 @@ export class SelectCheckboxComponent implements ControlValueAccessor {
readonly selectableGroupAsModel = input<boolean>(undefined) readonly selectableGroupAsModel = input<boolean>(undefined)
readonly placeholder = input<string>(undefined) readonly placeholder = input<string>(undefined)
readonly selectionLimit = input<number>(undefined)
readonly selectedItemsLabel = input<string>(undefined) readonly selectedItemsLabel = input<string>(undefined)
readonly virtualScroll = input(false, { transform: booleanAttribute }) readonly virtualScroll = input(false, { transform: booleanAttribute })
readonly virtualScrollItemSize = input(33, { transform: numberAttribute }) readonly virtualScrollItemSize = input(33, { transform: numberAttribute })
readonly showClear = input<boolean, unknown>(undefined, { transform: booleanAttribute }) readonly showClear = input<boolean, unknown>(undefined, { transform: booleanAttribute })
readonly showHeader = input<boolean, unknown>(undefined, { transform: booleanAttribute })
readonly showToggleAll = input<boolean, unknown>(undefined, { transform: booleanAttribute }) readonly showToggleAll = input<boolean, unknown>(undefined, { transform: booleanAttribute })
readonly panelHide = output() readonly panelHide = output()

View file

@ -6,7 +6,6 @@ import { ServerConfig, ServerStats } from '@peertube/peertube-models'
import { of } from 'rxjs' import { of } from 'rxjs'
import { HelpComponent } from '../shared-main/buttons/help.component' import { HelpComponent } from '../shared-main/buttons/help.component'
import { BytesPipe } from '../shared-main/common/bytes.pipe' import { BytesPipe } from '../shared-main/common/bytes.pipe'
import { PeerTubeTemplateDirective } from '../shared-main/common/peertube-template.directive'
import { DaysDurationFormatterPipe } from '../shared-main/date/days-duration-formatter.pipe' import { DaysDurationFormatterPipe } from '../shared-main/date/days-duration-formatter.pipe'
import { FeatureBooleanComponent } from './feature-boolean.component' import { FeatureBooleanComponent } from './feature-boolean.component'
@ -14,7 +13,7 @@ import { FeatureBooleanComponent } from './feature-boolean.component'
selector: 'my-instance-features-table', selector: 'my-instance-features-table',
templateUrl: './instance-features-table.component.html', templateUrl: './instance-features-table.component.html',
styleUrls: [ './instance-features-table.component.scss' ], styleUrls: [ './instance-features-table.component.scss' ],
imports: [ NgIf, FeatureBooleanComponent, HelpComponent, PeerTubeTemplateDirective, NgFor, BytesPipe ] imports: [ NgIf, FeatureBooleanComponent, HelpComponent, NgFor, BytesPipe ]
}) })
export class InstanceFeaturesTableComponent implements OnInit { export class InstanceFeaturesTableComponent implements OnInit {
private serverService = inject(ServerService) private serverService = inject(ServerService)

View file

@ -1,18 +1,16 @@
import { pick } from 'lodash-es' import { NgIf } from '@angular/common'
import { Subject, Subscription } from 'rxjs'
import { first } from 'rxjs/operators'
import { Component, OnDestroy, OnInit, inject, input } from '@angular/core' import { Component, OnDestroy, OnInit, inject, input } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { AuthService, Notifier, ServerService, User, UserService } from '@app/core' import { AuthService, Notifier, ServerService, User, UserService } from '@app/core'
import { FormReactive } from '@app/shared/shared-forms/form-reactive' import { FormReactive } from '@app/shared/shared-forms/form-reactive'
import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service' import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service'
import { NSFWPolicyType, UserUpdateMe } from '@peertube/peertube-models' import { NSFWPolicyType, UserUpdateMe } from '@peertube/peertube-models'
import { NgIf } from '@angular/common' import { pick } from 'lodash-es'
import { Subject, Subscription } from 'rxjs'
import { first } from 'rxjs/operators'
import { PeertubeCheckboxComponent } from '../shared-forms/peertube-checkbox.component' import { PeertubeCheckboxComponent } from '../shared-forms/peertube-checkbox.component'
import { SelectLanguagesComponent } from '../shared-forms/select/select-languages.component' import { SelectLanguagesComponent } from '../shared-forms/select/select-languages.component'
import { PeerTubeTemplateDirective } from '../shared-main/common/peertube-template.directive'
import { HelpComponent } from '../shared-main/buttons/help.component' import { HelpComponent } from '../shared-main/buttons/help.component'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
@Component({ @Component({
selector: 'my-user-video-settings', selector: 'my-user-video-settings',
@ -22,7 +20,6 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
HelpComponent, HelpComponent,
PeerTubeTemplateDirective,
SelectLanguagesComponent, SelectLanguagesComponent,
PeertubeCheckboxComponent, PeertubeCheckboxComponent,
NgIf NgIf

View file

@ -1,19 +1,18 @@
import { NgIf } from '@angular/common'
import { Component, OnInit, inject, input } from '@angular/core' import { Component, OnInit, inject, input } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { Notifier } from '@app/core' import { Notifier } from '@app/core'
import { FormReactive } from '@app/shared/shared-forms/form-reactive' import { FormReactive } from '@app/shared/shared-forms/form-reactive'
import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service' import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service'
import { logger } from '@root-helpers/logger' import { logger } from '@root-helpers/logger'
import { USER_HANDLE_VALIDATOR } from '../form-validators/user-validators'
import { PeerTubeTemplateDirective } from '../shared-main/common/peertube-template.directive'
import { HelpComponent } from '../shared-main/buttons/help.component'
import { NgIf } from '@angular/common'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { isIOS } from '@root-helpers/web-browser' import { isIOS } from '@root-helpers/web-browser'
import { USER_HANDLE_VALIDATOR } from '../form-validators/user-validators'
import { HelpComponent } from '../shared-main/buttons/help.component'
@Component({ @Component({
selector: 'my-remote-subscribe', selector: 'my-remote-subscribe',
templateUrl: './remote-subscribe.component.html', templateUrl: './remote-subscribe.component.html',
imports: [ FormsModule, ReactiveFormsModule, NgIf, HelpComponent, PeerTubeTemplateDirective ] imports: [ FormsModule, ReactiveFormsModule, NgIf, HelpComponent ]
}) })
export class RemoteSubscribeComponent extends FormReactive implements OnInit { export class RemoteSubscribeComponent extends FormReactive implements OnInit {
protected formReactiveService = inject(FormReactiveService) protected formReactiveService = inject(FormReactiveService)