From 8ca9658135455be1613d0d72cb6b0a4aa252b341 Mon Sep 17 00:00:00 2001 From: "mathias.chouet" <mathias.chouet@irstea.fr> Date: Tue, 4 Jun 2019 09:23:14 +0200 Subject: [PATCH] =?UTF-8?q?Les=20"step"=20n=C3=A9gatifs=20sont=20interdits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialog-edit-param-values.component.html | 4 ++-- .../dialog-edit-param-values.component.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html index b89bdf8b4..ebc57a529 100644 --- a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html +++ b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html @@ -51,10 +51,10 @@ <mat-form-field> <input matInput class="form-control" type="number" inputmode="numeric" name="step-value" step="0.01" [placeholder]="uitextPasVariation" [(ngModel)]="stepValue" #step="ngModel" name="step" - required pattern="^-?([0-9]*\.)?([0-9]+[Ee]-?)?[0-9]+$"> + required pattern="^([0-9]*\.)?([0-9]+[Ee]-?)?[0-9]+$"> <mat-error *ngIf="step.errors"> - {{ uitextMustBeANumber }} + {{ uitextMustBePositive }} </mat-error> </mat-form-field> </form> diff --git a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts index 803de5b0b..fc2ec72e6 100644 --- a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts +++ b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts @@ -437,6 +437,10 @@ export class DialogEditParamValuesComponent implements OnInit { return this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_EXT_STRATEGY"); } + public get uitextMustBePositive() { + return this.intlService.localizeText("ERROR_PARAM_MUST_BE_POSITIVE"); + } + public ngOnInit() { this.initVariableValues(); } -- GitLab