[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 group_id = step_groups[ group ];
|
||||
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 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;
|
||||
groups.push( step_group );
|
||||
}
|
||||
|
|
|
@ -58,7 +58,9 @@ describe( 'DocumentProgramFormatter', () =>
|
|||
title: "General Information",
|
||||
groups: [
|
||||
{
|
||||
id: "group_one",
|
||||
title: "Group One",
|
||||
link: "locations",
|
||||
questions: [
|
||||
{
|
||||
id: "sell_alcohol",
|
||||
|
@ -84,7 +86,9 @@ describe( 'DocumentProgramFormatter', () =>
|
|||
]
|
||||
},
|
||||
{
|
||||
id: "group_two",
|
||||
title: "",
|
||||
link: "",
|
||||
questions: [
|
||||
{
|
||||
id: "sell_ecigs",
|
||||
|
@ -181,7 +185,8 @@ function createStubProgram()
|
|||
{
|
||||
'group_one':
|
||||
{
|
||||
title: "Group One"
|
||||
title: "Group One",
|
||||
link: "locations"
|
||||
},
|
||||
'group_two': {},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue