mirror of
https://github.com/penpot/penpot.git
synced 2025-02-19 05:15:44 -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)
|
;; --- Update Workspace Settings (Form)
|
||||||
|
|
||||||
(defrecord UpdateWorkspaceSettings [id options]
|
(defrecord SubmitWorkspaceSettings [id options]
|
||||||
rs/WatchEvent
|
rs/WatchEvent
|
||||||
(-apply-watch [_ state s]
|
(-apply-watch [_ state s]
|
||||||
(rx/of (udp/update-page-options id options)
|
(rx/of (udp/update-page-options id options)
|
||||||
|
@ -211,16 +211,16 @@
|
||||||
(-apply-effect [_ state]
|
(-apply-effect [_ state]
|
||||||
(lightbox/close!)))
|
(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/y-axis [sc/required sc/integer [sc/in-range 2 100]]
|
||||||
:grid/x-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/alignment [sc/boolean]
|
||||||
:grid/color [sc/required sc/color]})
|
:grid/color [sc/required sc/color]})
|
||||||
|
|
||||||
(defn update-workspace-settings
|
(defn submit-workspace-settings
|
||||||
[id data]
|
[id data]
|
||||||
(let [schema update-workspace-settings-schema
|
(let [schema submit-workspace-settings-schema
|
||||||
[errors data] (sc/validate data schema)]
|
[errors data] (sc/validate data schema)]
|
||||||
(if errors
|
(if errors
|
||||||
(udf/assign-errors :workspace/settings 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?))))
|
(rs/emit! (assign-field-value :grid/alignment checked?))))
|
||||||
(on-submit [event]
|
(on-submit [event]
|
||||||
(dom/prevent-default event)
|
(dom/prevent-default event)
|
||||||
(rs/emit! (udw/update-workspace-settings (:id page) form)))]
|
(rs/emit! (udw/submit-workspace-settings (:id page) form)))]
|
||||||
(html
|
(html
|
||||||
[:form {:on-submit on-submit}
|
[:form {:on-submit on-submit}
|
||||||
[:span.lightbox-label "Grid size"]
|
[:span.lightbox-label "Grid size"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue