-
Notifications
You must be signed in to change notification settings - Fork 340
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
Admin panel allow minors option #40
Conversation
server: Add allowMinors in Settings schema. client: Add SettingsService updateAllowMinors function. server: Add '/settings/minors' api endpoint to update allowMinors setting. client: Add Additional Options section in admin settings.
Cool! Thanks for the PR :) |
68249a0
to
1bf3568
Compare
Fix bug where scope.allowMinors was mixed scope.settings.allowMinors.
Modify 'checked' in adult form validation to user custom 'allowMinors' validation rule that uses the allowMinors flag from the current settings.
1bf3568
to
b30b281
Compare
Changed the buttons to be toggle checkboxes. This is more intuitive than buttons, since 'allowMinors' reflects state, and not an action.
b30b281
to
851e1c9
Compare
@ehzhang |
Deferring to @ehzhang to approve the UX changes, but otherwise lgtm 😄 thanks @Jeremy091 ! |
🎉 |
Admin panel allow minors option
Admin panel allow minors option
Admin panel allow minors option
Admin panel allow minors option
Issue #15
I saw this issue up for grabs, and I'd like to make a contribution for Hacktoberfest.
I created an 'Additional Options' sections on the admin settings page and added a 'Allow minors' checkbox.
Toggling this checkbox will update a new boolean property called
allowMinors
in the server's Settings schema, and update the settings client side. A 'put' endpoint was added to the server api.js to allow changes to theallowMinors
setting.The client's applicationCtrl.js now checks the the
allowMinors
flag in the settings when doing the form validation for the 'adult' property in the user's profile.I did my best to remain consistent with the codebase, and added as little as possible to get this working. Please don't hesitate to let me know if you'd like this done differently. Thanks!
Example Screenshots:
Additional options section.
Minors set to disallowed.
This is what it looks like when toggled to 'allowed'.
This is the confirmation that pops up after you toggle the checkbox.