forms-frontend icon indicating copy to clipboard operation
forms-frontend copied to clipboard

Add redux.js to add support for state storage

Open janine9vn opened this issue 2 years ago • 4 comments

Description

There will be scenarios where we may want to re-render a page/component but keep track of prior state/entries for better user experience. Redux.js is how we'll be approaching this

Example Scenario

When there's a submission error and the user has to log in again, we don't want them to lose the response they were about to submit.

Considerations

  • We should incorporate redux into our current react setup.
  • We use typescript, so we should be sure to follow the correct setup, taking inspiration from this
  • Make sure our documentation/README is adjusted to include this new dependency and way of approaching the forms app

janine9vn avatar Mar 15 '22 09:03 janine9vn

Hey, i'd like to try and implement this

DavinderJolly avatar Mar 17 '22 15:03 DavinderJolly

i closed this by mistake but i'd like to be assigned to this issue if noone else is already working on adding redux :)

DavinderJolly avatar Mar 17 '22 16:03 DavinderJolly

Can you create/link issues with the scenarios that you "may" want to implement where this is needed? On it's own this issue doesn't communicate any motivation or reasoning.

gitautas avatar Mar 18 '22 12:03 gitautas

On it's own this issue doesn't communicate any motivation or reasoning.

@gitautas the main reasoning is cited, "re-render a page/component but keep track of prior state/entries". We want to keep track of the state of the form when the user closes the page.

The issue does lack a bit the full goal which is to persist (probably in localStorage) the state of all partially completed forms and restore on form open, which will ensure that progress is not lost should a form be open/closed/etc.

jb3 avatar Mar 18 '22 13:03 jb3