From 0c682ea75d510d3345b5e83ae97591292517932f Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 7 Feb 2024 12:45:05 +0100 Subject: [PATCH] :bug: Fix components with compont-root on library for v2 migration --- backend/src/app/features/components_v2.clj | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/src/app/features/components_v2.clj b/backend/src/app/features/components_v2.clj index 3506e415e..3591d9dc2 100644 --- a/backend/src/app/features/components_v2.clj +++ b/backend/src/app/features/components_v2.clj @@ -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)