From 2a30b2737c36edcf3334abd245f34e6e07bab116 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sun, 6 Nov 2016 19:03:58 +0100 Subject: [PATCH] Many other naming changes on state keys. --- src/uxbox/main/data/colors.cljs | 20 ++++++++++---------- src/uxbox/main/data/icons.cljs | 12 ++++++------ src/uxbox/main/data/images.cljs | 12 ++++++------ src/uxbox/main/state.cljs | 6 +++--- src/uxbox/main/ui/dashboard/colors.cljs | 4 ++-- src/uxbox/main/ui/dashboard/icons.cljs | 2 +- src/uxbox/main/ui/dashboard/images.cljs | 2 +- src/uxbox/main/ui/workspace/images.cljs | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/uxbox/main/data/colors.cljs b/src/uxbox/main/data/colors.cljs index a5fc1c20c..641b8ad05 100644 --- a/src/uxbox/main/data/colors.cljs +++ b/src/uxbox/main/data/colors.cljs @@ -62,7 +62,7 @@ (-apply-update [_ state] (let [{:keys [version value]} data] (-> state - (update :color-collections merge value) + (update :colors-collections merge value) (assoc ::version version))))) (defn collections-fetched @@ -97,7 +97,7 @@ :created-at (dt/now) :type :own :colors #{}}] - (assoc-in state [:color-collections id] item))) + (assoc-in state [:colors-collections id] item))) rs/WatchEvent (-apply-watch [_ state stream] @@ -117,7 +117,7 @@ (let [builtin? #(= :builtin (:type %)) xform (remove (comp builtin? second)) version (get state ::version) - value (->> (get state :color-collections) + value (->> (get state :colors-collections) (into {} xform)) store {:key "color-collections" :version version @@ -135,7 +135,7 @@ (defrecord RenameCollection [id name] rs/UpdateEvent (-apply-update [_ state] - (assoc-in state [:color-collections id :name] name)) + (assoc-in state [:colors-collections id :name] name)) rs/WatchEvent (-apply-watch [_ state s] @@ -150,7 +150,7 @@ (defrecord DeleteCollection [id] rs/UpdateEvent (-apply-update [_ state] - (update state :color-collections dissoc id)) + (update state :colors-collections dissoc id)) rs/WatchEvent (-apply-watch [_ state s] @@ -168,7 +168,7 @@ rs/UpdateEvent (-apply-update [_ state] (let [replacer #(-> (disj % from) (conj to))] - (update-in state [:color-collections id :colors] (fnil replacer #{})))) + (update-in state [:colors-collections id :colors] (fnil replacer #{})))) rs/WatchEvent (-apply-watch [_ state s] @@ -184,7 +184,7 @@ (defrecord RemoveColors [id colors] rs/UpdateEvent (-apply-update [_ state] - (update-in state [:color-collections id :colors] + (update-in state [:colors-collections id :colors] #(set/difference % colors))) rs/WatchEvent @@ -228,7 +228,7 @@ rs/UpdateEvent (-apply-update [_ state] (let [selected (get-in state [:dashboard :colors :selected])] - (update-in state [:color-collections id :colors] set/union selected))) + (update-in state [:colors-collections id :colors] set/union selected))) rs/WatchEvent (-apply-watch [_ state stream] @@ -246,8 +246,8 @@ (-apply-update [_ state] (let [selected (get-in state [:dashboard :colors :selected])] (-> state - (update-in [:color-collections from :colors] set/difference selected) - (update-in [:color-collections to :colors] set/union selected)))) + (update-in [:colors-collections from :colors] set/difference selected) + (update-in [:colors-collections to :colors] set/union selected)))) rs/WatchEvent (-apply-watch [_ state stream] diff --git a/src/uxbox/main/data/icons.cljs b/src/uxbox/main/data/icons.cljs index b4c7f6f02..ca34ed46f 100644 --- a/src/uxbox/main/data/icons.cljs +++ b/src/uxbox/main/data/icons.cljs @@ -63,7 +63,7 @@ (reduce (fn [state item] (let [id (:id item) item (assoc item :type :own)] - (assoc-in state [:icon-collections id] item))) + (assoc-in state [:icons-collections id] item))) state items))) @@ -90,7 +90,7 @@ rs/UpdateEvent (-apply-update [_ state] (let [{:keys [id] :as item} (assoc item :type :own)] - (update state :icon-collections assoc id item))) + (update state :icons-collections assoc id item))) rs/WatchEvent (-apply-watch [_ state stream] @@ -124,7 +124,7 @@ (defrecord CollectionUpdated [item] rs/UpdateEvent (-apply-update [_ state] - (update-in state [:icon-collections (:id item)] merge item))) + (update-in state [:icons-collections (:id item)] merge item))) (defn collection-updated [item] @@ -135,7 +135,7 @@ (defrecord UpdateCollection [id] rs/WatchEvent (-apply-watch [_ state s] - (let [item (get-in state [:icon-collections id])] + (let [item (get-in state [:icons-collections id])] (->> (rp/req :update/icon-collection item) (rx/map :payload) (rx/map collection-updated))))) @@ -149,7 +149,7 @@ (defrecord RenameCollection [id name] rs/UpdateEvent (-apply-update [_ state] - (assoc-in state [:icon-collections id :name] name)) + (assoc-in state [:icons-collections id :name] name)) rs/WatchEvent (-apply-watch [_ state s] @@ -164,7 +164,7 @@ (defrecord DeleteCollection [id] rs/UpdateEvent (-apply-update [_ state] - (update state :icon-collections dissoc id)) + (update state :icons-collections dissoc id)) rs/WatchEvent (-apply-watch [_ state s] diff --git a/src/uxbox/main/data/images.cljs b/src/uxbox/main/data/images.cljs index 7c6799380..a1693020f 100644 --- a/src/uxbox/main/data/images.cljs +++ b/src/uxbox/main/data/images.cljs @@ -63,7 +63,7 @@ (reduce (fn [state item] (let [id (:id item) item (assoc item :type :own)] - (assoc-in state [:image-collections id] item))) + (assoc-in state [:images-collections id] item))) state items))) @@ -90,7 +90,7 @@ rs/UpdateEvent (-apply-update [_ state] (let [{:keys [id] :as item} (assoc item :type :own)] - (update state :image-collections assoc id item))) + (update state :images-collections assoc id item))) rs/WatchEvent (-apply-watch [_ state stream] @@ -124,7 +124,7 @@ (defrecord CollectionUpdated [item] rs/UpdateEvent (-apply-update [_ state] - (update-in state [:image-collections (:id item)] merge item))) + (update-in state [:images-collections (:id item)] merge item))) (defn collection-updated [item] @@ -135,7 +135,7 @@ (defrecord UpdateCollection [id] rs/WatchEvent (-apply-watch [_ state s] - (let [item (get-in state [:image-collections id])] + (let [item (get-in state [:images-collections id])] (->> (rp/req :update/image-collection item) (rx/map :payload) (rx/map collection-updated))))) @@ -149,7 +149,7 @@ (defrecord RenameCollection [id name] rs/UpdateEvent (-apply-update [_ state] - (assoc-in state [:image-collections id :name] name)) + (assoc-in state [:images-collections id :name] name)) rs/WatchEvent (-apply-watch [_ state s] @@ -164,7 +164,7 @@ (defrecord DeleteCollection [id] rs/UpdateEvent (-apply-update [_ state] - (update state :image-collections dissoc id)) + (update state :images-collections dissoc id)) rs/WatchEvent (-apply-watch [_ state s] diff --git a/src/uxbox/main/state.cljs b/src/uxbox/main/state.cljs index 97ff9b4c4..662443252 100644 --- a/src/uxbox/main/state.cljs +++ b/src/uxbox/main/state.cljs @@ -33,11 +33,11 @@ :undo {} :profile nil :workspace nil - :image-collections nil - :color-collections colors/collections - :icon-collections nil + :images-collections nil :images nil + :icons-collections nil :icons nil + :colors-collections colors/collections :shapes nil :projects nil :pages nil}) diff --git a/src/uxbox/main/ui/dashboard/colors.cljs b/src/uxbox/main/ui/dashboard/colors.cljs index 5adf00555..325ddd970 100644 --- a/src/uxbox/main/ui/dashboard/colors.cljs +++ b/src/uxbox/main/ui/dashboard/colors.cljs @@ -33,7 +33,7 @@ (l/derive st/state))) (def collections-ref - (-> (l/key :color-collections) + (-> (l/key :colors-collections) (l/derive st/state))) ;; --- Page Title @@ -105,7 +105,7 @@ (tr "ds.num-elements" (t/c colors))]]))) (def ^:private storage-num-colors-ref - (-> (comp (l/in [:color-collections nil :colors]) + (-> (comp (l/in [:colors-collections nil :colors]) (l/lens count)) (l/derive st/state))) diff --git a/src/uxbox/main/ui/dashboard/icons.cljs b/src/uxbox/main/ui/dashboard/icons.cljs index 6d7acbca1..afde64f90 100644 --- a/src/uxbox/main/ui/dashboard/icons.cljs +++ b/src/uxbox/main/ui/dashboard/icons.cljs @@ -56,7 +56,7 @@ (l/derive st/state))) (def ^:private collections-ref - (-> (l/key :icon-collections) + (-> (l/key :icons-collections) (l/derive st/state))) (def ^:private icons-ref diff --git a/src/uxbox/main/ui/dashboard/images.cljs b/src/uxbox/main/ui/dashboard/images.cljs index 7d687fbfd..6e7ee8059 100644 --- a/src/uxbox/main/ui/dashboard/images.cljs +++ b/src/uxbox/main/ui/dashboard/images.cljs @@ -52,7 +52,7 @@ (l/derive st/state))) (def ^:private collections-ref - (-> (l/key :image-collections) + (-> (l/key :images-collections) (l/derive st/state))) (def ^:private images-ref diff --git a/src/uxbox/main/ui/workspace/images.cljs b/src/uxbox/main/ui/workspace/images.cljs index c72970db9..8f9f33103 100644 --- a/src/uxbox/main/ui/workspace/images.cljs +++ b/src/uxbox/main/ui/workspace/images.cljs @@ -28,7 +28,7 @@ (l/derive st/state))) (def ^:private collections-ref - (-> (l/key :image-collections) + (-> (l/key :images-collections) (l/derive st/state))) (def ^:private images-ref