diff --git a/backend/src/app/rpc/commands/files.clj b/backend/src/app/rpc/commands/files.clj index 61586ed52..f6b6c615d 100644 --- a/backend/src/app/rpc/commands/files.clj +++ b/backend/src/app/rpc/commands/files.clj @@ -357,7 +357,9 @@ f.is_shared, ft.media_id from file as f - left join file_thumbnail as ft on (ft.file_id = f.id and ft.revn = f.revn) + left join file_thumbnail as ft on (ft.file_id = f.id + and ft.revn = f.revn + and ft.deleted_at is null) where f.project_id = ? and f.deleted_at is null order by f.modified_at desc") @@ -660,7 +662,9 @@ row_number() over w as row_num from file as f inner join project as p on (p.id = f.project_id) - left join file_thumbnail as ft on (ft.file_id = f.id and ft.revn = f.revn) + left join file_thumbnail as ft on (ft.file_id = f.id + and ft.revn = f.revn + and ft.deleted_at is null) where p.team_id = ? and p.deleted_at is null and f.deleted_at is null diff --git a/common/src/app/common/files/defaults.cljc b/common/src/app/common/files/defaults.cljc index 862330dad..12e18921e 100644 --- a/common/src/app/common/files/defaults.cljc +++ b/common/src/app/common/files/defaults.cljc @@ -6,4 +6,4 @@ (ns app.common.files.defaults) -(def version 37) +(def version 38) diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index 86145dc97..c5952d571 100644 --- a/common/src/app/common/files/migrations.cljc +++ b/common/src/app/common/files/migrations.cljc @@ -671,3 +671,31 @@ (defmethod migrate 37 [data] (d/without-nils data)) + +(defmethod migrate 38 + [data] + (letfn [(fix-gradient [{:keys [type] :as gradient}] + (if (string? type) + (assoc gradient :type (keyword type)) + gradient)) + + (update-fill [fill] + (d/update-when fill :fill-color-gradient fix-gradient)) + + (update-object [object] + (d/update-when object :fills #(mapv update-fill %))) + + (update-shape [shape] + (let [shape (update-object shape)] + (if (cfh/text-shape? shape) + (-> shape + (update :content (partial txt/transform-nodes identity update-fill)) + (d/update-when :position-data #(mapv update-object %))) + shape))) + + (update-container [container] + (update container :objects update-vals update-shape))] + + (-> data + (update :pages-index update-vals update-container) + (update :components update-vals update-container)))) diff --git a/common/src/app/common/types/color.cljc b/common/src/app/common/types/color.cljc index 00823c631..804962894 100644 --- a/common/src/app/common/types/color.cljc +++ b/common/src/app/common/types/color.cljc @@ -56,7 +56,7 @@ (sm/define! ::gradient [:map {:title "Gradient"} - [:type [::sm/one-of #{:linear :radial "linear" "radial"}]] + [:type [::sm/one-of #{:linear :radial}]] [:start-x ::sm/safe-number] [:start-y ::sm/safe-number] [:end-x ::sm/safe-number] diff --git a/common/src/app/common/types/shape.cljc b/common/src/app/common/types/shape.cljc index fb6df4067..28289219d 100644 --- a/common/src/app/common/types/shape.cljc +++ b/common/src/app/common/types/shape.cljc @@ -375,8 +375,8 @@ {:frame-id uuid/zero :fills [{:fill-color clr/white :fill-opacity 1}] - :name "Board" :strokes [] + :name "Board" :shapes [] :hide-fill-on-export false}) @@ -390,11 +390,15 @@ (def ^:private minimal-group-attrs {:type :group :name "Group" + :fills [] + :strokes [] :shapes []}) (def ^:private minimal-bool-attrs {:type :bool :name "Bool" + :fills [] + :strokes [] :shapes []}) (def ^:private minimal-text-attrs