plomino / Plomino

Powerful and flexible web-based application builder
33 stars 37 forks source link

How to use form request data on thank you page #831

Open djay opened 7 years ago

djay commented 7 years ago

We have a situation whereby

  1. Normal user submits form
  2. onsavedocument sets the Plomino_Readers to admin and sends an email for it to be reviewed. It needs to be private as other information will be added to the document.
  3. redirect to thank you page. Thank you page has hidewhens or computed fields that depend on data in the form.

Normally you would solve this by redirecting to {docid}?openwithform=thankyou, however that doesn't work in this case due to the Plomino_Readers.

It's not really clear whats the going to be the most userfriendly way to support this common usecase (PFG easily allows displaying submitted data on the thankyou page).

Options

  1. Use multipage

    • ie thank you is always the last page in a multipage form. For this to work there needs to be a special custom save and next button combination where the document is created and onsavedocument is run but instead of a redirect, you go to the next page.
  2. Render thankyou on submit

    • instead of doing a redirect, render the thankyou page (or default readonly view) as a result of the form submission like PFG does.
    • would somehow need to update the location bar so the url is {docid}. Not sure if this can be done using 201 response, or perhaps with some JS?. or just live with the URL being the original form and if the form really wants to display it as the {docid} then the form could explicitly do the redirect in that case (e.g. to ensure the data is lost and you can't go back)
  3. Rethink permissions

    • instead of changing Plomino_Readers put security on the forms and views. However currently they are all open so to be save it would really require a change that all Forms and Views are created private to the creator and has to be published to allow others to use it. This could make exporting designs difficult.
  4. use cookies

    • have some special case where you can store the whole form in cookies or localstore for only the purpose of having it available on the next form (which is automatically done)

Thoughts @ebrehault @jean ?

djay commented 7 years ago

any thoughts @jean @ebrehault ?

jean commented 7 years ago

onsavedocument sets the Plomino_Readers to admin and sends an email for it to be reviewed. It needs to be private as other information will be added to the document.

Leave Plomino_Readers to the Author and put the private info on a different document, named e.g. <docid>_privates.