mirror of
https://github.com/penpot/penpot.git
synced 2025-05-07 06:16:27 +02:00
🐛 Fix incorrect feature handling
This commit is contained in:
parent
352c13881a
commit
b3456d0f7f
2 changed files with 7 additions and 11 deletions
|
@ -50,12 +50,8 @@
|
||||||
"styles/v2"
|
"styles/v2"
|
||||||
"layout/grid"})
|
"layout/grid"})
|
||||||
|
|
||||||
;; A set of features enabled by default for each file, they are
|
;; A set of features enabled by default
|
||||||
;; implicit and are enabled by default and can't be disabled. The
|
(def default-features
|
||||||
;; features listed in this set are mainly freatures addedby file
|
|
||||||
;; migrations process, so all features referenced in migrations should
|
|
||||||
;; be here.
|
|
||||||
(def default-enabled-features
|
|
||||||
#{"fdata/shape-data-type"
|
#{"fdata/shape-data-type"
|
||||||
"styles/v2"
|
"styles/v2"
|
||||||
"layout/grid"
|
"layout/grid"
|
||||||
|
@ -81,7 +77,8 @@
|
||||||
(def no-migration-features
|
(def no-migration-features
|
||||||
(-> #{"fdata/objects-map"
|
(-> #{"fdata/objects-map"
|
||||||
"fdata/pointer-map"
|
"fdata/pointer-map"
|
||||||
"layout/grid"}
|
"layout/grid"
|
||||||
|
"fdata/shape-data-type"}
|
||||||
(into frontend-only-features)))
|
(into frontend-only-features)))
|
||||||
|
|
||||||
(sm/def! ::features
|
(sm/def! ::features
|
||||||
|
@ -132,7 +129,7 @@
|
||||||
(defn get-enabled-features
|
(defn get-enabled-features
|
||||||
"Get the globally enabled fratures set."
|
"Get the globally enabled fratures set."
|
||||||
[flags]
|
[flags]
|
||||||
(into default-enabled-features xf-flag-to-feature flags))
|
(into default-features xf-flag-to-feature flags))
|
||||||
|
|
||||||
(defn get-team-enabled-features
|
(defn get-team-enabled-features
|
||||||
"Get the team enabled features.
|
"Get the team enabled features.
|
||||||
|
@ -246,7 +243,7 @@
|
||||||
(let [not-supported (-> (or source-features #{})
|
(let [not-supported (-> (or source-features #{})
|
||||||
(set/difference destination-features)
|
(set/difference destination-features)
|
||||||
(set/difference no-migration-features)
|
(set/difference no-migration-features)
|
||||||
(set/difference default-enabled-features)
|
(set/difference default-features)
|
||||||
(seq))]
|
(seq))]
|
||||||
(when not-supported
|
(when not-supported
|
||||||
(ex/raise :type :restriction
|
(ex/raise :type :restriction
|
||||||
|
@ -258,7 +255,7 @@
|
||||||
(let [not-supported (-> (or destination-features #{})
|
(let [not-supported (-> (or destination-features #{})
|
||||||
(set/difference source-features)
|
(set/difference source-features)
|
||||||
(set/difference no-migration-features)
|
(set/difference no-migration-features)
|
||||||
(set/difference default-enabled-features)
|
(set/difference default-features)
|
||||||
(seq))]
|
(seq))]
|
||||||
(when not-supported
|
(when not-supported
|
||||||
(ex/raise :type :restriction
|
(ex/raise :type :restriction
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
(-> global-enabled-features
|
(-> global-enabled-features
|
||||||
(set/union (:features/runtime state #{}))
|
(set/union (:features/runtime state #{}))
|
||||||
(set/intersection cfeat/no-migration-features)
|
(set/intersection cfeat/no-migration-features)
|
||||||
(set/union cfeat/default-enabled-features)
|
|
||||||
(set/union (:features/team state #{}))))
|
(set/union (:features/team state #{}))))
|
||||||
|
|
||||||
(def features-ref
|
(def features-ref
|
||||||
|
|
Loading…
Add table
Reference in a new issue