From daee27194016504652367ea276081105d7b38f7f Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Tue, 16 Sep 2025 12:19:56 -0500 Subject: [PATCH] Style show view --- app/views/webhooks/_delivery.html.erb | 6 +- app/views/webhooks/edit.html.erb | 6 +- app/views/webhooks/show.html.erb | 79 +++++++++++++-------------- 3 files changed, 42 insertions(+), 49 deletions(-) diff --git a/app/views/webhooks/_delivery.html.erb b/app/views/webhooks/_delivery.html.erb index ced1f9e2c..8dba2f474 100644 --- a/app/views/webhooks/_delivery.html.erb +++ b/app/views/webhooks/_delivery.html.erb @@ -1,8 +1,8 @@ <%= tag.li id: dom_id(delivery), class: token_list(delivery.succeeded? && "delivery--succeeded") do %> -
+ <%= delivery.state %> -
-
+ +
<%= time_tag delivery.created_at, time_ago_in_words(delivery.created_at) %>
<% end %> diff --git a/app/views/webhooks/edit.html.erb b/app/views/webhooks/edit.html.erb index 8084c8b74..a036d4b5b 100644 --- a/app/views/webhooks/edit.html.erb +++ b/app/views/webhooks/edit.html.erb @@ -3,15 +3,13 @@ <% content_for :header do %> <%= render "filters/menu", user_filtering: @user_filtering %>
- <%= link_to collection_webhooks_path, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> + <%= link_to @webhook, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> ← - Webhooks + <%= @page_title %> <% end %>
- -

<%= @page_title %>

<% end %>
diff --git a/app/views/webhooks/show.html.erb b/app/views/webhooks/show.html.erb index a14cefe85..f4edfa392 100644 --- a/app/views/webhooks/show.html.erb +++ b/app/views/webhooks/show.html.erb @@ -2,54 +2,50 @@ <% content_for :header do %> <%= render "filters/menu", user_filtering: @user_filtering %> +
+ <%= link_to collection_webhooks_path, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> + + ← + Webhooks + + <% end %> +
- <%= link_to collection_webhooks_path, class: "header__title btn borderless txt-large", style: "--btn-padding: 0.25ch 1ch 0.25ch 0.75ch; view-transistion-name: webhooks-title;", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> - - ← - Webhooks - - <% end %> -<% end %> - -
-
- <%= link_to edit_collection_webhook_path(@webhook.collection_id, @webhook), class: "user-edit-link btn" do %> +
+ <%= link_to edit_collection_webhook_path(@webhook.collection_id, @webhook), class: "btn" do %> <%= icon_tag "pencil" %> Edit <% end %> +
+<% end %> -
-

<%= @webhook.name %>

-
- +
+
+

<%= @webhook.name %>

+ <%= @webhook.url %> +
+ <% unless @webhook.active? %>
- <%= @webhook.url %> + <%= button_to "Reactivate", collection_webhook_activation_path(@webhook), method: :post %>
+ <% end %> - <% unless @webhook.active? %> -
- <%= button_to "Reactivate", collection_webhook_activation_path(@webhook), method: :post %> -
- <% end %> +
+

Secret

+ <%= @webhook.signing_secret %> +

+ We'll send a X-Webhook-Signature header with each request. + You can generate a HMAC using SHA256 of the request body with this secret + to verify that the request came from us. +

+
-
-

Secret

-

- <%= @webhook.signing_secret %> -

-

- We'll sent a `X-Webhook-Signature` header with each request. - You can generate a HMAC using SHA256 of the request body with this secret - to verify that the request came from us. -

-
- -
-

Subscribed to

+
+

Subscribed to

<% if @webhook.subscribed_actions.empty? %> -

This Webhook doesn't subscribe to any actions. It will never trigger.

+

This Webhook isn't subscribed to any events. It will never trigger.

<% else %> -

    +
      <% @webhook.subscribed_actions.each do |action| %>
    • <%= action.humanize %>
    • <% end %> @@ -57,15 +53,14 @@ <% end %>
-
-

Deliveries

+
+

Deliveries

<% if @webhook.deliveries.empty? %> -

This Webhook hasn't been triggered yet

+

This Webhook hasn't been triggered yet

<% else %> -

    +
      <%= render partial: "webhooks/delivery", collection: @webhook.deliveries.ordered.limit(20), as: :delivery %>
    <% end %>
-