mirror of
https://github.com/penpot/penpot.git
synced 2025-03-20 19:51:23 -05:00
Merge pull request #297 from tokens-studio/feature-flag
✨ Add feature flag for design tokens
This commit is contained in:
commit
bbf5fce0c9
11 changed files with 36 additions and 28 deletions
|
@ -31,7 +31,7 @@ spec:
|
||||||
- name: PENPOT_PUBLIC_URI
|
- name: PENPOT_PUBLIC_URI
|
||||||
value: {{ .Values.config.publicURI | quote }}
|
value: {{ .Values.config.publicURI | quote }}
|
||||||
- name: PENPOT_FLAGS
|
- name: PENPOT_FLAGS
|
||||||
value: "$PENPOT_FLAGS {{ .Values.config.flags }}"
|
value: "{{ .Values.config.flags }}"
|
||||||
- name: PENPOT_SECRET_KEY
|
- name: PENPOT_SECRET_KEY
|
||||||
value: {{ .Values.config.apiSecretKey | quote }}
|
value: {{ .Values.config.apiSecretKey | quote }}
|
||||||
- name: PENPOT_DATABASE_URI
|
- name: PENPOT_DATABASE_URI
|
||||||
|
|
|
@ -278,7 +278,7 @@ config:
|
||||||
## @param config.apiSecretKey A random secret key needed for persistent user sessions. Generate with `openssl rand -hex 16` for example.
|
## @param config.apiSecretKey A random secret key needed for persistent user sessions. Generate with `openssl rand -hex 16` for example.
|
||||||
##
|
##
|
||||||
publicURI: "http://localhost:8080"
|
publicURI: "http://localhost:8080"
|
||||||
flags: "enable-registration enable-login disable-demo-users disable-demo-warning"
|
flags: "enable-registration enable-login disable-demo-users disable-demo-warning enable-feature-design-tokens"
|
||||||
apiSecretKey: "b46a12cb4bedc6b9df8cb3f18c708b65"
|
apiSecretKey: "b46a12cb4bedc6b9df8cb3f18c708b65"
|
||||||
|
|
||||||
## @param config.postgresql.host The PostgreSQL host to connect to.
|
## @param config.postgresql.host The PostgreSQL host to connect to.
|
||||||
|
|
|
@ -37,7 +37,7 @@ values:
|
||||||
secretKeys:
|
secretKeys:
|
||||||
accessKeyIDKey: CONSOLE_ACCESS_KEY
|
accessKeyIDKey: CONSOLE_ACCESS_KEY
|
||||||
secretAccessKey: CONSOLE_SECRET_KEY
|
secretAccessKey: CONSOLE_SECRET_KEY
|
||||||
flags: 'enable-smtp'
|
flags: 'enable-smtp enable-feature-design-tokens'
|
||||||
smtp:
|
smtp:
|
||||||
enabled: true
|
enabled: true
|
||||||
host: mailslurper
|
host: mailslurper
|
||||||
|
|
|
@ -19,7 +19,7 @@ values:
|
||||||
secret: db-penpot-secrets
|
secret: db-penpot-secrets
|
||||||
superUser: db-penpot-superuser-secret
|
superUser: db-penpot-superuser-secret
|
||||||
config:
|
config:
|
||||||
flags: 'enable-smtp'
|
flags: 'enable-smtp enable-feature-design-tokens'
|
||||||
assets:
|
assets:
|
||||||
storageBackend: assets-s3
|
storageBackend: assets-s3
|
||||||
s3:
|
s3:
|
||||||
|
|
|
@ -28,7 +28,8 @@ export PENPOT_FLAGS="\
|
||||||
enable-webhooks \
|
enable-webhooks \
|
||||||
enable-access-tokens \
|
enable-access-tokens \
|
||||||
enable-file-validation \
|
enable-file-validation \
|
||||||
enable-file-schema-validation";
|
enable-file-schema-validation \
|
||||||
|
disable-feature-design-tokens";
|
||||||
|
|
||||||
# Default deletion delay for devenv
|
# Default deletion delay for devenv
|
||||||
export PENPOT_DELETION_DELAY="24h"
|
export PENPOT_DELETION_DELAY="24h"
|
||||||
|
|
|
@ -20,7 +20,8 @@ export PENPOT_FLAGS="\
|
||||||
enable-file-snapshot \
|
enable-file-snapshot \
|
||||||
enable-access-tokens \
|
enable-access-tokens \
|
||||||
enable-file-validation \
|
enable-file-validation \
|
||||||
enable-file-schema-validation";
|
enable-file-schema-validation \
|
||||||
|
disable-feature-design-tokens";
|
||||||
|
|
||||||
export OPTIONS="
|
export OPTIONS="
|
||||||
-A:jmx-remote -A:dev \
|
-A:jmx-remote -A:dev \
|
||||||
|
|
|
@ -49,7 +49,8 @@
|
||||||
"components/v2"
|
"components/v2"
|
||||||
"styles/v2"
|
"styles/v2"
|
||||||
"layout/grid"
|
"layout/grid"
|
||||||
"plugins/runtime"})
|
"plugins/runtime"
|
||||||
|
"design-tokens/v1"})
|
||||||
|
|
||||||
;; A set of features enabled by default
|
;; A set of features enabled by default
|
||||||
(def default-features
|
(def default-features
|
||||||
|
@ -81,7 +82,8 @@
|
||||||
"fdata/pointer-map"
|
"fdata/pointer-map"
|
||||||
"layout/grid"
|
"layout/grid"
|
||||||
"fdata/shape-data-type"
|
"fdata/shape-data-type"
|
||||||
"plugins/runtime"}
|
"plugins/runtime"
|
||||||
|
"design-tokens/v1"}
|
||||||
(into frontend-only-features)))
|
(into frontend-only-features)))
|
||||||
|
|
||||||
(sm/register! ::features
|
(sm/register! ::features
|
||||||
|
@ -101,6 +103,7 @@
|
||||||
:feature-fdata-objects-map "fdata/objects-map"
|
:feature-fdata-objects-map "fdata/objects-map"
|
||||||
:feature-fdata-pointer-map "fdata/pointer-map"
|
:feature-fdata-pointer-map "fdata/pointer-map"
|
||||||
:feature-plugins "plugins/runtime"
|
:feature-plugins "plugins/runtime"
|
||||||
|
:feature-design-tokens "design-tokens/v1"
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
(defn migrate-legacy-features
|
(defn migrate-legacy-features
|
||||||
|
@ -308,5 +311,3 @@
|
||||||
:feature (first not-supported)
|
:feature (first not-supported)
|
||||||
:hint (str/ffmt "paste features '%' not enabled on the application"
|
:hint (str/ffmt "paste features '%' not enabled on the application"
|
||||||
(str/join "," not-supported))))))
|
(str/join "," not-supported))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
(watch [_ _ _]
|
(watch [_ _ _]
|
||||||
(when *assert*
|
(when *assert*
|
||||||
(->> (rx/from cfeat/no-migration-features)
|
(->> (rx/from cfeat/no-migration-features)
|
||||||
(rx/filter #(not (contains? cfeat/backend-only-features %)))
|
(rx/filter #(not (or (contains? cfeat/backend-only-features %) (= "design-tokens/v1" %))))
|
||||||
(rx/observe-on :async)
|
(rx/observe-on :async)
|
||||||
(rx/map enable-feature))))
|
(rx/map enable-feature))))
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
(def libraries (mf/create-context nil))
|
(def libraries (mf/create-context nil))
|
||||||
(def components-v2 (mf/create-context nil))
|
(def components-v2 (mf/create-context nil))
|
||||||
|
(def design-tokens (mf/create-context nil))
|
||||||
|
|
||||||
(def current-scroll (mf/create-context nil))
|
(def current-scroll (mf/create-context nil))
|
||||||
(def current-zoom (mf/create-context nil))
|
(def current-zoom (mf/create-context nil))
|
||||||
|
|
|
@ -176,6 +176,7 @@
|
||||||
file-ready? (mf/deref file-ready*)
|
file-ready? (mf/deref file-ready*)
|
||||||
|
|
||||||
components-v2? (features/use-feature "components/v2")
|
components-v2? (features/use-feature "components/v2")
|
||||||
|
design-tokens? (features/use-feature "design-tokens/v1")
|
||||||
|
|
||||||
background-color (:background-color wglobal)]
|
background-color (:background-color wglobal)]
|
||||||
|
|
||||||
|
@ -204,6 +205,7 @@
|
||||||
[:& (mf/provider ctx/current-team-id) {:value team-id}
|
[:& (mf/provider ctx/current-team-id) {:value team-id}
|
||||||
[:& (mf/provider ctx/current-page-id) {:value page-id}
|
[:& (mf/provider ctx/current-page-id) {:value page-id}
|
||||||
[:& (mf/provider ctx/components-v2) {:value components-v2?}
|
[:& (mf/provider ctx/components-v2) {:value components-v2?}
|
||||||
|
[:& (mf/provider ctx/design-tokens) {:value design-tokens?}
|
||||||
[:& (mf/provider ctx/workspace-read-only?) {:value read-only?}
|
[:& (mf/provider ctx/workspace-read-only?) {:value read-only?}
|
||||||
[:section {:class (stl/css :workspace)
|
[:section {:class (stl/css :workspace)
|
||||||
:style {:background-color background-color
|
:style {:background-color background-color
|
||||||
|
@ -215,4 +217,4 @@
|
||||||
:file file
|
:file file
|
||||||
:wglobal wglobal
|
:wglobal wglobal
|
||||||
:layout layout}]
|
:layout layout}]
|
||||||
[:& workspace-loader])]]]]]]]))
|
[:& workspace-loader])]]]]]]]]))
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.main.ui.components.tab-container :refer [tab-container tab-element]]
|
[app.main.ui.components.tab-container :refer [tab-container tab-element]]
|
||||||
[app.main.ui.context :as muc]
|
[app.main.ui.context :as ctx]
|
||||||
[app.main.ui.hooks.resize :refer [use-resize-hook]]
|
[app.main.ui.hooks.resize :refer [use-resize-hook]]
|
||||||
[app.main.ui.workspace.comments :refer [comments-sidebar]]
|
[app.main.ui.workspace.comments :refer [comments-sidebar]]
|
||||||
[app.main.ui.workspace.left-header :refer [left-header]]
|
[app.main.ui.workspace.left-header :refer [left-header]]
|
||||||
|
@ -40,6 +40,7 @@
|
||||||
mode-inspect? (= options-mode :inspect)
|
mode-inspect? (= options-mode :inspect)
|
||||||
project (mf/deref refs/workspace-project)
|
project (mf/deref refs/workspace-project)
|
||||||
|
|
||||||
|
design-tokens? (mf/use-ctx ctx/design-tokens)
|
||||||
|
|
||||||
section (cond (or mode-inspect? (contains? layout :layers)) :layers
|
section (cond (or mode-inspect? (contains? layout :layers)) :layers
|
||||||
(contains? layout :assets) :assets
|
(contains? layout :assets) :assets
|
||||||
|
@ -64,7 +65,7 @@
|
||||||
on-tab-change
|
on-tab-change
|
||||||
(mf/use-fn #(st/emit! (dw/go-to-layout %)))]
|
(mf/use-fn #(st/emit! (dw/go-to-layout %)))]
|
||||||
|
|
||||||
[:& (mf/provider muc/sidebar) {:value :left}
|
[:& (mf/provider ctx/sidebar) {:value :left}
|
||||||
[:aside {:ref parent-ref
|
[:aside {:ref parent-ref
|
||||||
:id "left-sidebar-aside"
|
:id "left-sidebar-aside"
|
||||||
:data-testid "left-sidebar"
|
:data-testid "left-sidebar"
|
||||||
|
@ -122,7 +123,8 @@
|
||||||
:title (tr "workspace.toolbar.assets")}
|
:title (tr "workspace.toolbar.assets")}
|
||||||
[:& assets-toolbox {:size (- size 58)}]])
|
[:& assets-toolbox {:size (- size 58)}]])
|
||||||
|
|
||||||
(when-not ^boolean mode-inspect?
|
(when (and (not ^boolean mode-inspect?)
|
||||||
|
design-tokens?)
|
||||||
[:& tab-element {:id :tokens
|
[:& tab-element {:id :tokens
|
||||||
:title "Tokens"}
|
:title "Tokens"}
|
||||||
[:& tokens-sidebar-tab]])]])]]))
|
[:& tokens-sidebar-tab]])]])]]))
|
||||||
|
@ -170,7 +172,7 @@
|
||||||
:on-change-section handle-change-section
|
:on-change-section handle-change-section
|
||||||
:on-expand handle-expand)]
|
:on-expand handle-expand)]
|
||||||
|
|
||||||
[:& (mf/provider muc/sidebar) {:value :right}
|
[:& (mf/provider ctx/sidebar) {:value :right}
|
||||||
[:aside {:class (stl/css-case :right-settings-bar true
|
[:aside {:class (stl/css-case :right-settings-bar true
|
||||||
:not-expand (not can-be-expanded?)
|
:not-expand (not can-be-expanded?)
|
||||||
:expanded (> size 276))
|
:expanded (> size 276))
|
||||||
|
|
Loading…
Add table
Reference in a new issue