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

Generate PAB from Cloisons : minimum 2 falls are required

parent 2b504577
No related branches found
No related tags found
1 merge request!49Resolve "Ajout du module de calcul d'une passe à bassins"
......@@ -25,12 +25,12 @@
</mat-error>
<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">
</mat-form-field>
<mat-error *ngIf="inputNbBassins.invalid && (inputNbBassins.dirty || inputNbBassins.touched)">
<div *ngIf="inputNbBassins.errors.required || inputNbBassins.errors.pattern">
{{ uitextMustBePositive }}
{{ uitextMustBeAtLeastTwo }}
</div>
</mat-error>
......
......@@ -4,6 +4,8 @@ import { Inject, Component } from "@angular/core";
import { I18nService } from "../../services/internationalisation/internationalisation.service";
import { FormBuilder } from "@angular/forms";
import { sprintf } from "sprintf-js";
@Component({
selector: "dialog-generate-pab",
templateUrl: "dialog-generate-pab.component.html",
......@@ -67,6 +69,10 @@ export class DialogGeneratePABComponent {
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() {
return this.intlService.localizeText("INFO_CALCULATOR_RESULTS_GENERATE_PAB");
}
......
......@@ -17,6 +17,7 @@
"ERROR_MINMAXSTEP_STEP": "Value is not in %s",
"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_AT_LEAST": "Value must be >= %s",
"ERROR_PARAM_MUST_BE_POSITIVE": "Please type a positive numeric value",
"ERROR_PARAM_NULL": "Parameter value must not be NULL",
"ERROR_PARAMDEF_CALC_UNDEFINED": "calculability of '%symbol%' parameter is undefined",
......
......@@ -17,6 +17,7 @@
"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_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_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",
......
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