Commit 7bdfc5e4 authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

Generate PAB from Cloisons : minimum 2 falls are required

Showing with 10 additions and 2 deletions
+10 -2
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
</mat-error> </mat-error>
<mat-form-field> <mat-form-field>
<input matInput required [placeholder]="uitextNBBassins" pattern="^[1-9][0-9]*$" <input matInput required [placeholder]="uitextNBBassins" pattern="^([2-9]|[1-9][0-9]+)$"
[(ngModel)]="nbBassins" name="nbBassins" #inputNbBassins="ngModel" id="generatePabNbBassins"> [(ngModel)]="nbBassins" name="nbBassins" #inputNbBassins="ngModel" id="generatePabNbBassins">
</mat-form-field> </mat-form-field>
<mat-error *ngIf="inputNbBassins.invalid && (inputNbBassins.dirty || inputNbBassins.touched)"> <mat-error *ngIf="inputNbBassins.invalid && (inputNbBassins.dirty || inputNbBassins.touched)">
<div *ngIf="inputNbBassins.errors.required || inputNbBassins.errors.pattern"> <div *ngIf="inputNbBassins.errors.required || inputNbBassins.errors.pattern">
{{ uitextMustBePositive }} {{ uitextMustBeAtLeastTwo }}
</div> </div>
</mat-error> </mat-error>
......
...@@ -4,6 +4,8 @@ import { Inject, Component } from "@angular/core"; ...@@ -4,6 +4,8 @@ import { Inject, Component } from "@angular/core";
import { I18nService } from "../../services/internationalisation/internationalisation.service"; import { I18nService } from "../../services/internationalisation/internationalisation.service";
import { FormBuilder } from "@angular/forms"; import { FormBuilder } from "@angular/forms";
import { sprintf } from "sprintf-js";
@Component({ @Component({
selector: "dialog-generate-pab", selector: "dialog-generate-pab",
templateUrl: "dialog-generate-pab.component.html", templateUrl: "dialog-generate-pab.component.html",
...@@ -67,6 +69,10 @@ export class DialogGeneratePABComponent { ...@@ -67,6 +69,10 @@ export class DialogGeneratePABComponent {
return this.intlService.localizeText("ERROR_PARAM_MUST_BE_POSITIVE"); return this.intlService.localizeText("ERROR_PARAM_MUST_BE_POSITIVE");
} }
public get uitextMustBeAtLeastTwo() {
return sprintf(this.intlService.localizeText("ERROR_PARAM_MUST_BE_AT_LEAST"), 2);
}
public get uitextGeneratePAB() { public get uitextGeneratePAB() {
return this.intlService.localizeText("INFO_CALCULATOR_RESULTS_GENERATE_PAB"); return this.intlService.localizeText("INFO_CALCULATOR_RESULTS_GENERATE_PAB");
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"ERROR_MINMAXSTEP_STEP": "Value is not in %s", "ERROR_MINMAXSTEP_STEP": "Value is not in %s",
"ERROR_NEWTON_DERIVEE_NULLE": "Null function derivative in Newton computation", "ERROR_NEWTON_DERIVEE_NULLE": "Null function derivative in Newton computation",
"ERROR_PARAM_MUST_BE_A_NUMBER": "Please type a numeric value", "ERROR_PARAM_MUST_BE_A_NUMBER": "Please type a numeric value",
"ERROR_PARAM_MUST_BE_AT_LEAST": "Value must be >= %s",
"ERROR_PARAM_MUST_BE_POSITIVE": "Please type a positive numeric value", "ERROR_PARAM_MUST_BE_POSITIVE": "Please type a positive numeric value",
"ERROR_PARAM_NULL": "Parameter value must not be NULL", "ERROR_PARAM_NULL": "Parameter value must not be NULL",
"ERROR_PARAMDEF_CALC_UNDEFINED": "calculability of '%symbol%' parameter is undefined", "ERROR_PARAMDEF_CALC_UNDEFINED": "calculability of '%symbol%' parameter is undefined",
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"ERROR_MINMAXSTEP_STEP": "La valeur n'est pas dans %s", "ERROR_MINMAXSTEP_STEP": "La valeur n'est pas dans %s",
"ERROR_NEWTON_DERIVEE_NULLE": "Dérivée nulle dans un calcul par la méthode de Newton", "ERROR_NEWTON_DERIVEE_NULLE": "Dérivée nulle dans un calcul par la méthode de Newton",
"ERROR_PARAM_MUST_BE_A_NUMBER": "Veuillez entrer une valeur numérique", "ERROR_PARAM_MUST_BE_A_NUMBER": "Veuillez entrer une valeur numérique",
"ERROR_PARAM_MUST_BE_AT_LEAST": "La valeur doit être >= %s",
"ERROR_PARAM_MUST_BE_POSITIVE": "Veuillez entrer une valeur numérique positive", "ERROR_PARAM_MUST_BE_POSITIVE": "Veuillez entrer une valeur numérique positive",
"ERROR_PARAM_NULL": "La valeur du paramètre ne peut pas être NULL", "ERROR_PARAM_NULL": "La valeur du paramètre ne peut pas être NULL",
"ERROR_PARAMDEF_CALC_UNDEFINED": "La calculabilité du paramètre %symbol% n'est pas définie", "ERROR_PARAMDEF_CALC_UNDEFINED": "La calculabilité du paramètre %symbol% n'est pas définie",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment