Open magnusjerre opened 1 year ago
Moving this to app-frontend-react
although it might require some implementation elsewhere as well. Instead of jerry-rigging some way to submit data from anonymous stateless apps to an endpoint we should probably look into supporting anonymous instances (and proper anonymous stateful apps). This could also make it possible to limit who can create new instances. It also follows the rest of our paradigm where completed instances are fetched from our APIs (PULL) rather than submitted somewhere (PUSH), as this feature-request describes.
Altinn App spesifikasjon Vi ønsker en APP som kan brukes som svar på en (uformell) høring.
Behov:
Svar fra APP sendes som epost til: -- nasjonalarkitektur@digdir.no -- Avsenders epost/kontaktinformasjon
Skjemadata kan enten serialiseres som ren tekst og/eller som Json. Hvis sendes som ren tekst må den ha en viss struktur slik at den kan importeres inn i f.eks Excel.
Print/PDF-behov -- Ønsker primært at APP genererer PDF og at denne sendes som vedlegg til epost-mottagere. Hvis dette ikke er mulig - at avsender har mulighet til selv å printe ut hos seg selv.
Kun Bokmål-støtte ...
Kan vedlegge 1 dokument/fil hvis ønskelig
Følgende spørsmål og oppbygging av spørsmål/svar
Tittel: "Beste Praksis - Arkitektur for hendelser i felles økosystem"
Undertittel: "Vårt saksnummer: "23/46 Høring på beste praksis arkitektur for hendelser", (ikke-editerbart felt)
Avsender informasjon -- "Navn", obligatorisk -- "Virksomhet", obligatorisk men preutfylt med "N/A" -- "Kontaktinformasjon/epost", obligatorisk
Hoveddel:
Description
We would like to provide our respondents with a login-less survey they can fill in and then submit their answer. Using the normal submit button requires an instance, but these respondents will be responding using the anonymous stateless functionality instead, hence no instance. This "stateless submit"-button should preferably include the contents of the model (not the
formData
representation). Upon clicking "stateless submit" a call to an overridable endpoint on the server should be made, followed by a navigation/redirect to a customizable receipt page.Additional Information
We have a working POC where we have created a custom Web Component that makes an http-request to a custom endpoint on the server that handles the request, after which the frontend just redirects to the start of the survey. The initial idea was to include another layout page with the receipt, but we couldn't find a way to trigger a "next page" event in the frontend.
Our POC-implementation can be found here: https://altinn.studio/repos/udir/demodemoeleveundersokelsen Workflow:
udir/demodemoeleveundersokelsen/api/stateless/submit
. The backend then converts the datamodelBindings to our model and then makes a request to an external service. When the frontend receives a response, it redirects to the front page. Instead of redirecting to the front page it should preferably present a receipt instead.Sample layoutelement illustrating why we would like the model to be sent instead of having to define/map datamodelBindings (this example is a summary, we can have more than 70 questions, this one includes only 9)