diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 66a7231f22888c56b1bc54d124d83def62c96cba..5c912764c5e680f134109936abe3681c7d0de46d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -96,6 +96,7 @@ import { JetTrajectoryChartComponent } from "./components/jet-trajectory-chart/j import { SessionPropertiesComponent } from "./components/session-properties/session-properties.component"; import { VerificateurResultsComponent } from "./components/verificateur-results/verificateur-results.component"; +import { DialogConfirmComponent } from "./components/dialog-confirm/dialog-confirm.component"; import { DialogConfirmEmptySessionComponent } from "./components/dialog-confirm-empty-session/dialog-confirm-empty-session.component"; import { DialogConfirmCloseCalcComponent } from "./components/dialog-confirm-close-calc/dialog-confirm-close-calc.component"; import { DialogEditPabComponent } from "./components/dialog-edit-pab/dialog-edit-pab.component"; @@ -209,6 +210,7 @@ const appRoutes: Routes = [ CalculatorResultsComponent, DialogConfirmCloseCalcComponent, DialogConfirmEmptySessionComponent, + DialogConfirmComponent, DialogEditPabComponent, DialogEditParamComputedComponent, DialogEditParamValuesComponent, diff --git a/src/app/components/dialog-confirm/dialog-confirm.component.html b/src/app/components/dialog-confirm/dialog-confirm.component.html new file mode 100644 index 0000000000000000000000000000000000000000..1de1a1bae3d8e2d2cee34ed52dd36424283dc39f --- /dev/null +++ b/src/app/components/dialog-confirm/dialog-confirm.component.html @@ -0,0 +1,12 @@ +<h1 mat-dialog-title [innerHTML]="uitextTitle"></h1> +<div mat-dialog-content> + <p [innerHTML]="uitextBody"></p> +</div> +<div mat-dialog-actions [attr.align]="'end'"> + <button id="cancel" mat-raised-button color="primary" [mat-dialog-close]="false" cdkFocusInitial> + {{ uitextNo }} + </button> + <button id="confirm" mat-raised-button color="warn" [mat-dialog-close]="true"> + {{ uitextYes }} + </button> +</div> diff --git a/src/app/components/dialog-confirm/dialog-confirm.component.ts b/src/app/components/dialog-confirm/dialog-confirm.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..f8cefaa2526ec20077f992157001690ec99e5c16 --- /dev/null +++ b/src/app/components/dialog-confirm/dialog-confirm.component.ts @@ -0,0 +1,38 @@ +import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; +import { Inject, Component } from "@angular/core"; +import { I18nService } from "../../services/internationalisation.service"; + +@Component({ + selector: "dialog-confirm", + templateUrl: "dialog-confirm.component.html", +}) +export class DialogConfirmComponent { + + private _title: string; + private _text: string; + + constructor( + public dialogRef: MatDialogRef<DialogConfirmComponent>, + private intlService: I18nService, + @Inject(MAT_DIALOG_DATA) public data: any + ) { + this._title = data.title; + this._text = data.text; + } + + public get uitextYes() { + return this.intlService.localizeText("INFO_OPTION_YES"); + } + + public get uitextNo() { + return this.intlService.localizeText("INFO_OPTION_NO"); + } + + public get uitextTitle() { + return this._title; + } + + public get uitextBody() { + return this._text; + } +}