use webhook urls instead of encrypted configs

This commit is contained in:
Alex Turchyn
2024-10-28 20:39:09 +02:00
committed by Pete Matsyburka
parent f669045362
commit 84edb6dbda
50 changed files with 1350 additions and 269 deletions
@@ -1,13 +1,13 @@
<%= render 'shared/turbo_modal', title: 'Webhook Secret' do %>
<%= form_for @encrypted_config, url: webhook_secret_index_path, method: :post, html: { class: 'space-y-4' }, data: { turbo_frame: :_top } do |f| %>
<%= render 'shared/turbo_modal', title: t('webhook_secret') do %>
<%= form_for @webhook_url, url: webhook_secret_path, method: :patch, html: { class: 'space-y-4' }, data: { turbo_frame: :_top } do |f| %>
<div class="space-y-2">
<%= f.fields_for :value, Struct.new(:key, :value).new(*@encrypted_config.value.to_a.first) do |ff| %>
<%= f.fields_for :secret, Struct.new(:key, :value).new(*@webhook_url.secret.to_a.first) do |ff| %>
<div class="form-control">
<%= ff.label :key, class: 'label' %>
<%= ff.label :key, t('key'), class: 'label' %>
<%= ff.text_field :key, class: 'base-input', placeholder: 'X-Example-Header' %>
</div>
<div class="form-control">
<%= ff.label :value, class: 'label' %>
<%= ff.label :value, t('value'), class: 'label' %>
<%= ff.text_field :value, class: 'base-input' %>
</div>
<% end %>