-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#931: create alert dialog component (dialog with only a close button)
- Loading branch information
1 parent
3e49de2
commit 30c378b
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
frontend/src/app/shared/dialog/alert-dialog/alert-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<section mat-dialog-title> | ||
<app-dialog-header [dialogTitle]="this.data.dialogTitle"></app-dialog-header> | ||
</section> | ||
|
||
<mat-dialog-content> | ||
@if (data.dialogText) { | ||
<div class="mb-3"> | ||
<span class="dialog-text">{{ this.data.dialogText }}</span> | ||
</div> | ||
} | ||
</mat-dialog-content> | ||
|
||
<mat-dialog-actions class="m-0"> | ||
<button color="primary" [attr.data-testId]="'alertDialog-confirm'" (click)="closeDialog()" mat-flat-button> | ||
Schliessen | ||
</button> | ||
</mat-dialog-actions> |
Empty file.
23 changes: 23 additions & 0 deletions
23
frontend/src/app/shared/dialog/alert-dialog/alert-dialog.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Component, Inject } from '@angular/core'; | ||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; | ||
|
||
export type AlertDialogData = { | ||
dialogTitle: string; | ||
dialogText?: string; | ||
}; | ||
|
||
@Component({ | ||
selector: 'app-alert-dialog', | ||
templateUrl: './alert-dialog.component.html', | ||
styleUrl: './alert-dialog.component.scss', | ||
}) | ||
export class AlertDialogComponent { | ||
constructor( | ||
@Inject(MAT_DIALOG_DATA) public data: AlertDialogData, | ||
private dialogRef: MatDialogRef<AlertDialogComponent>, | ||
) {} | ||
|
||
closeDialog() { | ||
this.dialogRef.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters