Skip to content

Support custom receipt without any data models #1970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
olemartinorg opened this issue Mar 21, 2024 · 1 comment
Open

Support custom receipt without any data models #1970

olemartinorg opened this issue Mar 21, 2024 · 1 comment
Labels
kind/feature-request New feature or request
Milestone

Comments

@olemartinorg
Copy link
Contributor

olemartinorg commented Mar 21, 2024

Description

The custom receipt is loaded via layout sets today, and requires that a data type has been set. It then loads the full <FormProvider> which loads that data model. When using custom receipt together with autoDeleteOnProcessEnd: true we cannot show that custom receipt (there is a warning about this that falls back to the default receipt in ProcessWrapper) after the referenced data type has been deleted (because loading <FormProvider> would crash when the default data model is missing).

After #1484 is done, it might be easier to run FormProvider without a single/default data model, if we're able to load multiple data models on demand/when used. This should also mean that we can then add support for loading a custom receipt _without any default data model definedinlayout-sets.json` - as long as no components or text resources reference the data model that has been deleted.

Additional Information

@bjosttveit
Copy link
Member

Added this to milestone for v5. We should support not specifying a default data type for a layout-set in general. What complicates this is that we currently use the dataType to find out which layout-set is the current one (for some weird reason). If an app is slightly misconfigured today, things can still work due to some quirks in the logic that I don't quite remember the details of 😅 In a new major release we don't have to worry about breaking such edge-cases and we can safely remove this connection between dataTypes and layout-sets, and not require a default data type at all. This is indeed easier to do after #1484.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants