Skip to content

Commit d9945b9

Browse files
authored
Merge pull request #300 from spree/feature/display-webhook-secret-key-in-the-admin-panel-4-6
Display webhook secret key in admin panel (Spree 4.6)
2 parents aea0ce2 + 2bdaa03 commit d9945b9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/views/spree/admin/webhooks_subscribers/index.html.erb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<% if defined?(Spree::Vendor) && can?(:manage, Spree::Vendor) && !current_spree_vendor %>
1616
<th><%= Spree.t(:vendor) %></th>
1717
<% end %>
18+
<th><%= Spree.t('admin.webhooks_subscribers.secret_key') %></th>
1819
<th><%= Spree.t('admin.active') %></th>
1920
<th><%= Spree.t('admin.webhooks_subscribers.subscriptions') %></th>
2021
<th><%= Spree.t('admin.webhooks_subscribers.time_of_last_event') %></th>
@@ -31,6 +32,16 @@
3132
<%= link_to webhooks_subscriber.vendor.name, spree.admin_vendor_path(webhooks_subscriber.vendor) if webhooks_subscriber.vendor.present? %>
3233
</td>
3334
<% end %>
35+
<td>
36+
<div class="input-group" data-controller="password-toggle">
37+
<%= 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 %>
38+
<div class="input-group-append">
39+
<%= button_tag class: 'btn btn-link rounded', data: { action: 'click->password-toggle#password' } do %>
40+
<%= svg_icon name: "view.svg", width: '18', height: '18' %>
41+
<% end %>
42+
</div>
43+
</div>
44+
</td>
3445
<td><%= active_badge(webhooks_subscriber.active) %></td>
3546
<td><%= webhooks_subscriber.subscriptions&.sort&.join(', ') %></td>
3647
<td><%= webhooks_subscriber.events.order(:created_at).last&.created_at %></td>

0 commit comments

Comments
 (0)