diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/forms/req-form-field/req-form-field.component.html b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/forms/req-form-field/req-form-field.component.html deleted file mode 100644 index e69de29..0000000 diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/forms/req-form-field/req-form-field.component.scss b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/forms/req-form-field/req-form-field.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/forms/req-form-field/req-form-field.component.spec.ts b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/forms/req-form-field/req-form-field.component.spec.ts deleted file mode 100644 index 1b1811e..0000000 --- a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/forms/req-form-field/req-form-field.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ReqFormFieldComponent } from './req-form-field.component'; - -describe('ReqFormFieldComponent', () => { - let component: ReqFormFieldComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ReqFormFieldComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ReqFormFieldComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/forms/req-form-field/req-form-field.component.ts b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/forms/req-form-field/req-form-field.component.ts deleted file mode 100644 index c42daef..0000000 --- a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/forms/req-form-field/req-form-field.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Component, signal } from '@angular/core'; -import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { merge } from 'rxjs'; -import { MatIconModule } from '@angular/material/icon'; -import { MatButtonModule } from '@angular/material/button'; -import { CommonModule } from '@angular/common'; - -@Component({ - selector: 'app-req-form-field', - standalone: true, - imports: [MatFormFieldModule, MatInputModule, FormsModule, ReactiveFormsModule, MatIconModule, MatButtonModule, CommonModule], - templateUrl: './req-form-field.component.html', - styleUrl: './req-form-field.component.scss' -}) -export class ReqFormFieldComponent { - readonly formControl = new FormControl('', [Validators.required, Validators.email]); - - errorMessage = signal(''); - - public readonly formFieldBSClass: string = "col d-flex justify-content-center mx-1 my-2" - public readonly buttonBSClass: string = "d-flex justify-content-center mx-1 my-2" - - constructor() { - merge(this.formControl.statusChanges, this.formControl.valueChanges) - .pipe(takeUntilDestroyed()) - .subscribe(() => this.updateErrorMessage()); - } - - updateErrorMessage() { - if (this.formControl.hasError('required')) { - this.errorMessage.set('You must enter a value'); - } else if (this.formControl.hasError('email')) { - this.errorMessage.set('Not a valid email'); - } else { - this.errorMessage.set(''); - } - } -}