💄 Add minor cosmetic changes to file-update ns

This commit is contained in:
Andrey Antukh 2024-02-12 10:23:06 +01:00
parent 4cd9237f47
commit 722cb6351d

View file

@ -42,7 +42,6 @@
(def ^:private (def ^:private
schema:update-file schema:update-file
(sm/define
[:map {:title "update-file"} [:map {:title "update-file"}
[:id ::sm/uuid] [:id ::sm/uuid]
[:session-id ::sm/uuid] [:session-id ::sm/uuid]
@ -54,18 +53,17 @@
[:changes [:vector ::cpc/change]] [:changes [:vector ::cpc/change]]
[:hint-origin {:optional true} :keyword] [:hint-origin {:optional true} :keyword]
[:hint-events {:optional true} [:vector :string]]]]] [:hint-events {:optional true} [:vector :string]]]]]
[:skip-validate {:optional true} :boolean]])) [:skip-validate {:optional true} :boolean]])
(def ^:private (def ^:private
schema:update-file-result schema:update-file-result
(sm/define
[:vector {:title "update-file-result"} [:vector {:title "update-file-result"}
[:map [:map
[:changes [:vector ::cpc/change]] [:changes [:vector ::cpc/change]]
[:file-id ::sm/uuid] [:file-id ::sm/uuid]
[:id ::sm/uuid] [:id ::sm/uuid]
[:revn {:min 0} :int] [:revn {:min 0} :int]
[:session-id ::sm/uuid]]])) [:session-id ::sm/uuid]]])
;; --- HELPERS ;; --- HELPERS
@ -73,14 +71,26 @@
;; to all clients using it. ;; to all clients using it.
(def ^:private library-change-types (def ^:private library-change-types
#{:add-color :mod-color :del-color #{:add-color
:add-media :mod-media :del-media :mod-color
:add-component :mod-component :del-component :restore-component :del-color
:add-typography :mod-typography :del-typography}) :add-media
:mod-media
:del-media
:add-component
:mod-component
:del-component
:restore-component
:add-typography
:mod-typography
:del-typography})
(def ^:private file-change-types (def ^:private file-change-types
#{:add-obj :mod-obj :del-obj #{:add-obj
:reg-objects :mov-objects}) :mod-obj
:del-obj
:reg-objects
:mov-objects})
(defn- library-change? (defn- library-change?
[{:keys [type] :as change}] [{:keys [type] :as change}]