Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User registration #9

Merged
merged 22 commits into from
Nov 27, 2018
Merged

User registration #9

merged 22 commits into from
Nov 27, 2018

Conversation

koffeinfrei
Copy link
Owner

@koffeinfrei koffeinfrei commented Nov 23, 2018

  • user registration
  • limit free subscription to 100 notes
  • Show "welcome" note after registration

the location is not consumed by the client anymore, so we can fall back
to the default implementation.
@koffeinfrei koffeinfrei changed the title User registration [WIP] User registration Nov 23, 2018
@koffeinfrei koffeinfrei changed the title [WIP] User registration User registration Nov 25, 2018
const errors = responseJSON.errors.join('<br>');

AlertFlash.show('Sorry, that did not work. You need to fix your inputs:<br>' + errors)
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want to have jquery-less solution you could do:

  • instead of using serialize, you might get the data like in one of these approaches: https://stackoverflow.com/a/47678799
  • personally, i always use controlled inputs where you define value and onChange for every form field and save the values in a state. It's more work, but its somewhat more clear, because it does not rely on the browser-api and also works similarly on environments like react-native., see this answer: https://stackoverflow.com/a/23428536

for $.ajax you could use the new fetch-api which is native to all modern browser and can be polyfilled: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally, i always use controlled inputs

You're right, that's the proper way to do react.

for $.ajax you could use the new fetch-api

Dropping jquery is a midterm goal anyway, but I'll have to get rid of bootstrap first (hence, a redesign).

Copy link
Owner Author

@koffeinfrei koffeinfrei Nov 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@macrozone Updated in 64bb19c.

1. errors are out of the viewport, esp. on mobile
2. after registration, the welcome message is not visible
react doesn't send the value with controlled inputs if the field is left
empty. that way the password confirmation is not needed and would create
the user without it.
@koffeinfrei koffeinfrei merged commit 3ea449a into master Nov 27, 2018
@koffeinfrei koffeinfrei deleted the features/user-registration branch November 27, 2018 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants