diff --git a/src/components/delete-modal/delete-modal.component.html b/src/components/delete-modal/delete-modal.component.html
index 2d87fad..1942fd6 100644
--- a/src/components/delete-modal/delete-modal.component.html
+++ b/src/components/delete-modal/delete-modal.component.html
@@ -1,25 +1,25 @@
-
Are you sure you want to delete this show?
-
This cannot be reversed
-
-
-
-
+
Are you sure you want to delete this show?
+
This cannot be reversed
+
diff --git a/src/components/delete-modal/delete-modal.component.spec.ts b/src/components/delete-modal/delete-modal.component.spec.ts
index ee8a25e..7c29c0f 100644
--- a/src/components/delete-modal/delete-modal.component.spec.ts
+++ b/src/components/delete-modal/delete-modal.component.spec.ts
@@ -1,23 +1,23 @@
-import {ComponentFixture, TestBed} from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
-import {DeleteModalComponent} from './delete-modal.component';
+import { DeleteModalComponent } from './delete-modal.component';
describe('DeleteModalComponent', () => {
- let component: DeleteModalComponent;
- let fixture: ComponentFixture
;
+ let component: DeleteModalComponent;
+ let fixture: ComponentFixture;
- beforeEach(async () => {
- await TestBed.configureTestingModule({
- imports: [DeleteModalComponent]
- })
- .compileComponents();
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ imports: [DeleteModalComponent]
+ })
+ .compileComponents();
- fixture = TestBed.createComponent(DeleteModalComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
+ fixture = TestBed.createComponent(DeleteModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
- it('should create', () => {
- expect(component).toBeTruthy();
- });
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
});
diff --git a/src/components/delete-modal/delete-modal.component.ts b/src/components/delete-modal/delete-modal.component.ts
index 94a76a5..6031af5 100644
--- a/src/components/delete-modal/delete-modal.component.ts
+++ b/src/components/delete-modal/delete-modal.component.ts
@@ -1,46 +1,52 @@
import {Component, inject} from '@angular/core';
import {NgbActiveModal, NgbCollapse} from '@ng-bootstrap/ng-bootstrap';
-import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms';
+import {
+ FormControl,
+ FormGroup,
+ FormsModule,
+ ReactiveFormsModule,
+ Validators
+} from '@angular/forms';
@Component({
- selector: 'app-delete-modal',
- imports: [
- NgbCollapse,
- FormsModule,
- ReactiveFormsModule
- ],
- templateUrl: './delete-modal.component.html',
- styleUrl: './delete-modal.component.css'
+ selector: 'app-delete-modal',
+ imports: [
+ NgbCollapse,
+ FormsModule,
+ ReactiveFormsModule
+ ],
+ templateUrl: './delete-modal.component.html',
+ styleUrl: './delete-modal.component.css'
})
export class DeleteModalComponent {
- protected activeModal: NgbActiveModal = inject(NgbActiveModal)
- showName: string = ""
- formHidden: boolean = true;
- buttonDisabled: boolean = false;
- confirmationForm: FormGroup
+ protected activeModal: NgbActiveModal = inject(NgbActiveModal)
+ showName: string = ""
+ formHidden: boolean = true;
+ buttonDisabled: boolean = false;
+ confirmationForm: FormGroup
- constructor() {
- this.confirmationForm = new FormGroup({
- name: new FormControl("", Validators.required)
- })
+ constructor() {
+ this.confirmationForm = new FormGroup({
+ name: new FormControl("",Validators.required)
+ })
+ }
+
+
+ deletePressed() {
+ const regex = new RegExp(this.showName)
+ const control = new FormControl("", [Validators.required, Validators.pattern(regex)])
+ this.confirmationForm.setControl("name", control)
+ if (this.formHidden) {
+ this.formHidden = false;
+ this.buttonDisabled = true;
+ } else {
+ this.formSubmitted()
}
+ }
-
- deletePressed() {
- if (this.formHidden) {
- const regex = new RegExp(this.showName)
- const control = new FormControl("", [Validators.required, Validators.pattern(regex)])
- this.confirmationForm.setControl("name", control)
- this.formHidden = false;
- this.buttonDisabled = true;
- } else {
- this.formSubmitted()
- }
- }
-
- formSubmitted() {
- if (this.confirmationForm.valid) {
- this.activeModal.close(true)
- }
+ formSubmitted() {
+ if (this.confirmationForm.valid) {
+ this.activeModal.close(true)
}
+ }
}