-
Notifications
You must be signed in to change notification settings - Fork 222
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
Interface elements to support Github personal access tokens #2061
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<% @title = "Github Access Token" %> | ||
|
||
<h2>Github Update Access Token</h2> | ||
<% if GithubIntegration.connected %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The conditional check Consider modifying this to check the GitHub integration status for the specific user instance to ensure accurate display logic. |
||
<%= form_with url: github_token_user_path do |form| %> | ||
<div class="input-field"> | ||
<%= form.text_field :access_token, required: true %> | ||
<%= form.label :access_token, "Access Token" %> | ||
<span class="helper-text">Helpful description here</span> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The helper text under the access token input field is generic ("Helpful description here"). It would be beneficial to provide a more descriptive message to guide the user on where to find their GitHub access token or why it's needed. Consider updating the helper text to provide clear instructions on obtaining a GitHub personal access token and its intended use. |
||
</div> | ||
<%= form.submit "Update Token", { class: "btn primary" } %> | ||
<% end %> | ||
<% end %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
submit_github_token_form
action properly handles both the creation of a newGithubIntegration
instance for the user if one does not already exist, and the updating of an existing instance with the new access token. The use ofcreate!
andupdate!
methods ensures that any errors during these operations will raise exceptions, which is appropriate for catching unexpected issues.However, there's no explicit handling of potential exceptions that could arise from the
create!
orupdate!
operations, which could lead to a poor user experience if the database operations fail.Consider adding error handling around the database operations to gracefully handle any exceptions and provide meaningful feedback to the user.