0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-18 10:41:29 -05:00

🐛 Fix components with compont-root on library for v2 migration

This commit is contained in:
Alejandro Alonso 2024-02-07 12:45:05 +01:00 committed by Andrés Moya
parent bdb16109d5
commit 0c682ea75d

View file

@ -424,6 +424,18 @@
(-> file-data
(d/update-when :components #(reduce-kv fix-component % %)))))
fix-components-with-component-root
;;In v1 no components in the library should have component-root
(fn [file-data]
(letfn [(fix-container [container]
(d/update-when container :objects update-vals fix-shape))
(fix-shape [shape]
(dissoc shape :component-root))]
(-> file-data
(update :components update-vals fix-container))))
fix-misc-shape-issues
(fn [file-data]
(letfn [(fix-container [container]
@ -930,6 +942,7 @@
(fix-big-geometry-shapes)
(fix-shape-geometry)
(fix-empty-components)
(fix-components-with-component-root)
(fix-completly-broken-shapes)
(fix-bad-children)
(fix-broken-parents)