Altinn / altinn-pdf

Altinn platform microservice for generating PDFs
0 stars 1 forks source link

PDF generated on apps with nested repeating groups is wrong #5

Closed OddArneSaetervik closed 2 years ago

OddArneSaetervik commented 2 years ago

@jeevananthank commented on Fri Feb 04 2022

Description

When archiving an app with nested repeating group with items added both to the main and nested repeating groups, the pdf generated does not contain all the data filled in the repeating group.

To Reproduce

  1. Start an app instance that has nested repeating groups configured.
  2. Add items to both the main and nested repeating group (more than 2 main group items with multiple nested group items).
  3. archive the instance and download the pdf generated.
  4. for test app: no issue for 1 item in main group and all items in nested group item 2 in main group is not added to the PDF, all the items added in nested group in 2nd main group is empty. (see picture)

Expected behavior

PDF generated should have all the data filled in by the user.

Screenshots

image

Additional info

env: tt02 app: ttd/frontend-test

Cause / Resolution

Cause we can paginate the children in a group component. PDF does not know about this and we always get a null when trying to match id with what is configured.

Trouble line:

FormLayoutElement childElement = originalFormLayout.getData().getLayout().stream().filter(formLayoutElement -> formLayoutElement.getId().equals(childId)).findFirst().orElse(null); 
acn-sbuad commented 2 years ago

Final remaining issue of https://github.com/Altinn/altinn-roadmap/issues/30 Will be tested by @jeevananthank to confirm that epic is solved as expected.