Skip to content

Commit 78fb17b

Browse files
committed
Fix display collection field values..
Signed-off-by: Hamza JGUERIM <hamzajg@gmail.com>
1 parent 0c3a52f commit 78fb17b

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/main/resources/codegen/reactjs/AggregateDetail.ftl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import ${fns.capitalize(aggregate.aggregateName)}${fns.capitalize(method.name)}
3939
{item?.${name}.map(item => (
4040
<tr>
4141
<#if valueTypes[type]??>
42-
<@printItemTableCell "${name}" "${type}" />
42+
<@printItemTableCell "item" "${type}" />
4343
<#else>
4444
<td>{item}</td>
4545
</#if>
@@ -69,10 +69,14 @@ import ${fns.capitalize(aggregate.aggregateName)}${fns.capitalize(method.name)}
6969
<#macro printItemTableCell name type>
7070
<#if valueTypes[type]??>
7171
<#list valueTypes[type] as subType>
72-
<@printItemTableCell "${subType.name}" subType.type/>
72+
<#if subType.isCollection>
73+
<@printItemTableCell "${name}?.${subType.name}[0]" subType.type/>
74+
<#else>
75+
<@printItemTableCell "${name}?.${subType.name}" subType.type/>
76+
</#if>
7377
</#list>
7478
<#else>
75-
<td>{item?.${name}}</td>
79+
<td>{${name}}</td>
7680
</#if>
7781
</#macro>
7882

src/test/resources/text-expectations/reactjs/proposal-detail.text

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ const Proposal = () => {
7373
<tbody>
7474
{item?.multipleExpectations.map(item => (
7575
<tr>
76-
<td>{item?.keywords}</td>
77-
<td>{item?.value}</td>
76+
<td>{item?.keywords[0]}</td>
77+
<td>{item?.price?.value}</td>
7878
<td>{item?.dueOn}</td>
7979
</tr>
8080
))}

src/test/resources/text-expectations/reactjs/proposals-detail.text

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ const Proposal = () => {
7373
<tbody>
7474
{item?.multipleExpectations.map(item => (
7575
<tr>
76-
<td>{item?.value}</td>
77-
<td>{item?.value}</td>
76+
<td>{item?.keywords[0]?.value[0]}</td>
77+
<td>{item?.price?.value}</td>
7878
<td>{item?.dueOn}</td>
7979
</tr>
8080
))}

0 commit comments

Comments
 (0)