From 2bdaa03c72f35f85f7281dae1d0aa26a9234a0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Por=C4=99bski?= Date: Fri, 8 Dec 2023 12:47:05 +0100 Subject: [PATCH] Display webhook secret key in admin panel --- .../spree/admin/webhooks_subscribers/index.html.erb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/views/spree/admin/webhooks_subscribers/index.html.erb b/app/views/spree/admin/webhooks_subscribers/index.html.erb index cde691c294..4c44f8258f 100644 --- a/app/views/spree/admin/webhooks_subscribers/index.html.erb +++ b/app/views/spree/admin/webhooks_subscribers/index.html.erb @@ -15,6 +15,7 @@ <% if defined?(Spree::Vendor) && can?(:manage, Spree::Vendor) && !current_spree_vendor %> <%= Spree.t(:vendor) %> <% end %> + <%= Spree.t('admin.webhooks_subscribers.secret_key') %> <%= Spree.t('admin.active') %> <%= Spree.t('admin.webhooks_subscribers.subscriptions') %> <%= Spree.t('admin.webhooks_subscribers.time_of_last_event') %> @@ -31,6 +32,16 @@ <%= link_to webhooks_subscriber.vendor.name, spree.admin_vendor_path(webhooks_subscriber.vendor) if webhooks_subscriber.vendor.present? %> <% end %> + +
+ <%= 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 %> +
+ <%= button_tag class: 'btn btn-link rounded', data: { action: 'click->password-toggle#password' } do %> + <%= svg_icon name: "view.svg", width: '18', height: '18' %> + <% end %> +
+
+ <%= active_badge(webhooks_subscriber.active) %> <%= webhooks_subscriber.subscriptions&.sort&.join(', ') %> <%= webhooks_subscriber.events.order(:created_at).last&.created_at %>