Altinn / app-lib-dotnet

Libraries used in Altinn Apps
BSD 3-Clause "New" or "Revised" License
8 stars 11 forks source link

Custom (and automatic) PDF layouts hides most of our components #857

Open mikaelrss opened 2 months ago

mikaelrss commented 2 months ago

Description of the bug

We have a form that defines a custom PDF layout. When the user submits the form, most of the components in that pdf layout become hidden although none of the components in the layout file have set the hidden property.

Here is the PDF layout generated with DevTools just before clicking "Send inn". image

And here is the PDF that is actually generated after submitting the form. image

All components that are of type Summary, are hidden.

Steps To Reproduce

  1. Go to Repo
  2. Clone and start the project: dotnet run in ./src/Digdir.Dgm.Gravferden.Api.Fake and dotnet run in a separate command line window in ./App
  3. Fill out the form.
  4. on the summary page, open Altinn developer tools, and click "Generer PDF"
  5. Observe that the values of the pdf layout are present.
  6. Click "Send inn", and observe that the provided PDF only shows the components from the custom pdf layout that are not SummaryComponents.

Additional Information

If you want to test this locally with the latest version of the frontend, you need to remove the JsonEnumConverter option on line 84-86 in Program.cs

// Comment this out
options.JsonSerializerOptions.Converters.Add(
    new JsonStringEnumConverter(JsonNamingPolicy.CamelCase)
);
bjosttveit commented 2 weeks ago

Transferred this to app-lib-dotnet as this seems to happen because shadow fields are removed before PDF generation happens