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

Providing users with a copy-to-clipboard feature for the checksum #4353

Merged
merged 3 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/views/rubygems/_gem_members.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,18 @@

<% if latest_version.sha256.present? %>
<h3 class="t-list__heading"><%= t '.sha_256_checksum' %>:</h3>
<div class="gem__sha">
<%= latest_version.sha256_hex %>
<div class="gem__code-wrap">
<input type="text" class="gem__code" id="gem_sha_256_checksum" value="<%= latest_version.sha256_hex %>" readonly="readonly">
<span class="gem__code__icon" id="js-gem__code--gemfile" data-clipboard-target="#gem_sha_256_checksum">=</span>
<span class="gem__code__tooltip--copy"><%= t('copy_to_clipboard') %></span>
<span class="gem__code__tooltip--copied"><%= t('copied') %></span>
</div>
<% end %>

<% if latest_version.cert_chain.present? %>
<h3 class="t-list__heading"><%= t '.signature_period' %>:</h3>
<div class="gem__expiry">
<%= nice_date_for(latest_version.cert_chain_valid_not_before) %> -
<%= nice_date_for(latest_version.cert_chain_valid_not_before) %> -
<%= nice_date_for(latest_version.cert_chain_valid_not_after) %>
<% if latest_version.signature_expired? %>
(<%= t '.expired' %>)
Expand Down
2 changes: 1 addition & 1 deletion test/functional/versions_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class VersionsControllerTest < ActionController::TestCase
end

should "render the checksum version" do
assert page.has_content?(@latest_version.sha256_hex)
assert page.has_field?("gem_sha_256_checksum", with: @latest_version.sha256_hex)
end
end

Expand Down