From 8f72faf27d9c6f9bafb0bd30cc5edcec3563d6fc Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 23 May 2023 16:04:47 +0200 Subject: [PATCH] :bug: Fix issues on penpot file import and components-v2 --- backend/src/app/rpc/commands/files.clj | 3 ++- common/src/app/common/types/container.cljc | 4 ++-- common/src/app/common/types/shape/text.cljc | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/src/app/rpc/commands/files.clj b/backend/src/app/rpc/commands/files.clj index 7e5a0ca85..d80f9b250 100644 --- a/backend/src/app/rpc/commands/files.clj +++ b/backend/src/app/rpc/commands/files.clj @@ -268,7 +268,8 @@ (binding [pmap/*tracked* (atom {})] (let [data (ctf/migrate-to-components-v2 data) features (conj features "components/v2") - modified-at (dt/now)] + modified-at (dt/now) + features (db/create-array conn "text" features)] (db/update! conn :file {:data (blob/encode data) :modified-at modified-at diff --git a/common/src/app/common/types/container.cljc b/common/src/app/common/types/container.cljc index 56b67a500..f61756da5 100644 --- a/common/src/app/common/types/container.cljc +++ b/common/src/app/common/types/container.cljc @@ -14,7 +14,6 @@ [app.common.types.component :as ctk] [app.common.types.components-list :as ctkl] [app.common.types.pages-list :as ctpl] - [app.common.types.shape :as cts] [app.common.types.shape-tree :as ctst] [app.common.uuid :as uuid])) @@ -34,7 +33,7 @@ [:path {:optional true} [:maybe :string]] [:modified-at {:optional true} ::sm/inst] [:objects {:optional true} - [:map-of {:gen/max 10} ::sm/uuid ::cts/shape]]]) + [:map-of {:gen/max 10} ::sm/uuid :map]]]) (def container? (sm/pred-fn ::container)) @@ -68,6 +67,7 @@ (defn get-shape [container shape-id] + (dm/assert! "expected valid container" (container? container)) diff --git a/common/src/app/common/types/shape/text.cljc b/common/src/app/common/types/shape/text.cljc index 837b67ac9..3eb0918f8 100644 --- a/common/src/app/common/types/shape/text.cljc +++ b/common/src/app/common/types/shape/text.cljc @@ -31,7 +31,8 @@ [:type [:= "paragraph"]] [:key {:optional true} :string] [:fills {:optional true} - [:vector {:gen/max 2} ::shape/fill]] + [:maybe + [:vector {:gen/max 2} ::shape/fill]]] [:font-family {:optional true} :string] [:font-size {:optional true} :string] [:font-style {:optional true} :string]