mirror of
https://github.com/penpot/penpot.git
synced 2025-07-06 14:07:16 +02:00
🐛 Fix incorrect state management on webhooks crud
This commit is contained in:
parent
91ececa59e
commit
e8ea61ee78
3 changed files with 34 additions and 24 deletions
|
@ -637,7 +637,9 @@
|
|||
{::mf/register modal/components
|
||||
::mf/register-as :webhook}
|
||||
[{:keys [webhook] :as props}]
|
||||
(let [initial (mf/use-memo (fn [] (or webhook {:is-active false :mtype "application/json"})))
|
||||
;; FIXME: this is a workaround because input fields do not support rendering hooks
|
||||
(let [initial (mf/use-memo (fn [] (or (some-> webhook (update :uri str))
|
||||
{:is-active false :mtype "application/json"})))
|
||||
form (fm/use-form :spec ::webhook-form
|
||||
:initial initial)
|
||||
on-success
|
||||
|
@ -735,8 +737,6 @@
|
|||
]
|
||||
[:div.explain (tr "dashboard.webhooks.active.explain")]]]
|
||||
|
||||
|
||||
|
||||
[:div.modal-footer
|
||||
[:div.action-buttons
|
||||
[:input.cancel-button
|
||||
|
@ -827,7 +827,7 @@
|
|||
{:success? (nil? error-code)
|
||||
:text last-delivery-text}]]]
|
||||
[:div.table-field.uri
|
||||
[:div (:uri webhook)]]
|
||||
[:div (dm/str (:uri webhook))]]
|
||||
[:div.table-field.active
|
||||
[:div (if (:is-active webhook)
|
||||
(tr "labels.active")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue