From 7e573616d95d863ff706983d0c2766b340ff8054 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 8 Mar 2024 11:22:23 +0100 Subject: [PATCH] Clearer public email if email is not verified --- .../edit-basic-configuration.component.html | 4 ++-- .../registration-list.component.html | 2 +- .../users/user-list/user-list.component.html | 2 +- .../+admin/shared/user-email-info.component.html | 16 ++++++++-------- .../+admin/shared/user-email-info.component.ts | 4 ++-- .../my-account-change-email.component.ts | 13 ++++++------- .../my-account-email-preferences.component.html | 8 +++++++- .../my-account-settings.component.html | 2 +- 8 files changed, 28 insertions(+), 23 deletions(-) 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 d63f13c33..3de40666f 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 @@ -687,9 +687,9 @@
-

Indicates the Twitter/X account for the website or platform where the content was published.

+

Indicates the Twitter/X account for the website or platform where the content was published.

-

This is just an extra information injected in PeerTube HTML that is required by Twitter/X. If you don't have a Twitter/X account, just leave the default value.

+

This is just an extra information injected in PeerTube HTML that is required by Twitter/X. If you don't have a Twitter/X account, just leave the default value.

- + diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.html b/client/src/app/+admin/overview/users/user-list/user-list.component.html index 2954a681d..d07418831 100644 --- a/client/src/app/+admin/overview/users/user-list/user-list.component.html +++ b/client/src/app/+admin/overview/users/user-list/user-list.component.html @@ -114,7 +114,7 @@ - + diff --git a/client/src/app/+admin/shared/user-email-info.component.html b/client/src/app/+admin/shared/user-email-info.component.html index 244240619..92a1c9a27 100644 --- a/client/src/app/+admin/shared/user-email-info.component.html +++ b/client/src/app/+admin/shared/user-email-info.component.html @@ -1,13 +1,13 @@ - + @if (showEmailVerifyInformation) { + @if (entry.emailVerified === true) { + ✓ {{ entry.email }} + } @else { + ? {{ entry.email }} + } + } @else { {{ entry.email }} - - - - ? {{ entry.email }} - - ✓ {{ entry.email }} - + } diff --git a/client/src/app/+admin/shared/user-email-info.component.ts b/client/src/app/+admin/shared/user-email-info.component.ts index 87df3f684..ec31cab2e 100644 --- a/client/src/app/+admin/shared/user-email-info.component.ts +++ b/client/src/app/+admin/shared/user-email-info.component.ts @@ -1,4 +1,4 @@ -import { Component, Input } from '@angular/core' +import { Component, Input, booleanAttribute } from '@angular/core' import { User, UserRegistration } from '@peertube/peertube-models' import { NgIf } from '@angular/common' @@ -11,7 +11,7 @@ import { NgIf } from '@angular/common' }) export class UserEmailInfoComponent { @Input() entry: User | UserRegistration - @Input() requiresEmailVerification: boolean + @Input({ transform: booleanAttribute }) showEmailVerifyInformation: boolean getTitle () { if (this.entry.emailVerified) { diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts index 38aec995a..c33de1496 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts @@ -1,14 +1,14 @@ -import { forkJoin } from 'rxjs' -import { tap } from 'rxjs/operators' +import { NgClass, NgIf } from '@angular/common' import { Component, OnInit } from '@angular/core' -import { AuthService, Notifier, ServerService, UserService } from '@app/core' +import { FormsModule, ReactiveFormsModule } from '@angular/forms' +import { AuthService, ServerService, UserService } from '@app/core' import { USER_EMAIL_VALIDATOR, USER_PASSWORD_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 { HttpStatusCode, User } from '@peertube/peertube-models' +import { forkJoin } from 'rxjs' +import { tap } from 'rxjs/operators' import { InputTextComponent } from '../../../shared/shared-forms/input-text.component' -import { FormsModule, ReactiveFormsModule } from '@angular/forms' -import { NgIf, NgClass } from '@angular/common' @Component({ selector: 'my-account-change-email', @@ -26,8 +26,7 @@ export class MyAccountChangeEmailComponent extends FormReactive implements OnIni protected formReactiveService: FormReactiveService, private authService: AuthService, private userService: UserService, - private serverService: ServerService, - private notifier: Notifier + private serverService: ServerService ) { super() } diff --git a/client/src/app/+my-account/my-account-settings/my-account-email-preferences/my-account-email-preferences.component.html b/client/src/app/+my-account/my-account-settings/my-account-email-preferences/my-account-email-preferences.component.html index 8a035366e..b54a907be 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-email-preferences/my-account-email-preferences.component.html +++ b/client/src/app/+my-account/my-account-settings/my-account-email-preferences/my-account-email-preferences.component.html @@ -6,7 +6,13 @@ i18n-labelText labelText="Allow email to be publicly displayed" > - Necessary to claim podcast RSS feeds. +

+ @if (user.emailVerified) { + Necessary to claim podcast RSS feeds. + } @else { + ⚠️ Your email cannot be used in podcast RSS feeds because it has not yet been verified. + } +

diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html index d7534a7ce..f192e56d7 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html @@ -7,7 +7,7 @@