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

Modale de paramètre varié: délection de la stratégie d'extension

parent 1d9cd6b0
No related branches found
No related tags found
1 merge request!46Resolve "Fonctionnalité : plusieurs paramètres qui varient (Voir Jalhyd#62)"
......@@ -105,6 +105,15 @@
</form>
</div>
<mat-form-field>
<mat-select [placeholder]="uitextExtensionStrategy" [(value)]="selectedExtensionStrategy"
data-testid="variable-extension-strategy-select">
<mat-option *ngFor="let e of extensionStrategies" [value]="e.value">
{{ e.label }}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div mat-dialog-content *ngIf="viewChart">
......
......@@ -3,7 +3,7 @@ import { Inject, Component, OnInit } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { I18nService } from "../../services/internationalisation/internationalisation.service";
import { NgParameter } from "../../formulaire/ngparam";
import { ParamValueMode } from "jalhyd";
import { ParamValueMode, ExtensionStrategy } from "jalhyd";
import { sprintf } from "sprintf-js";
import { ApplicationSetupService } from "../../services/app-setup/app-setup.service";
......@@ -23,6 +23,9 @@ export class DialogEditParamValuesComponent implements OnInit {
/** available decimal separators */
public decimalSeparators: { label: string; value: string; }[];
/** available extension strategies */
public extensionStrategies: { value: ExtensionStrategy; label: string; }[];
/** current decimal separator */
public decimalSeparator: string;
......@@ -76,6 +79,16 @@ export class DialogEditParamValuesComponent implements OnInit {
}
];
this.decimalSeparator = this.decimalSeparators[0].value;
this.extensionStrategies = [
{
value: ExtensionStrategy.REPEAT_LAST,
label: this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_EXT_STRATEGY_REPEAT_LAST")
},
{
value: ExtensionStrategy.RECYCLE,
label: this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_EXT_STRATEGY_RECYCLE")
}
];
// chart configuration
const nDigits = this.appSetupService.displayDigits;
......@@ -171,6 +184,14 @@ export class DialogEditParamValuesComponent implements OnInit {
this.param.valueMode = v;
}
public get selectedExtensionStrategy() {
return this.param.paramDefinition.extensionStrategy;
}
public set selectedExtensionStrategy(es) {
this.param.paramDefinition.extensionStrategy = es;
}
public get isMinMax() {
return this.param.valueMode === ParamValueMode.MINMAX;
}
......@@ -412,6 +433,10 @@ export class DialogEditParamValuesComponent implements OnInit {
return this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_IMPORT_FICHIER");
}
public get uitextExtensionStrategy() {
return this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_EXT_STRATEGY");
}
public ngOnInit() {
this.initVariableValues();
}
......
......@@ -197,7 +197,7 @@ export class ParamFieldLineComponent implements OnChanges {
let ret = true;
if (this.param.paramDefinition.isCalculated) {
const nub = this.param.paramDefinition.parentNub;
const p = nub.findFirstSingleParameter(this.param.paramDefinition);
const p = nub.findFirstCalculableParameter(this.param.paramDefinition);
ret = (p !== undefined);
}
return ret;
......
......@@ -212,6 +212,9 @@
"INFO_PARAMFIELD_PARAMFIXE": "Fixed",
"INFO_PARAMFIELD_PARAMLIE_LABEL": "Linked parameter",
"INFO_PARAMFIELD_PARAMLIE": "Link",
"INFO_PARAMFIELD_PARAMVARIER_EXT_STRATEGY": "Values list extension strategy",
"INFO_PARAMFIELD_PARAMVARIER_EXT_STRATEGY_REPEAT_LAST": "Repeat last value",
"INFO_PARAMFIELD_PARAMVARIER_EXT_STRATEGY_RECYCLE": "Recycle values",
"INFO_PARAMFIELD_PARAMVARIER_IMPORT_FICHIER": "Import file",
"INFO_PARAMFIELD_PARAMVARIER_MINMAXSTEP": "min: %s, max: %s, step: %s",
"INFO_PARAMFIELD_PARAMVARIER_MODE": "Mode",
......
......@@ -212,6 +212,9 @@
"INFO_PARAMFIELD_PARAMFIXE": "fixé",
"INFO_PARAMFIELD_PARAMLIE_LABEL": "Paramètre lié",
"INFO_PARAMFIELD_PARAMLIE": "lié",
"INFO_PARAMFIELD_PARAMVARIER_EXT_STRATEGY": "Stratégie d'extension de la liste de valeurs",
"INFO_PARAMFIELD_PARAMVARIER_EXT_STRATEGY_REPEAT_LAST": "Répéter la dernière valeur",
"INFO_PARAMFIELD_PARAMVARIER_EXT_STRATEGY_RECYCLE": "Réutiliser les valeurs",
"INFO_PARAMFIELD_PARAMVARIER_IMPORT_FICHIER": "Importer un fichier",
"INFO_PARAMFIELD_PARAMVARIER_MINMAXSTEP": "min : %s, max : %s, pas : %s",
"INFO_PARAMFIELD_PARAMVARIER_MODE": "Mode",
......
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