mirror of
https://github.com/penpot/penpot.git
synced 2025-02-15 11:38:24 -05:00
Improve form related events naming.
This commit is contained in:
parent
58a86872f5
commit
8b23cd6f3c
2 changed files with 6 additions and 6 deletions
|
@ -200,7 +200,7 @@
|
|||
|
||||
;; --- Update Workspace Settings (Form)
|
||||
|
||||
(defrecord UpdateWorkspaceSettings [id options]
|
||||
(defrecord SubmitWorkspaceSettings [id options]
|
||||
rs/WatchEvent
|
||||
(-apply-watch [_ state s]
|
||||
(rx/of (udp/update-page-options id options)
|
||||
|
@ -211,16 +211,16 @@
|
|||
(-apply-effect [_ state]
|
||||
(lightbox/close!)))
|
||||
|
||||
(def update-workspace-settings-schema
|
||||
(def submit-workspace-settings-schema
|
||||
{:grid/y-axis [sc/required sc/integer [sc/in-range 2 100]]
|
||||
:grid/x-axis [sc/required sc/integer [sc/in-range 2 100]]
|
||||
:grid/alignment [sc/boolean]
|
||||
:grid/color [sc/required sc/color]})
|
||||
|
||||
(defn update-workspace-settings
|
||||
(defn submit-workspace-settings
|
||||
[id data]
|
||||
(let [schema update-workspace-settings-schema
|
||||
(let [schema submit-workspace-settings-schema
|
||||
[errors data] (sc/validate data schema)]
|
||||
(if errors
|
||||
(udf/assign-errors :workspace/settings errors)
|
||||
(UpdateWorkspaceSettings. id data))))
|
||||
(SubmitWorkspaceSettings. id data))))
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
(rs/emit! (assign-field-value :grid/alignment checked?))))
|
||||
(on-submit [event]
|
||||
(dom/prevent-default event)
|
||||
(rs/emit! (udw/update-workspace-settings (:id page) form)))]
|
||||
(rs/emit! (udw/submit-workspace-settings (:id page) form)))]
|
||||
(html
|
||||
[:form {:on-submit on-submit}
|
||||
[:span.lightbox-label "Grid size"]
|
||||
|
|
Loading…
Add table
Reference in a new issue