0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

Merge pull request #3989 from penpot/niwinz-staging-bugfix-1

🐛 Bugfixes
This commit is contained in:
Aitor Moreno 2024-01-15 16:03:23 +01:00 committed by GitHub
commit 03931da17a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 5 deletions

View file

@ -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

View file

@ -6,4 +6,4 @@
(ns app.common.files.defaults)
(def version 37)
(def version 38)

View file

@ -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))))

View file

@ -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]

View file

@ -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