0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-31 19:39:07 -05:00

🐛 Fix error when importing files with touched components

This commit is contained in:
alonso.torres 2025-01-09 16:58:40 +01:00 committed by Alejandro Alonso
parent 1cbeafe85c
commit d16513be9d
4 changed files with 26 additions and 3 deletions

View file

@ -1,5 +1,11 @@
# CHANGELOG
## 2.4.1
### :bug: Bugs fixed
- Fix error when importing files with touched components [Taiga #9625](https://tree.taiga.io/project/penpot/issue/9625)
## 2.4.0
### :rocket: Epics and highlights

View file

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

View file

@ -1130,6 +1130,21 @@
(update :pages-index dissoc nil)
(update :pages-index update-vals update-page))))
(defn migrate-up-59
[data]
(letfn [(fix-touched [elem]
(cond-> elem (string? elem) keyword))
(update-shape [shape]
(d/update-when shape :touched #(into #{} (map fix-touched) %)))
(update-container [container]
(d/update-when container :objects update-vals update-shape))]
(-> data
(update :pages-index update-vals update-container)
(update :components update-vals update-container))))
(def migrations
"A vector of all applicable migrations"
[{:id 2 :migrate-up migrate-up-2}
@ -1178,5 +1193,6 @@
{:id 54 :migrate-up migrate-up-54}
{:id 55 :migrate-up migrate-up-55}
{:id 56 :migrate-up migrate-up-56}
{:id 57 :migrate-up migrate-up-57}])
{:id 57 :migrate-up migrate-up-57}
{:id 59 :migrate-up migrate-up-59}])

View file

@ -191,7 +191,8 @@
[:grow-type {:optional true}
[::sm/one-of grow-types]]
[:applied-tokens {:optional true} ::cto/applied-tokens]
[:plugin-data {:optional true} ::ctpg/plugin-data]])
[:plugin-data {:optional true} ::ctpg/plugin-data]
[:touched {:optional true} [:maybe [:set :keyword]]]])
(def schema:group-attrs
[:map {:title "GroupAttrs"}