Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
FE-#93: Add delete confirmation dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Drumber committed May 17, 2024
1 parent 5a62143 commit 1ea3153
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ CorsConfigurationSource corsConfigurationSource() {
configuration.setAllowCredentials(true);
configuration.setAllowedOriginPatterns(domains);
configuration.setAllowedMethods(List.of(
HttpMethod.GET.name(), HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name()));
HttpMethod.GET.name(),
HttpMethod.PUT.name(),
HttpMethod.POST.name(),
HttpMethod.PATCH.name(),
HttpMethod.DELETE.name()
));

UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration.applyPermitDefaultValues());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<h2 mat-dialog-title>Ausgabe löschen</h2>

<mat-dialog-content>
Möchtest du die Ausgabe wirklich löschen?
</mat-dialog-content>

<mat-dialog-actions>
<button mat-button mat-dialog-close>Abbrechen</button>
<button mat-button (click)="confirmDelete()">Löschen</button>
</mat-dialog-actions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { DeleteEntryConfirmationDialogComponent } from './delete-entry-confirmation-dialog.component';

describe('DeleteEntryConfirmationDialogComponent', () => {
let component: DeleteEntryConfirmationDialogComponent;
let fixture: ComponentFixture<DeleteEntryConfirmationDialogComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DeleteEntryConfirmationDialogComponent]
})
.compileComponents();

fixture = TestBed.createComponent(DeleteEntryConfirmationDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Component } from '@angular/core';
import {MatDialogRef} from "@angular/material/dialog";

@Component({
selector: 'app-delete-entry-confirmation-dialog',
templateUrl: './delete-entry-confirmation-dialog.component.html',
styleUrl: './delete-entry-confirmation-dialog.component.scss'
})
export class DeleteEntryConfirmationDialogComponent {

constructor(private dialogRef: MatDialogRef<DeleteEntryConfirmationDialogComponent>) {
}

confirmDelete() {
this.dialogRef.close(true);
}

}

0 comments on commit 1ea3153

Please sign in to comment.