altinn-studio
altinn-studio copied to clipboard
12568 mock receipt for preview
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:
On this branch you will get this after adding a dataType:
If referring to an unexisting dataType you get this:
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)