🐛 Fix several frontend validations

This commit is contained in:
Eva 2023-07-05 13:20:41 +02:00 committed by Andrey Antukh
parent acfeae8638
commit 49df4a9404
14 changed files with 88 additions and 53 deletions

View file

@ -658,7 +658,8 @@
(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)
:initial initial
:validators [(fm/validate-length :uri fm/max-uri-length-allowed (tr "team.webhooks.max-length"))])
on-success
(mf/use-fn
(fn [_]
@ -750,8 +751,7 @@
[:& fm/input {:type "checkbox"
:form form
:name :is-active
:label (tr "dashboard.webhooks.active")}]
]
:label (tr "dashboard.webhooks.active")}]]
[:div.explain (tr "dashboard.webhooks.active.explain")]]]
[:div.modal-footer