mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 02:28:18 -05:00
✨ Add feature naming migration on file importation
This commit is contained in:
parent
2c8e29d1df
commit
daec51bb7d
2 changed files with 19 additions and 0 deletions
|
@ -719,6 +719,7 @@
|
||||||
file-id' (lookup-index file-id)
|
file-id' (lookup-index file-id)
|
||||||
|
|
||||||
thumbnails (:thumbnails file)
|
thumbnails (:thumbnails file)
|
||||||
|
file (update file :features cfeat/migrate-legacy-features)
|
||||||
|
|
||||||
features (-> enabled-features
|
features (-> enabled-features
|
||||||
(set/difference cfeat/frontend-only-features)
|
(set/difference cfeat/frontend-only-features)
|
||||||
|
|
|
@ -97,6 +97,24 @@
|
||||||
:feature-fdata-pointer-map "fdata/pointer-map"
|
:feature-fdata-pointer-map "fdata/pointer-map"
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
|
(defn migrate-legacy-features
|
||||||
|
"A helper that translates old feature names to new names"
|
||||||
|
[features]
|
||||||
|
(cond-> (or features #{})
|
||||||
|
(contains? features "storage/pointer-map")
|
||||||
|
(-> (conj "fdata/pointer-map")
|
||||||
|
(disj "storage/pointer-map"))
|
||||||
|
|
||||||
|
(contains? features "storage/objects-map")
|
||||||
|
(-> (conj "fdata/objects-map")
|
||||||
|
(disj "storage/objects-map"))
|
||||||
|
|
||||||
|
(or (contains? features "internal/geom-record")
|
||||||
|
(contains? features "internal/shape-record"))
|
||||||
|
(-> (conj "fdata/shape-data-type")
|
||||||
|
(disj "internal/geom-record")
|
||||||
|
(disj "internal/shape-record"))))
|
||||||
|
|
||||||
(def xf-supported-features
|
(def xf-supported-features
|
||||||
(filter (partial contains? supported-features)))
|
(filter (partial contains? supported-features)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue