Skip to content

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

Fix UI/UX registration accept/reject

Chocobozzza34262a3a893
diff --git a/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.html b/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.html
index 3d0ee2de75..f5253917f9 100644
--- a/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.html
+++ b/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.html
@@ -1,3 +1,15 @@
+<ng-template #unverifiedEmailsMessage>
+ @if (hasMultipleRegistrations()) {
+ <my-alert i18n type="warning">
+ At least one registration email has not been verified. Email delivery has been disabled by default.
+ </my-alert>
+ } @else {
+ <my-alert i18n type="warning">
+ The registration email has not been verified. Email delivery has been disabled by default.
+ </my-alert>
+ }
+</ng-template>
+
<ng-template #modal>
<div class="modal-header">
<h4 class="modal-title">
@@ -23,11 +35,9 @@
@if (isEmailEnabled()) {
@if (hasUnverifiedEmails()) {
- <my-alert i18n type="warning">
- At least one registration email has not been verified. Email delivery has been disabled by default.
- </my-alert>
+ <ng-container *ngTemplateOutlet="unverifiedEmailsMessage"></ng-container>
} @else {
- <p i18n [ngClass]="{ 'text-decoration-line-through': isPreventEmailDeliveryChecked() }">
+ <p i18n>
@if (hasMultipleRegistrations()) {
An email will be sent to each user explaining its account has been created with the moderation response you'll write below.
} @else {
@@ -42,17 +52,21 @@
</my-alert>
}
} @else if (isReject()) {
- <p i18n [ngClass]="{ 'text-decoration-line-through': isPreventEmailDeliveryChecked() }">
- @if (hasMultipleRegistrations()) {
- An email will be sent to each user explaining its registration request has been <strong>rejected</strong> with the moderation response you'll write
- below.
+ @if (isEmailEnabled()) {
+ @if (hasUnverifiedEmails()) {
+ <ng-container *ngTemplateOutlet="unverifiedEmailsMessage"></ng-container>
} @else {
- An email will be sent to <em>{{ registration.email }}</em> explaining its registration request has been <strong>rejected</strong> with the
- moderation response you'll write below.
+ <p i18n>
+ @if (hasMultipleRegistrations()) {
+ An email will be sent to each user explaining its registration request has been <strong>rejected</strong> with the moderation response you'll write
+ below.
+ } @else {
+ An email will be sent to <em>{{ registration.email }}</em> explaining its registration request has been <strong>rejected</strong> with the
+ moderation response you'll write below.
+ }
+ </p>
}
- </p>
-
- @if (!isEmailEnabled()) {
+ } @else {
<my-alert type="warning" i18n>
Emails are not enabled on this instance so PeerTube won't be able to send an email explaining registration requests have been rejected.
</my-alert>
diff --git a/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts b/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts
index 47195dfdf2..e50072d549 100644
--- a/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts
+++ b/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts
@@ -58,14 +58,12 @@ export class ProcessRegistrationModalComponent extends FormReactive implements O
if (this.shouldDisableEmailDelivery()) {
this.form.get('preventEmailDelivery').disable()
+ this.form.patchValue({ preventEmailDelivery: true })
} else {
this.form.get('preventEmailDelivery').enable()
+ this.form.patchValue({ preventEmailDelivery: false })
}
- this.form.patchValue({
- preventEmailDelivery: this.shouldDisableEmailDelivery()
- })
-
this.openedModal = this.modalService.open(this.modal(), { centered: true })
}
@@ -112,10 +110,6 @@ export class ProcessRegistrationModalComponent extends FormReactive implements O
return this.server.getHTMLConfig().email.enabled
}
- isPreventEmailDeliveryChecked () {
- return this.form.value.preventEmailDelivery
- }
-
hasUnverifiedEmails () {
return this.registrations.some(registration => registration.emailVerified !== true)
}
diff --git a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts
index 42c64461f0..f73acc0414 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts
+++ b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts
@@ -349,19 +349,11 @@ export class AbuseListTableComponent implements OnInit, OnDestroy {
return [
{
- label: () => $localize`Internal actions`,
+ label: () => $localize`Accept/Reject`,
isHeader: true,
enableBulk: true
},
- messagesAction,
-
- {
- label: () => $localize`Set internal note`,
- handler: abuses => this.openModerationCommentModal(abuses),
- isDisplayed: () => this.isAdminView(),
- enableBulk: true
- },
{
label: () => $localize`Mark as accepted`,
handler: abuses => this.updateAbusesState(abuses, AbuseState.ACCEPTED),
@@ -374,6 +366,21 @@ export class AbuseListTableComponent implements OnInit, OnDestroy {
isDisplayed: abuse => this.isAdminView() && !this.isAbuseRejected(abuse),
enableBulk: true
},
+
+ {
+ label: () => $localize`Internal actions`,
+ isHeader: true,
+ enableBulk: true
+ },
+
+ messagesAction,
+
+ {
+ label: () => $localize`Set internal note`,
+ handler: abuses => this.openModerationCommentModal(abuses),
+ isDisplayed: () => this.isAdminView(),
+ enableBulk: true
+ },
{
label: abuses => formatICU($localize`{count, plural, =1 {Delete report} other {Delete reports}}`, { count: abuses.length }),
handler: abuses => this.removeAbuses(abuses),