Skip to content

Commit

Permalink
Merge pull request #300 from spree/feature/display-webhook-secret-key…
Browse files Browse the repository at this point in the history
…-in-the-admin-panel-4-6

Display webhook secret key in admin panel (Spree 4.6)
  • Loading branch information
rafalcymerys committed Jan 5, 2024
2 parents aea0ce2 + 2bdaa03 commit d9945b9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/views/spree/admin/webhooks_subscribers/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<% if defined?(Spree::Vendor) && can?(:manage, Spree::Vendor) && !current_spree_vendor %>
<th><%= Spree.t(:vendor) %></th>
<% end %>
<th><%= Spree.t('admin.webhooks_subscribers.secret_key') %></th>
<th><%= Spree.t('admin.active') %></th>
<th><%= Spree.t('admin.webhooks_subscribers.subscriptions') %></th>
<th><%= Spree.t('admin.webhooks_subscribers.time_of_last_event') %></th>
Expand All @@ -31,6 +32,16 @@
<%= link_to webhooks_subscriber.vendor.name, spree.admin_vendor_path(webhooks_subscriber.vendor) if webhooks_subscriber.vendor.present? %>
</td>
<% end %>
<td>
<div class="input-group" data-controller="password-toggle">
<%= password_field_tag :password, webhooks_subscriber.secret_key, class: 'form-control unhide text-muted border-0 shadow-none bg-transparent', data: { password_toggle_target: 'unhide' }, readonly: true %>
<div class="input-group-append">
<%= button_tag class: 'btn btn-link rounded', data: { action: 'click->password-toggle#password' } do %>
<%= svg_icon name: "view.svg", width: '18', height: '18' %>
<% end %>
</div>
</div>
</td>
<td><%= active_badge(webhooks_subscriber.active) %></td>
<td><%= webhooks_subscriber.subscriptions&.sort&.join(', ') %></td>
<td><%= webhooks_subscriber.events.order(:created_at).last&.created_at %></td>
Expand Down

0 comments on commit d9945b9

Please sign in to comment.