Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Rewrite the Petition plugin in React. #1418

Open
vincemtnz opened this issue Jun 4, 2019 · 0 comments
Open

Rewrite the Petition plugin in React. #1418

vincemtnz opened this issue Jun 4, 2019 · 0 comments
Assignees

Comments

@vincemtnz
Copy link
Contributor

vincemtnz commented Jun 4, 2019

Our first step towards deprecating Backbone is to write React versions of our member facing Backbone views. The most used at the moment is the Petition form, which fortunately is also the simplest. Here are there requirements:

  • We must not delete the existing Backbone based version, as we will be A/B testing them side by side, and we also want a quick fallback option in case anything goes wrong.
  • Use the new async loading plugin architecture.
  • Reuse FieldShape if possible. If it's not a great option, create a new reusable component (like FieldShape) that understands the champaign form field format.
  • At the top level, the instance should expose a Public API that allows us to manipulate the plugin state. This allows for experiments to programatically change the values in the plugin, submit, etc.
  • Events: expose events for main events and interactions that happen in the plugin:
    • Form submission events (errors, success)
    • User interactions (form field changed, form submitted, user details reset, etc).
  • The Petition plugin must be GDPR compliant.

Notes

The Petition plugin is essentially an ActionForm with an onSuccess hook / callback. In our case, we either scroll or redirect, depending on the template. All form fields are defined when editing the page, so the front end plugin simply needs to read the list of fields in order to generate and pre-populate them with values.

We now have the freedom to refactor or redesign how that data gets passed to the frontend.

@vincemtnz vincemtnz changed the title Rewrite the Pension plugin in React. Rewrite the Petition plugin in React. Jun 4, 2019
@subbiahsn subbiahsn self-assigned this Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants