Skip to content
Snippets Groups Projects
Commit 57042c78 authored by francois.grand's avatar francois.grand
Browse files

#77 suppression du getter FieldSet.fields

parent 50f4b892
No related branches found
No related tags found
1 merge request!15Resolve "faire les modifications nécessaires prendre en compte le ticket cassiopee/jalhyd#46 (Gestion de la session dans la lib)"
......@@ -54,7 +54,7 @@ export class FieldSetComponent implements DoCheck {
private _isValid: boolean = false;
private get fields() {
return this._fieldSet.fields;
return this._fieldSet.kids;
}
private hasRadioFix(): boolean {
......
......@@ -46,22 +46,18 @@ export class FieldSet extends FormulaireElement implements Observer {
this._props = new Props();
}
public get fields(): Field[] {
return this.kids as Field[];
}
public get sessionNub(): SessionNub {
return this._sessionNub;
}
public addField(f: Field) {
private addField(f: Field) {
if (f == undefined)
throw new Error("FieldSet.addField() : argument incorrect (undefined)");
this.fields.push(f);
this.kids.push(f);
}
public get hasInputs(): boolean {
for (let f of this.fields)
for (const f of this.kids)
if (f instanceof NgParameter)
return true;
return false;
......@@ -69,7 +65,7 @@ export class FieldSet extends FormulaireElement implements Observer {
public getInput(i: number): NgParameter {
let n = 0;
for (let f of this.fields) {
for (let f of this.kids) {
if (f instanceof NgParameter) {
if (n == i)
return f;
......@@ -85,8 +81,11 @@ export class FieldSet extends FormulaireElement implements Observer {
public get isValid(): boolean {
let res: boolean = true;
for (let f of this.fields)
res = res && f.isValid;
for (const f of this.kids) {
if (f instanceof Field)
if (f.isDisplayed)
res = res && f.isValid;
}
return res;
}
......@@ -352,7 +351,7 @@ export class FieldSet extends FormulaireElement implements Observer {
}
public getNodeParameter(symbol: string): NgParameter {
for (let p of this.fields)
for (const p of this.kids)
if (p instanceof NgParameter)
if (p.isDisplayed && p.symbol === symbol)
return p;
......@@ -381,9 +380,9 @@ export class FieldSet extends FormulaireElement implements Observer {
* @returns valeur courante du select sans le préfixe
*/
public getSelectedValue(selectFieldId: string): string {
for (let p of this.fields)
for (const p of this.kids)
if (p instanceof SelectField && p.isDisplayed && p.id === selectFieldId) {
let value: string = p.getValue().value;
const value: string = p.getValue().value;
return FormulaireElement.removePrefix(value, selectFieldId + "_");
}
return undefined;
......
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