[DEV-2871] Added link and id to group in DocumentProgramFormatter
parent
e2461a023c
commit
14a8af2282
|
@ -139,11 +139,14 @@ module.exports = Class( 'DocumentProgramFormatter',
|
||||||
const step_group = {};
|
const step_group = {};
|
||||||
const group_id = step_groups[ group ];
|
const group_id = step_groups[ group ];
|
||||||
const group_title = this._program.groups[ group_id ].title || "";
|
const group_title = this._program.groups[ group_id ].title || "";
|
||||||
|
const group_link = this._program.groups[ group_id ].link || "";
|
||||||
const fields = this._program.groupExclusiveFields[ group_id ];
|
const fields = this._program.groupExclusiveFields[ group_id ];
|
||||||
|
|
||||||
const questions = this._parseFields( fields, bucket, classes );
|
const questions = this._parseFields( fields, bucket, classes );
|
||||||
|
|
||||||
step_group.title = group_title;
|
step_group.id = group_id;
|
||||||
|
step_group.title = group_title;
|
||||||
|
step_group.link = group_link;
|
||||||
step_group.questions = questions;
|
step_group.questions = questions;
|
||||||
groups.push( step_group );
|
groups.push( step_group );
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,9 @@ describe( 'DocumentProgramFormatter', () =>
|
||||||
title: "General Information",
|
title: "General Information",
|
||||||
groups: [
|
groups: [
|
||||||
{
|
{
|
||||||
|
id: "group_one",
|
||||||
title: "Group One",
|
title: "Group One",
|
||||||
|
link: "locations",
|
||||||
questions: [
|
questions: [
|
||||||
{
|
{
|
||||||
id: "sell_alcohol",
|
id: "sell_alcohol",
|
||||||
|
@ -84,7 +86,9 @@ describe( 'DocumentProgramFormatter', () =>
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: "group_two",
|
||||||
title: "",
|
title: "",
|
||||||
|
link: "",
|
||||||
questions: [
|
questions: [
|
||||||
{
|
{
|
||||||
id: "sell_ecigs",
|
id: "sell_ecigs",
|
||||||
|
@ -181,7 +185,8 @@ function createStubProgram()
|
||||||
{
|
{
|
||||||
'group_one':
|
'group_one':
|
||||||
{
|
{
|
||||||
title: "Group One"
|
title: "Group One",
|
||||||
|
link: "locations"
|
||||||
},
|
},
|
||||||
'group_two': {},
|
'group_two': {},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue