Commit fb29ec90 authored by Dorchies David's avatar Dorchies David
Browse files

Merge branch...

Merge branch '541-dialogue-de-parametre-variable-pouvoir-valider-avec-la-touche-entree' into 'devel'

Resolve "Dialogue de paramètre variable : pouvoir valider avec la touche entrée"

Closes #541

See merge request !140
parents 33ebb9bb 1827d10a
Pipeline #36235 canceled with stages
in 5 seconds
......@@ -23,7 +23,7 @@
<input matInput class="form-control" type="number" inputmode="numeric" name="min-value" step="0.01"
[placeholder]="uitextValeurMini" [(ngModel)]="minValue" #min="ngModel" name="min"
(input)="minMaxForm.controls.max.updateValueAndValidity()" [appJalhydModelValidationMin]="param"
required pattern="^-?([0-9]*\.)?([0-9]+[Ee]-?)?[0-9]+$">
required pattern="^-?([0-9]*\.)?([0-9]+[Ee]-?)?[0-9]+$" (keyup.enter)="onValidate()" (keyup.escape)="onCancel()">
<mat-error *ngIf="min.errors">
<div *ngIf="min.errors.required || min.errors.pattern">
......@@ -39,7 +39,7 @@
<input matInput class="form-control" type="number" inputmode="numeric" name="max-value" step="0.01"
[placeholder]="uitextValeurMaxi" [(ngModel)]="maxValue" #max="ngModel" name="max"
(input)="minMaxForm.controls.min.updateValueAndValidity()" [appJalhydModelValidationMax]="param"
required pattern="^-?([0-9]*\.)?([0-9]+[Ee]-?)?[0-9]+$">
required pattern="^-?([0-9]*\.)?([0-9]+[Ee]-?)?[0-9]+$" (keyup.enter)="onValidate()" (keyup.escape)="onCancel()">
<mat-error *ngIf="max.errors">
<div *ngIf="max.errors.required || max.errors.pattern">
......@@ -54,7 +54,8 @@
<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"
[appJalhydModelValidationStep]="param" required pattern="^([0-9]*\.)?([0-9]+[Ee]-?)?[0-9]+$">
[appJalhydModelValidationStep]="param" required pattern="^([0-9]*\.)?([0-9]+[Ee]-?)?[0-9]+$"
(keyup.enter)="onValidate()" (keyup.escape)="onCancel()">
<mat-error *ngIf="step.errors">
{{ uitextMustBePositive }}
......@@ -128,4 +129,4 @@
{{ uitextValidate }}
</button>
</div>
</div>
\ No newline at end of file
</div>
......@@ -290,20 +290,22 @@ export class DialogEditParamValuesComponent implements OnInit {
}
public onValidate() {
switch (this.param.valueMode) {
case ParamValueMode.LISTE:
this.data.param.setValueList(this, this.param.valueList);
break;
case ParamValueMode.MINMAX:
this.data.param.setMinValue(this, this.param.minValue);
this.data.param.setMaxValue(this, this.param.maxValue);
this.data.param.setStepValue(this, this.param.stepValue);
break;
if (this.isFormValid) {
switch (this.param.valueMode) {
case ParamValueMode.LISTE:
this.data.param.setValueList(this, this.param.valueList);
break;
case ParamValueMode.MINMAX:
this.data.param.setMinValue(this, this.param.minValue);
this.data.param.setMaxValue(this, this.param.maxValue);
this.data.param.setStepValue(this, this.param.stepValue);
break;
}
this.dialogRef.close({
cancelled: false
});
}
this.dialogRef.close({
cancelled: false
});
}
/**
......
Markdown is supported
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