Skip to content

User profile fields for KerbalX and GitHub - #381

Merged
DasSkelett merged 2 commits into
KSP-SpaceDock:alphafrom
HebaruSan:feature/kerbalx-github
Aug 13, 2021
Merged

User profile fields for KerbalX and GitHub#381
DasSkelett merged 2 commits into
KSP-SpaceDock:alphafrom
HebaruSan:feature/kerbalx-github

Conversation

@HebaruSan

Copy link
Copy Markdown
Member

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
@HebaruSan
HebaruSan requested a review from DasSkelett July 30, 2021 23:19
@DasSkelett

Copy link
Copy Markdown
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
Copy Markdown
Member 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
Copy Markdown
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
Copy Markdown
Member 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.

@DasSkelett
DasSkelett force-pushed the feature/kerbalx-github branch from 8274ecd to d318595 Compare August 13, 2021 12:19

@DasSkelett DasSkelett left a comment

Copy link
Copy Markdown
Member

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.

2 participants