diff --git a/frontend/src/app/pages/forms/appeal/appeal.component.html b/frontend/src/app/pages/forms/appeal/appeal.component.html index 15a3b02..4de1666 100644 --- a/frontend/src/app/pages/forms/appeal/appeal.component.html +++ b/frontend/src/app/pages/forms/appeal/appeal.component.html @@ -6,156 +6,161 @@
-
-
-
- @if (currentPageIndex === 0) { - @if (history()?.length === 0) { -
- Discord -

Punishment Appeal

-

You have no punishments to appeal.

-
- } @else { -
- Discord -

Punishment Appeal

-

We aim to respond within 48 hours.

- -
- } - } - - @if (currentPageIndex === 1) { -
-
-

You are logged in as {{ authService.username() }}. If this is the correct account - please continue

-
-

Notice: Submitting an appeal is not an instant process. - We will investigate the punishment you are appealing and respond within 48 hours.

-

Appeals that seem to have been made with - little to no effort will be automatically denied.

-
- -
- } - - @if (currentPageIndex === 2) { -
-
-

Please select the punishment you want to appeal

-
- - Punishment - - @for (punishment of history(); track punishment) { - {{ punishment.type }} - {{ punishment.reason }} - } - - - @if (selectedPunishment() != null) { - + +
+
+
+ @if (currentPageIndex === 0) { + @if (history()?.length === 0) { +
+ Discord +

Punishment Appeal

+

You have no punishments to appeal.

+
+ } @else { +
+ Discord +

Punishment Appeal

+

We aim to respond within 48 hours.

+ +
} -
- } + } -
- @if (currentPageIndex === 3) { + @if (currentPageIndex === 1) {
-

Please enter your email.

-

It does not have to be your minecraft email. You will have to verify - it

- - Email - - @if (form.controls.email.invalid && form.controls.email.touched) { - - @if (form.controls.email.errors?.['required']) { - Email is required - } @else if (form.controls.email.errors?.['email']) { - Please enter a valid email address - } - - } - - @if (emailIsValid()) { -
- - check - You have validated your email previously, and can continue to the next page! - -
- } +

You are logged in as {{ authService.username() }}. If this is the correct + account + please continue

+
+

Notice: Submitting an appeal is not an instant process. + We will investigate the punishment you are appealing and respond within 48 hours.

+

Appeals that seem to have been made with + little to no effort will be automatically denied.

-
} - @if (currentPageIndex === 4) { + @if (currentPageIndex === 2) {
-

Why should your {{ selectedPunishment()?.type }} be reduced or removed?

-

Please take your time writing this, we're more likely to accept an - appeal if effort was put into it.

- - Reason - - @if (form.controls.appeal.invalid && form.controls.appeal.touched) { - - @if (form.controls.appeal.errors?.['required']) { - Reason is required - } @else if (form.controls.appeal.errors?.['minlength']) { - Reason must be at least 10 characters - } - - } - +

Please select the punishment you want to appeal

- + + Punishment + + @for (punishment of history(); track punishment) { + {{ punishment.type }} - {{ punishment.reason }} + } + + + @if (selectedPunishment() != null) { + + }
} -
-
- - @if (totalPages.length > 1) { -
- +
+ @if (currentPageIndex === 3) { +
+
+

Please enter your email.

+

It does not have to be your minecraft email. You will have to verify + it

+ + Email + + @if (form.controls.email.invalid && form.controls.email.touched) { + + @if (form.controls.email.errors?.['required']) { + Email is required + } @else if (form.controls.email.errors?.['email']) { + Please enter a valid email address + } + + } + + @if (emailIsValid()) { +
+ + check + You have validated your email previously, and can continue to the next page! + +
+ } +
+ +
+ } - @for (i of totalPages; track i) { - - } - - + @if (currentPageIndex === 4) { +
+
+

Why should your {{ selectedPunishment()?.type }} be reduced or removed?

+

Please take your time writing this, we're more likely to accept an + appeal if effort was put into it.

+ + Reason + + @if (form.controls.appeal.invalid && form.controls.appeal.touched) { + + @if (form.controls.appeal.errors?.['required']) { + Reason is required + } @else if (form.controls.appeal.errors?.['minlength']) { + Reason must be at least 10 characters + } + + } + +
+ +
+ } +
- } -
-
+ + + @if (totalPages.length > 1) { +
+ + + @for (i of totalPages; track i) { + + } + + +
+ } + + + +
diff --git a/frontend/src/app/pages/forms/appeal/appeal.component.scss b/frontend/src/app/pages/forms/appeal/appeal.component.scss index 0cfbc2d..504d505 100644 --- a/frontend/src/app/pages/forms/appeal/appeal.component.scss +++ b/frontend/src/app/pages/forms/appeal/appeal.component.scss @@ -5,7 +5,7 @@ .appeal-container { display: flex; flex-direction: column; - min-height: 80vh; + height: 100%; } main { diff --git a/frontend/src/app/pages/forms/appeal/appeal.component.ts b/frontend/src/app/pages/forms/appeal/appeal.component.ts index 24ca7a3..8a429b1 100644 --- a/frontend/src/app/pages/forms/appeal/appeal.component.ts +++ b/frontend/src/app/pages/forms/appeal/appeal.component.ts @@ -1,14 +1,4 @@ -import { - AfterViewInit, - Component, - computed, - ElementRef, - inject, - OnDestroy, - OnInit, - Renderer2, - signal -} from '@angular/core'; +import {Component, computed, inject, OnDestroy, OnInit, signal} from '@angular/core'; import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms'; import {AppealsService, EmailEntry, HistoryService, MailService, MinecraftAppeal, PunishmentHistory} from '@api'; import {HeaderComponent} from '@header/header.component'; @@ -24,6 +14,7 @@ import {HistoryFormatService} from '@pages/reference/bans/history-format.service import {MatDialog} from '@angular/material/dialog'; import {VerifyMailDialogComponent} from '@pages/forms/verify-mail-dialog/verify-mail-dialog.component'; import {Router} from '@angular/router'; +import {FullSizeComponent} from '@shared-components/full-size/full-size.component'; @Component({ selector: 'app-appeal', @@ -37,11 +28,12 @@ import {Router} from '@angular/router'; MatSelectModule, MatInputModule, ReactiveFormsModule, + FullSizeComponent, ], templateUrl: './appeal.component.html', styleUrl: './appeal.component.scss' }) -export class AppealComponent implements OnInit, OnDestroy, AfterViewInit { +export class AppealComponent implements OnInit, OnDestroy { private mailService = inject(MailService); private historyFormatService = inject(HistoryFormatService); @@ -61,10 +53,7 @@ export class AppealComponent implements OnInit, OnDestroy, AfterViewInit { protected emailIsValid = signal(false); protected dialog = inject(MatDialog); - constructor( - private elementRef: ElementRef, - private renderer: Renderer2 - ) { + constructor() { this.form = new FormGroup({ email: new FormControl('', {nonNullable: true, validators: [Validators.required, Validators.email]}), appeal: new FormControl('', {nonNullable: true, validators: [Validators.required, Validators.minLength(10)]}) @@ -97,16 +86,6 @@ export class AppealComponent implements OnInit, OnDestroy, AfterViewInit { }) } - ngAfterViewInit() { - this.setupResizeObserver(); - this.updateContainerHeight(); - - this.boundHandleResize = this.handleResize.bind(this); - window.addEventListener('resize', this.boundHandleResize); - - setTimeout(() => this.updateContainerHeight(), 0); - } - ngOnDestroy() { if (this.resizeObserver) { this.resizeObserver.disconnect(); @@ -118,41 +97,6 @@ export class AppealComponent implements OnInit, OnDestroy, AfterViewInit { } } - private handleResize() { - this.updateContainerHeight(); - } - - private setupResizeObserver() { - this.resizeObserver = new ResizeObserver(() => { - this.updateContainerHeight(); - }); - - const headerElement = document.querySelector('app-header'); - if (headerElement) { - this.resizeObserver.observe(headerElement); - } - - const footerElement = document.querySelector('footer'); - if (footerElement) { - this.resizeObserver.observe(footerElement); - } - } - - private updateContainerHeight() { - const headerElement = document.querySelector('app-header'); - const footerElement = document.querySelector('footer'); - - const container = this.elementRef.nativeElement.querySelector('.appeal-container'); - - if (headerElement && footerElement && container) { - const headerHeight = headerElement.getBoundingClientRect().height; - const footerHeight = footerElement.getBoundingClientRect().height; - - const calculatedHeight = `calc(100vh - ${headerHeight}px - ${footerHeight}px)`; - this.renderer.setStyle(container, 'min-height', calculatedHeight); - } - } - public onSubmit() { if (this.form === undefined) { console.error('Form is undefined');