Closed bjosttveit closed 9 months ago
It seems to me like this code will work fine to put directly in dev tools. Any reason why not?
You are probably right, I suppose it could pop up in a modal maybe
If you put everything in dev tools, it will work in tt02 and prod also, if you have the pdf image running locally
If you put everything in dev tools, it will work in tt02 and prod also, if you have the pdf image running locally
I still don't think that would be possible since the AltinnStudioRuntime
cookie would not be accessible there?
No, it should absolutely not be accessible from JavaScript so that is a definitive NO on this approach from me. I also think we should be careful about having different cookie settings in LocalTest. The proper solution would be to have an app lib expose an api for generating pdfs for preview before submission. The alternative is to have an API in local test to fetch the cookie value so that the current code works with a small modification to fetch the auth token.
Description
This allows you to use the local PDF generator in docker/podman to generate a PDF preview for an app. This has some benefits:
PdfGeneratorRequestOptions
in app-lib. When using print-to-pdf in chrome, the default margins etc. do not matchfrontendVersion
cookie to use the same version. Works with localhost as well by rewritinglocalhost
->host.containers.internal
before sending it along.It needs queryParameters for the
org
,app
,instance
, andlang
. App-frontend can easily set these correctly: https://github.com/Altinn/app-frontend-react/pull/1794For now, you can just refresh the page to regenerate the PDF.
Note: For this to work it requires changing some cookies to no longer have
httpOnly
, since the cookies need to be sent along to the PDF generator in the request body.Related Issue(s)
{issue number}
Verification
Documentation