diff --git a/common/src/app/common/files/changes.cljc b/common/src/app/common/files/changes.cljc index 1a45f64bf0..78845e8f4f 100644 --- a/common/src/app/common/files/changes.cljc +++ b/common/src/app/common/files/changes.cljc @@ -390,13 +390,13 @@ [:before-path [:maybe [:vector :string]]] [:before-group [:maybe :boolean]]]] - [:move-token-set-group-before - [:map {:title "MoveTokenSetGroupBefore"} - [:type [:= :move-token-set-group-before]] + [:move-token-set-group + [:map {:title "MoveTokenSetGroup"} + [:type [:= :move-token-set-group]] [:from-path [:vector :string]] [:to-path [:vector :string]] [:before-path [:maybe [:vector :string]]] - [:before-group? [:maybe :boolean]]]] + [:before-group [:maybe :boolean]]]] [:set-token-theme [:map {:title "SetTokenThemeChange"} @@ -1057,11 +1057,11 @@ (ctob/ensure-tokens-lib) (ctob/move-set from-path to-path before-path before-group)))) -(defmethod process-change :move-token-set-group-before - [data {:keys [from-path to-path before-path before-group?]}] +(defmethod process-change :move-token-set-group + [data {:keys [from-path to-path before-path before-group]}] (update data :tokens-lib #(-> % (ctob/ensure-tokens-lib) - (ctob/move-set-group from-path to-path before-path before-group?)))) + (ctob/move-set-group from-path to-path before-path before-group)))) ;; === Operations diff --git a/common/src/app/common/files/changes_builder.cljc b/common/src/app/common/files/changes_builder.cljc index f955214d65..aa360d2926 100644 --- a/common/src/app/common/files/changes_builder.cljc +++ b/common/src/app/common/files/changes_builder.cljc @@ -824,19 +824,19 @@ :before-group prev-before-group?}) (apply-changes-local))) -(defn move-token-set-group-before +(defn move-token-set-group [changes {:keys [from-path to-path before-path before-group? prev-before-path prev-before-group?]}] (-> changes - (update :redo-changes conj {:type :move-token-set-group-before + (update :redo-changes conj {:type :move-token-set-group :from-path from-path :to-path to-path :before-path before-path - :before-group? before-group?}) - (update :undo-changes conj {:type :move-token-set-group-before + :before-group before-group?}) + (update :undo-changes conj {:type :move-token-set-group :from-path to-path :to-path from-path :before-path prev-before-path - :before-group? prev-before-group?}) + :before-group prev-before-group?}) (apply-changes-local))) (defn set-tokens-lib diff --git a/common/src/app/common/logic/tokens.cljc b/common/src/app/common/logic/tokens.cljc index 50fdc7b8ae..3e7ca4a08d 100644 --- a/common/src/app/common/logic/tokens.cljc +++ b/common/src/app/common/logic/tokens.cljc @@ -140,7 +140,7 @@ (defn generate-move-token-set-group "Create changes for dropping a token set or token set group. Throws for impossible moves" - [changes tokens-lib drop-opts] - (if-let [drop-opts' (calculate-move-token-set-or-set-group tokens-lib drop-opts)] - (pcb/move-token-set-group-before changes drop-opts') + [changes tokens-lib params] + (if-let [params (calculate-move-token-set-or-set-group tokens-lib params)] + (pcb/move-token-set-group changes params) changes))