Skip to content
Snippets Groups Projects
Commit bc35330b authored by mathias.chouet's avatar mathias.chouet
Browse files

Fix #166

parent 39019b9d
No related branches found
No related tags found
1 merge request!40Resolve "Amélioration du système de paramètres liés"
<h1 mat-dialog-title [innerHTML]="uitextCloseCalcTitle"></h1>
<div mat-dialog-content>
<p [innerHTML]="uitextCloseCalcBody"></p>
<div *ngIf="dependingNubs.length">
{{ uitextDependingModules }}
<mat-list role="list">
<mat-list-item role="listitem" *ngFor="let dn of dependingNubs">
{{ dn }}
</mat-list-item>
</mat-list>
</div>
</div>
<p [innerHTML]="uitextCloseCalcBody"></p>
<div mat-dialog-actions>
<button mat-raised-button color="primary" [mat-dialog-close]="false" cdkFocusInitial>
{{ uitextNo }}
......
.mat-list-base .mat-list-item {
height: 24px;
}
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material";
import { Inject, Component } from "@angular/core";
import { FormulaireService } from "../../services/formulaire/formulaire.service";
import { I18nService } from "../../services/internationalisation/internationalisation.service";
import { Session } from "jalhyd";
@Component({
selector: "dialog-confirm-close-calc",
templateUrl: "dialog-confirm-close-calc.component.html",
styleUrls: [
"dialog-confirm-close-calc.component.scss"
]
})
export class DialogConfirmCloseCalcComponent {
private _dependingNubs: any[] = [];
constructor(
public dialogRef: MatDialogRef<DialogConfirmCloseCalcComponent>,
private intlService: I18nService,
private formService: FormulaireService,
@Inject(MAT_DIALOG_DATA) public data: any
) { }
) {
this._dependingNubs = Session.getInstance().getDependingNubs(data.uid).map((n) => {
return this.formService.getFormulaireFromNubId(n.uid).calculatorName;
});
}
public get uitextYes() {
return this.intlService.localizeText("INFO_OPTION_YES");
......@@ -30,4 +42,12 @@ export class DialogConfirmCloseCalcComponent {
return this.intlService.localizeText("INFO_CLOSE_DIALOGUE_TEXT");
}
public get uitextDependingModules() {
return this.intlService.localizeText("INFO_CLOSE_DIALOGUE_DEPENDING_MODULES");
}
public get dependingNubs() {
return this._dependingNubs;
}
}
......@@ -386,7 +386,12 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
public closeCalculator() {
const dialogRef = this.confirmCloseCalcDialog.open(
DialogConfirmCloseCalcComponent,
{ disableClose: true }
{
data: {
uid: this._formulaire.currentNub.uid
},
disableClose: true
}
);
dialogRef.afterClosed().subscribe(result => {
if (result) {
......
......@@ -44,6 +44,7 @@
"INFO_CLOISONS_TITRE_COURT": "Cross walls",
"INFO_CLOSE_DIALOGUE_TEXT": "Warning ! Parameters and results will be lost. Really close?",
"INFO_CLOSE_DIALOGUE_TITRE": "Please confirm",
"INFO_CLOSE_DIALOGUE_DEPENDING_MODULES": "The following modules depend on the one you are closing:",
"INFO_CONDUITEDISTRIBUTRICE_TITRE": "Distributor pipe",
"INFO_CONDUITEDISTRIBUTRICE_TITRE_COURT": "D. pipe",
"INFO_COURBEREMOUS_TITRE": "Backwater curves",
......
......@@ -44,6 +44,7 @@
"INFO_CLOISONS_TITRE_COURT": "Cloisons",
"INFO_CLOSE_DIALOGUE_TEXT": "Attention&nbsp;! Les paramètres et résultats du module de calcul seront perdus. Vraiment fermer&nbsp;?",
"INFO_CLOSE_DIALOGUE_TITRE": "Confirmer la fermeture",
"INFO_CLOSE_DIALOGUE_DEPENDING_MODULES": "Les modules suivants dépendent de celui que vous êtes en train de fermer :",
"INFO_CONDUITEDISTRIBUTRICE_TITRE": "Conduite distributrice",
"INFO_CONDUITEDISTRIBUTRICE_TITRE_COURT": "Conduite distri.",
"INFO_COURBEREMOUS_TITRE": "Courbes de remous",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment