altinn-studio icon indicating copy to clipboard operation
altinn-studio copied to clipboard

12568 mock receipt for preview

Open standeren opened this issue 11 months ago • 1 comments

Description

Preview was origianlly failing since the layout-sets file did not contain a datType by default for the custom receipt layout set when added from proces-editor. To make sure the app-developer is forced to add a dataType when adding a custom receipt from process-editor should be solved in another issue. But given that the dataType reference is present in the layoutsets file this PR will make sure that app-frontend gets a response similar to the end event process task when we preview. custom receipt and it will make sure that the dataType is fetched directly from the layoutsets file and not through appmetadata (since that is based on the task-ref and the custom receipt task-id is not present in appmetadata)

If you add a dataType in layout-sets for the custom receipt set today you will get this view: Skjermbilde 2024-03-28 kl  10 32 20

On this branch you will get this after adding a dataType: Skjermbilde 2024-03-28 kl  10 34 09

If referring to an unexisting dataType you get this: Skjermbilde 2024-03-28 kl  10 35 00

Also added a fallback to an empty dataType reference if the reference does not exist in the layoutsets file so the preview will not fail, but only fallback to the standard Altinn receipt

Verification

  • [x] Your code builds clean without any errors or warnings
  • [x] Manual testing done (required)
  • [x] Relevant automated test added (if you find this hard, leave it and we'll help out)

standeren avatar Mar 27 '24 15:03 standeren