From 2011bc29ddea679fcf0ee11324f05f6a8e996507 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 23 Sep 2024 11:22:14 +0200 Subject: [PATCH] Fix alert accessibility --- .../contact-admin-modal.component.html | 5 +-- .../contact-admin-modal.component.ts | 9 ++-- .../edit-basic-configuration.component.html | 2 +- .../edit-basic-configuration.component.ts | 22 +++++----- .../edit-custom-config.component.html | 4 +- .../edit-custom-config.component.ts | 6 ++- .../follow-modal.component.html | 4 +- .../following-list/follow-modal.component.ts | 3 +- .../process-registration-modal.component.html | 12 ++--- .../process-registration-modal.component.ts | 11 ++--- .../users/user-edit/user-create.component.ts | 30 +++++++------ .../users/user-edit/user-edit.component.html | 2 +- .../users/user-edit/user-update.component.ts | 34 +++++++------- .../plugin-search.component.html | 4 +- .../plugin-search.component.scss | 4 -- .../plugin-search/plugin-search.component.ts | 16 ++++--- client/src/app/+login/login.component.html | 16 +++---- client/src/app/+login/login.component.scss | 5 ++- client/src/app/+login/login.component.ts | 18 ++++---- .../video-channel-create.component.ts | 26 ++++++----- .../video-channel-edit.component.html | 2 +- .../video-channel-update.component.ts | 4 +- .../my-account-export.component.html | 6 +-- .../my-account-export.component.ts | 3 +- .../my-account-import.component.html | 8 ++-- .../my-account-import.component.scss | 3 +- .../my-account-import.component.ts | 3 +- .../my-account-change-email.component.html | 4 +- .../my-account-change-email.component.ts | 3 +- .../my-account-change-password.component.html | 2 +- .../my-account-change-password.component.ts | 9 ++-- .../my-account-profile.component.html | 2 +- .../my-account-profile.component.ts | 3 +- .../my-video-channel-syncs.component.html | 2 +- .../my-video-channel-syncs.component.ts | 4 +- .../video-channel-sync-edit.component.html | 2 +- .../video-channel-sync-edit.component.ts | 3 +- .../my-video-playlist-create.component.ts | 16 ++++--- .../my-video-playlist-edit.component.html | 2 +- .../my-video-playlist-update.component.ts | 4 +- .../remote-interaction.component.html | 4 +- .../remote-interaction.component.ts | 9 ++-- client/src/app/+search/search.component.html | 2 +- client/src/app/+search/search.component.ts | 30 +++++++------ .../+signup/+register/register.component.html | 4 +- .../+signup/+register/register.component.ts | 28 ++++++------ .../steps/register-step-about.component.html | 10 +++-- .../steps/register-step-about.component.ts | 7 +-- .../steps/register-step-user.component.html | 4 +- .../steps/register-step-user.component.ts | 9 ++-- .../verify-account-email.component.html | 6 +-- .../verify-account-email.component.ts | 5 ++- .../signup-success-after-email.component.html | 4 +- .../signup-success-after-email.component.ts | 5 ++- ...signup-success-before-email.component.html | 4 +- .../signup-success-before-email.component.ts | 5 ++- .../shared/signup-success.component.scss | 3 +- .../shared/video-edit.component.html | 12 ++--- .../shared/video-edit.component.ts | 8 ++-- .../video-go-live.component.html | 11 ++--- .../video-go-live.component.ts | 34 +++++++------- .../video-import-torrent.component.html | 11 ++--- .../video-import-torrent.component.ts | 38 ++++++++-------- .../video-import-url.component.html | 11 ++--- .../video-import-url.component.ts | 36 ++++++++------- .../video-upload.component.html | 4 +- .../video-upload.component.ts | 44 ++++++++++--------- .../+video-edit/video-add.component.html | 33 ++++++++------ .../+video-edit/video-add.component.scss | 11 +---- .../+video-edit/video-add.component.ts | 12 ++--- .../information/video-alert.component.html | 28 ++++++------ .../information/video-alert.component.scss | 7 --- .../information/video-alert.component.ts | 7 +-- .../menu/quick-settings-modal.component.html | 2 +- .../menu/quick-settings-modal.component.ts | 13 +++--- .../channels-setup-message.component.html | 4 +- .../channels-setup-message.component.scss | 4 -- .../channels-setup-message.component.ts | 11 ++--- .../shared-main/common/alert.component.html | 3 ++ .../shared-main/common/alert.component.scss | 0 .../shared-main/common/alert.component.ts | 41 +++++++++++++++++ .../video-share.component.html | 20 ++++----- .../video-share.component.ts | 24 +++++----- .../live-stream-information.component.html | 4 +- .../live-stream-information.component.scss | 3 +- .../live-stream-information.component.ts | 14 +++--- .../video-files-download.component.html | 4 +- .../video-files-download.component.ts | 4 +- .../upload-progress.component.html | 4 +- .../upload-progress.component.ts | 3 +- server/core/lib/auth/oauth-model.ts | 2 + 91 files changed, 510 insertions(+), 414 deletions(-) delete mode 100644 client/src/app/+videos/+video-watch/shared/information/video-alert.component.scss create mode 100644 client/src/app/shared/shared-main/common/alert.component.html create mode 100644 client/src/app/shared/shared-main/common/alert.component.scss create mode 100644 client/src/app/shared/shared-main/common/alert.component.ts diff --git a/client/src/app/+about/about-instance/contact-admin-modal.component.html b/client/src/app/+about/about-instance/contact-admin-modal.component.html index 531d7e946..0a2c30b30 100644 --- a/client/src/app/+about/about-instance/contact-admin-modal.component.html +++ b/client/src/app/+about/about-instance/contact-admin-modal.component.html @@ -46,7 +46,7 @@ -
{{ error }}
+ {{ error }}
-
The contact form is not enabled on this instance.
- + The contact form is not enabled on this instance.
diff --git a/client/src/app/+about/about-instance/contact-admin-modal.component.ts b/client/src/app/+about/about-instance/contact-admin-modal.component.ts index 070042059..facde4aab 100644 --- a/client/src/app/+about/about-instance/contact-admin-modal.component.ts +++ b/client/src/app/+about/about-instance/contact-admin-modal.component.ts @@ -1,4 +1,6 @@ +import { NgClass, NgIf } from '@angular/common' import { Component, OnInit, ViewChild } from '@angular/core' +import { FormsModule, ReactiveFormsModule } from '@angular/forms' import { Router } from '@angular/router' import { Notifier, ServerService } from '@app/core' import { @@ -9,13 +11,12 @@ import { } from '@app/shared/form-validators/instance-validators' import { FormReactive } from '@app/shared/shared-forms/form-reactive' import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service' +import { AlertComponent } from '@app/shared/shared-main/common/alert.component' +import { InstanceService } from '@app/shared/shared-main/instance/instance.service' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' import { HTMLServerConfig, HttpStatusCode } from '@peertube/peertube-models' -import { FormsModule, ReactiveFormsModule } from '@angular/forms' -import { NgIf, NgClass } from '@angular/common' import { GlobalIconComponent } from '../../shared/shared-icons/global-icon.component' -import { InstanceService } from '@app/shared/shared-main/instance/instance.service' type Prefill = { subject?: string @@ -27,7 +28,7 @@ type Prefill = { templateUrl: './contact-admin-modal.component.html', styleUrls: [ './contact-admin-modal.component.scss' ], standalone: true, - imports: [ GlobalIconComponent, NgIf, FormsModule, ReactiveFormsModule, NgClass ] + imports: [ GlobalIconComponent, NgIf, FormsModule, ReactiveFormsModule, NgClass, AlertComponent ] }) export class ContactAdminModalComponent extends FormReactive implements OnInit { @ViewChild('modal', { static: true }) modal: NgbModal diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html index 79e9aa898..05d8006c8 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html @@ -165,7 +165,7 @@ ⚠️ This functionality requires a lot of attention and extra moderation. - + diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts index b264d53e2..6b136742f 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts @@ -1,19 +1,20 @@ -import { pairwise } from 'rxjs/operators' -import { SelectOptionsItem } from 'src/types/select-options-item.model' +import { NgClass, NgFor, NgIf } from '@angular/common' import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms' +import { RouterLink } from '@angular/router' import { MenuService, ThemeService } from '@app/core' +import { AlertComponent } from '@app/shared/shared-main/common/alert.component' import { HTMLServerConfig } from '@peertube/peertube-models' -import { ConfigService } from '../shared/config.service' -import { PeerTubeTemplateDirective } from '../../../shared/shared-main/common/peertube-template.directive' -import { SelectOptionsComponent } from '../../../shared/shared-forms/select/select-options.component' -import { UserRealQuotaInfoComponent } from '../../shared/user-real-quota-info.component' +import { pairwise } from 'rxjs/operators' +import { SelectOptionsItem } from 'src/types/select-options-item.model' import { MarkdownTextareaComponent } from '../../../shared/shared-forms/markdown-textarea.component' -import { HelpComponent } from '../../../shared/shared-main/buttons/help.component' import { PeertubeCheckboxComponent } from '../../../shared/shared-forms/peertube-checkbox.component' import { SelectCustomValueComponent } from '../../../shared/shared-forms/select/select-custom-value.component' -import { NgFor, NgIf, NgClass } from '@angular/common' -import { RouterLink } from '@angular/router' +import { SelectOptionsComponent } from '../../../shared/shared-forms/select/select-options.component' +import { HelpComponent } from '../../../shared/shared-main/buttons/help.component' +import { PeerTubeTemplateDirective } from '../../../shared/shared-main/common/peertube-template.directive' +import { UserRealQuotaInfoComponent } from '../../shared/user-real-quota-info.component' +import { ConfigService } from '../shared/config.service' @Component({ selector: 'my-edit-basic-configuration', @@ -33,7 +34,8 @@ import { RouterLink } from '@angular/router' NgClass, UserRealQuotaInfoComponent, SelectOptionsComponent, - PeerTubeTemplateDirective + PeerTubeTemplateDirective, + AlertComponent ] }) export class EditBasicConfigurationComponent implements OnInit, OnChanges { diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 2b2c2c7df..03cfa5325 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html @@ -1,8 +1,8 @@

Configuration

-
+ Updating instance configuration from the web interface is disabled by the system administrator. -
+
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 98ca692a7..757069027 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts @@ -27,9 +27,11 @@ import { import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators' import { FormReactive } from '@app/shared/shared-forms/form-reactive' import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service' +import { AlertComponent } from '@app/shared/shared-main/common/alert.component' import { CustomPageService } from '@app/shared/shared-main/custom-page/custom-page.service' import { NgbNav, NgbNavContent, NgbNavItem, NgbNavLink, NgbNavLinkBase, NgbNavOutlet } from '@ng-bootstrap/ng-bootstrap' import { CustomConfig, CustomPage, HTMLServerConfig } from '@peertube/peertube-models' +import merge from 'lodash-es/merge' import omit from 'lodash-es/omit' import { forkJoin } from 'rxjs' import { SelectOptionsItem } from 'src/types/select-options-item.model' @@ -40,7 +42,6 @@ import { EditHomepageComponent } from './edit-homepage.component' import { EditInstanceInformationComponent } from './edit-instance-information.component' import { EditLiveConfigurationComponent } from './edit-live-configuration.component' import { EditVODTranscodingComponent } from './edit-vod-transcoding.component' -import merge from 'lodash-es/merge' type ComponentCustomConfig = CustomConfig & { instanceCustomHomepage: CustomPage @@ -67,7 +68,8 @@ type ComponentCustomConfig = CustomConfig & { EditLiveConfigurationComponent, EditAdvancedConfigurationComponent, NgbNavOutlet, - NgFor + NgFor, + AlertComponent ] }) export class EditCustomConfigComponent extends FormReactive implements OnInit { diff --git a/client/src/app/+admin/follows/following-list/follow-modal.component.html b/client/src/app/+admin/follows/following-list/follow-modal.component.html index 403a97b9c..43c89c3e3 100644 --- a/client/src/app/+admin/follows/following-list/follow-modal.component.html +++ b/client/src/app/+admin/follows/following-list/follow-modal.component.html @@ -26,9 +26,9 @@ -
+ It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers. -
+
-
{{ error }}
+{{ error }}
diff --git a/client/src/app/+admin/overview/users/user-edit/user-update.component.ts b/client/src/app/+admin/overview/users/user-edit/user-update.component.ts index 41348b3d8..fe42b0df2 100644 --- a/client/src/app/+admin/overview/users/user-edit/user-update.component.ts +++ b/client/src/app/+admin/overview/users/user-edit/user-update.component.ts @@ -1,5 +1,6 @@ -import { Subscription } from 'rxjs' +import { NgClass, NgFor, NgIf, NgTemplateOutlet } from '@angular/common' import { Component, OnDestroy, OnInit } from '@angular/core' +import { FormsModule, ReactiveFormsModule } from '@angular/forms' import { ActivatedRoute, Router, RouterLink } from '@angular/router' import { ConfigService } from '@app/+admin/config/shared/config.service' import { AuthService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core' @@ -10,21 +11,21 @@ import { USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators' import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service' -import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@peertube/peertube-models' -import { UserEdit } from './user-edit' -import { BytesPipe } from '../../../../shared/shared-main/common/bytes.pipe' -import { UserPasswordComponent } from './user-password.component' -import { PeertubeCheckboxComponent } from '../../../../shared/shared-forms/peertube-checkbox.component' -import { UserRealQuotaInfoComponent } from '../../../shared/user-real-quota-info.component' -import { SelectCustomValueComponent } from '../../../../shared/shared-forms/select/select-custom-value.component' -import { InputTextComponent } from '../../../../shared/shared-forms/input-text.component' -import { PeerTubeTemplateDirective } from '../../../../shared/shared-main/common/peertube-template.directive' -import { HelpComponent } from '../../../../shared/shared-main/buttons/help.component' -import { FormsModule, ReactiveFormsModule } from '@angular/forms' -import { ActorAvatarEditComponent } from '../../../../shared/shared-actor-image-edit/actor-avatar-edit.component' -import { NgIf, NgTemplateOutlet, NgClass, NgFor } from '@angular/common' -import { UserAdminService } from '@app/shared/shared-users/user-admin.service' +import { AlertComponent } from '@app/shared/shared-main/common/alert.component' import { TwoFactorService } from '@app/shared/shared-users/two-factor.service' +import { UserAdminService } from '@app/shared/shared-users/user-admin.service' +import { UserAdminFlag, UserRole, User as UserType, UserUpdate } from '@peertube/peertube-models' +import { Subscription } from 'rxjs' +import { ActorAvatarEditComponent } from '../../../../shared/shared-actor-image-edit/actor-avatar-edit.component' +import { InputTextComponent } from '../../../../shared/shared-forms/input-text.component' +import { PeertubeCheckboxComponent } from '../../../../shared/shared-forms/peertube-checkbox.component' +import { SelectCustomValueComponent } from '../../../../shared/shared-forms/select/select-custom-value.component' +import { HelpComponent } from '../../../../shared/shared-main/buttons/help.component' +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 { UserEdit } from './user-edit' +import { UserPasswordComponent } from './user-password.component' @Component({ selector: 'my-user-update', @@ -47,7 +48,8 @@ import { TwoFactorService } from '@app/shared/shared-users/two-factor.service' UserRealQuotaInfoComponent, PeertubeCheckboxComponent, UserPasswordComponent, - BytesPipe + BytesPipe, + AlertComponent ] }) export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html index 189002eae..96aca5b5a 100644 --- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html +++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html @@ -1,8 +1,8 @@ -
+ To load your new installed plugins or themes, refresh the page. -
+