participateapp / web-client

Participate! is an app for democratic decision making
MIT License
6 stars 1 forks source link

Submitting new proposal form #9

Closed oliverbarnes closed 8 years ago

oliverbarnes commented 8 years ago

Form now renders and submits, but the authorization header is missing the access token.

This is due to how the new proposal route is being accessed:

[ a [ href "/new-proposal" ] [ text "Create a proposal" ] ]

It's being treated as an actual page, and so the model gets reset when the page loads. The access token is currently stored in the model, so it's lost as well.

The token should really be stored in local storage, going to add an issue for this.

But the routing here should be internal as well, rather than reloading the whole thing, and this will also ensure the access token is still present during form submittal, while it's not in local storage.

Closes #4

ThomasWeiser commented 8 years ago

As we are going with etaque/elm-simple-form and debois/elm-mdl it may make sense to think about some abstraction or helper functions for textfields (and other form inputs) that combine their functionality into one pleasant API.

ThomasWeiser commented 8 years ago

But the routing here should be internal as well, rather than reloading the whole thing, and this will also ensure the access token is still present during form submittal, while it's not in local storage.

Fix in PR #13

oliverbarnes commented 8 years ago

As we are going with etaque/elm-simple-form and debois/elm-mdl it may make sense to think about some abstraction or helper functions for textfields (and other form inputs) that combine their functionality into one pleasant API.

Agreed. But I'd probably wait until we need to build another form, to abstract these

ThomasWeiser commented 8 years ago

Sure