[DEV-2871] Added field type to DocumentProgramFormatter
parent
856c9a1a83
commit
e2461a023c
|
@ -177,11 +177,13 @@ module.exports = Class( 'DocumentProgramFormatter',
|
||||||
|
|
||||||
const field_value = bucket.getDataByName( field_id );
|
const field_value = bucket.getDataByName( field_id );
|
||||||
const field_label = this._program.fields[ field_id ].label;
|
const field_label = this._program.fields[ field_id ].label;
|
||||||
|
const field_type = this._program.fields[ field_id ].type;
|
||||||
const question = {};
|
const question = {};
|
||||||
|
|
||||||
question.id = field_id;
|
question.id = field_id;
|
||||||
question.label = field_label;
|
question.label = field_label;
|
||||||
question.value = field_value;
|
question.value = field_value;
|
||||||
|
question.type = field_type;
|
||||||
question.applicable = this._getApplicable(
|
question.applicable = this._getApplicable(
|
||||||
classes,
|
classes,
|
||||||
field_id,
|
field_id,
|
||||||
|
|
|
@ -64,18 +64,21 @@ describe( 'DocumentProgramFormatter', () =>
|
||||||
id: "sell_alcohol",
|
id: "sell_alcohol",
|
||||||
label: "Does the insured sell alcohol?",
|
label: "Does the insured sell alcohol?",
|
||||||
value: [ "foo", "" ],
|
value: [ "foo", "" ],
|
||||||
|
type: "noyes",
|
||||||
applicable: [ true, false ]
|
applicable: [ true, false ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "serve_alcohol",
|
id: "serve_alcohol",
|
||||||
label: "Does the insured serve alcohol?",
|
label: "Does the insured serve alcohol?",
|
||||||
value: [ "" ],
|
value: [ "" ],
|
||||||
|
type: "noyes",
|
||||||
applicable: [ false ]
|
applicable: [ false ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "field_no_vis",
|
id: "field_no_vis",
|
||||||
label: "Does this field have a visibility class?",
|
label: "Does this field have a visibility class?",
|
||||||
value: [ "true" ],
|
value: [ "true" ],
|
||||||
|
type: "noyes",
|
||||||
applicable: [ true ]
|
applicable: [ true ]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -87,18 +90,21 @@ describe( 'DocumentProgramFormatter', () =>
|
||||||
id: "sell_ecigs",
|
id: "sell_ecigs",
|
||||||
label: "Does the insured sell e-cigarettes?",
|
label: "Does the insured sell e-cigarettes?",
|
||||||
value: [ "", "bar" ],
|
value: [ "", "bar" ],
|
||||||
|
type: "noyes",
|
||||||
applicable: [ false, true ]
|
applicable: [ false, true ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "dist_ecigs",
|
id: "dist_ecigs",
|
||||||
label: "Does the Insured distribute Electronic Cigarette products?",
|
label: "Does the Insured distribute Electronic Cigarette products?",
|
||||||
value: [ "" ],
|
value: [ "" ],
|
||||||
|
type: "noyes",
|
||||||
applicable: [ false ]
|
applicable: [ false ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "field_no_array",
|
id: "field_no_array",
|
||||||
label: "Does this field have an array for the visibility class?",
|
label: "Does this field have an array for the visibility class?",
|
||||||
value: [ "bar" ],
|
value: [ "bar" ],
|
||||||
|
type: "noyes",
|
||||||
applicable: [ true ]
|
applicable: [ true ]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue