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 profile fields for KerbalX and GitHub #381

Merged
merged 2 commits into from Aug 13, 2021

Conversation

HebaruSan
Copy link
Contributor

Motivation

The profile currently allows the user to enter their username on the KSP forum, Twitter, Reddit, and IRC. I think GitHub is more important for modders, and KerbalX is more important for a lot of non-modders.

Changes

Now the profile has KerbalX and GitHub fields.
Note that this will need to be rebased if #380 is merged first, or vice versa, since both have migrations with the same down revision.

@HebaruSan HebaruSan added Area: Backend Related to the Python code that runs inside gunicorn Priority: Normal Type: Feature Status: Ready Area: Migration Related to Alembic database migrations labels Jul 30, 2021
@DasSkelett
Copy link
Member

I think it's time to differentiate between fields where only the username is required (Twitter, Reddit, GitHub, KerbalX), and where the complete link is required (KSP Forums), on the edit page. I've seen many profiles where the links are messed up because they put the complete link where only a username should be put into.

Maybe by appending usernameand link to the accompanying labels? I.e. Twitter username:, Reddit username, KSP Forums link (or KSP Forums profile link?) etc.

@HebaruSan
Copy link
Contributor Author

Agreed. How about some client side validation? When the user tries to save, we could inspect the fields and raise an alert if any of them are formatted wrong.

@DasSkelett
Copy link
Member

Sounds good. We don't need to do a full URL parsing, checking if it begins with http://or https://is probably enough. Hoping that none of the external sites allow usernames starting with this string.

@HebaruSan
Copy link
Contributor Author

OK, renamed the labels to include either "link" or "username" and added some validation.

  • I assumed that usernames on these sites can include alphanumerics plus dash, underscore, or period, but in the errors I just said "alphanumeric" because that level of detail is not needed to tell the user not to paste a URL in there
  • I did not add validation for the forum field, because it's not actually required for it to be a link; you can enter just your user name and it will display just fine, so it seemed like overkill to raise an error if a user had done that in the past and just wanted to change some other field.

Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

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

Rebased on alpha after #380

Looks good!

@DasSkelett DasSkelett merged commit c5e5ad7 into KSP-SpaceDock:alpha Aug 13, 2021
@HebaruSan HebaruSan deleted the feature/kerbalx-github branch August 13, 2021 13:19
This was referenced Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Backend Related to the Python code that runs inside gunicorn Area: Migration Related to Alembic database migrations Priority: Normal Status: Ready Type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants