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

Add support for GitHub and ORCID identifiers, plus enhancements to user account management #321

Merged
merged 24 commits into from
Jul 24, 2024

Conversation

jvendetti
Copy link
Member

This pull request introduces optional functionality for users to associate their GitHub usernames and ORCID iDs with their BioPortal accounts. Additionally, it includes several incremental improvements and refactoring efforts for the account and login pages to enhance the overall user experience.

Account creation page enhancements

  • Refactored to use a Bootstrap form with floating labels
  • Reduced the number of fields to the minimum necessary, adhering to current UX best practices by removing email and password confirmation fields
  • Removed the “Register for the BioPortal announcements email list” option as it is no longer maintained by Stanford

Account show and edit page improvements

  • Refactored UI for better presentation, including centered and widened content areas, improved component alignment, and consistent header sizing
  • Alphabetized the list of projects and ontologies submitted on the account show page, aiding admin accounts that manage numerous ontology submissions
  • Added a Stimulus clipboard controller to enable users to copy their API keys to the clipboard

Password management

  • Added a separate controller for password updates, simplifying logic in the UsersController
  • Included a “Change password” button on the account show page to streamline the process for users
  • Refactored the UI of the login and password reset pages for improved presentation.

Validation and code cleanup

  • Utilized HTML pattern attributes to validate the format of GitHub usernames and ORCID iDs
  • Removed outdated jQuery validate code that hindered the functionality of HTML pattern attributes
  • Replaced usages of the outdated form_for with form_with
  • Introduced UsersHelper to improve view layer code cleanliness
  • Added account.scss to house CSS code for account pages
  • Converted login/index and login/lost_password from ERB to HAML
  • Fixed some RuboCop warnings

@jvendetti jvendetti self-assigned this Jul 23, 2024
p = params.require(:user).permit(:firstName, :lastName, :username, :email, :email_confirmation, :password,
:password_confirmation, :register_mail_list, :admin)
p = params.require(:user).permit(:firstName, :lastName, :username, :email, :password, :password_confirmation,
:admin, :githubId, :orcidId)

Check failure

Code scanning / Brakeman

Potentially dangerous key allowed for mass assignment. Error

Potentially dangerous key allowed for mass assignment.
Copy link
Member Author

Choose a reason for hiding this comment

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

The :admin key was already present in the previous revision of this code. It's associated with the "Grant admin privileges" checkbox, and is only visible on the edit account page if the logged-in user is an administrator.

@jvendetti jvendetti merged commit 2cbaee0 into master Jul 24, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant