Skip to content
Snippets Groups Projects
Commit 5ece8826 authored by François Grand's avatar François Grand
Browse files

refactor: remove NgParam.unit member

refs #501
parent affc3e2d
No related branches found
No related tags found
1 merge request!141Resolve "PréBarrages: les valeurs erronées ne sont pas conservées"
......@@ -32,8 +32,6 @@ export class NgParameter extends InputField implements Observer {
/** set to true to disable UI validation on this input */
private _allowEmpty = false;
public unit: string;
public radioConfig: ParamRadioConfig;
public disabled: boolean;
......@@ -207,6 +205,10 @@ export class NgParameter extends InputField implements Observer {
return this._paramDef.valueMode;
}
public get unit() {
return this._paramDef.unit;
}
/**
* Unlinks the parameter and updates its value when value mode changes
*/
......@@ -496,7 +498,7 @@ export class NgParameter extends InputField implements Observer {
if (this._paramDef.symbol === rep.prmDef.symbol) {
this._paramDef.loadObjectRepresentation(rep.prmDef);
this._allowEmpty = rep.allowEmpty;
this.unit = rep.unit;
this._paramDef.setUnit(rep.unit);
this.radioConfig = rep.radioConfig;
}
}
......@@ -581,7 +583,6 @@ export class NgParameter extends InputField implements Observer {
if (json["allowEmpty"] !== undefined && typeof json["allowEmpty"] === "boolean") {
this._allowEmpty = json["allowEmpty"];
}
this.unit = this.paramDefinition.unit;
this.radioConfig = this.getRadioConfig();
if (json["calculable"] !== undefined && json["calculable"] === false) {
this.radioConfig = Math.min(ParamCalculability.FREE, this.getRadioConfig());
......
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