mirror of
https://github.com/penpot/penpot.git
synced 2025-07-27 21:39:32 +02:00
🐛 Clean invalid library colors
This commit is contained in:
parent
accd5226d7
commit
9ea3f81bc4
1 changed files with 15 additions and 4 deletions
|
@ -1019,8 +1019,8 @@
|
||||||
[data _]
|
[data _]
|
||||||
(let [update-colors
|
(let [update-colors
|
||||||
(fn [colors]
|
(fn [colors]
|
||||||
(into {} (filter #(-> % val types.color/valid-color?) colors)))]
|
(into {} (filter #(-> % val types.color/valid-library-color?) colors)))]
|
||||||
(update data :colors update-colors)))
|
(d/update-when data :colors update-colors)))
|
||||||
|
|
||||||
(defmethod migrate-data "legacy-52"
|
(defmethod migrate-data "legacy-52"
|
||||||
[data _]
|
[data _]
|
||||||
|
@ -1034,7 +1034,6 @@
|
||||||
|
|
||||||
(update data :pages-index d/update-vals update-page)))
|
(update data :pages-index d/update-vals update-page)))
|
||||||
|
|
||||||
|
|
||||||
(defmethod migrate-data "legacy-53"
|
(defmethod migrate-data "legacy-53"
|
||||||
[data _]
|
[data _]
|
||||||
(migrate-data data "legacy-26"))
|
(migrate-data data "legacy-26"))
|
||||||
|
@ -1517,6 +1516,17 @@
|
||||||
|
|
||||||
(d/update-when data :colors d/update-vals clear-color)))
|
(d/update-when data :colors d/update-vals clear-color)))
|
||||||
|
|
||||||
|
(defmethod migrate-data "0009-clean-library-colors"
|
||||||
|
[data _]
|
||||||
|
(d/update-when data :colors
|
||||||
|
(fn [colors]
|
||||||
|
(reduce-kv (fn [colors id color]
|
||||||
|
(if (types.color/valid-library-color? color)
|
||||||
|
colors
|
||||||
|
(dissoc colors id)))
|
||||||
|
colors
|
||||||
|
colors))))
|
||||||
|
|
||||||
(def available-migrations
|
(def available-migrations
|
||||||
(into (d/ordered-set)
|
(into (d/ordered-set)
|
||||||
["legacy-2"
|
["legacy-2"
|
||||||
|
@ -1580,4 +1590,5 @@
|
||||||
"0005-deprecate-image-type"
|
"0005-deprecate-image-type"
|
||||||
"0006-fix-old-texts-fills"
|
"0006-fix-old-texts-fills"
|
||||||
"0007-clear-invalid-strokes-and-fills-v2"
|
"0007-clear-invalid-strokes-and-fills-v2"
|
||||||
"0008-fix-library-colors-v4"]))
|
"0008-fix-library-colors-v4"
|
||||||
|
"0009-clean-library-colors"]))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue