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

Add plugins whitelisting for removing the disclaimer

This commit is contained in:
alonso.torres 2024-10-14 11:59:06 +02:00
parent 9d2f484aa3
commit 6d8c183160
3 changed files with 8 additions and 6 deletions

View file

@ -111,6 +111,7 @@
(def flex-help-uri (obj/get global "penpotGridHelpURI" "https://help.penpot.app/user-guide/flexible-layouts/")) (def flex-help-uri (obj/get global "penpotGridHelpURI" "https://help.penpot.app/user-guide/flexible-layouts/"))
(def grid-help-uri (obj/get global "penpotGridHelpURI" "https://help.penpot.app/user-guide/flexible-layouts/")) (def grid-help-uri (obj/get global "penpotGridHelpURI" "https://help.penpot.app/user-guide/flexible-layouts/"))
(def plugins-list-uri (obj/get global "penpotPluginsListUri" "https://penpot-docs-plugins.pages.dev/plugins/getting-started/#examples")) (def plugins-list-uri (obj/get global "penpotPluginsListUri" "https://penpot-docs-plugins.pages.dev/plugins/getting-started/#examples"))
(def plugins-whitelist (into #{} (obj/get global "penpotPluginsWhitelist" [])))
(defn- normalize-uri (defn- normalize-uri
[uri-str] [uri-str]

View file

@ -9,7 +9,7 @@
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.data.macros :as dm] [app.common.data.macros :as dm]
[app.config :as cf] [app.config :as cfg]
[app.main.data.events :as ev] [app.main.data.events :as ev]
[app.main.data.modal :as modal] [app.main.data.modal :as modal]
[app.main.data.plugins :as dp] [app.main.data.plugins :as dp]
@ -169,7 +169,7 @@
[:> i18n/tr-html* [:> i18n/tr-html*
{:class (stl/css :discover) {:class (stl/css :discover)
:on-click #(st/emit! (ptk/event ::ev/event {::ev/name "open-plugins-list"})) :on-click #(st/emit! (ptk/event ::ev/event {::ev/name "open-plugins-list"}))
:content (tr "workspace.plugins.discover" cf/plugins-list-uri)}]) :content (tr "workspace.plugins.discover" cfg/plugins-list-uri)}])
[:hr] [:hr]
@ -178,7 +178,7 @@
[:div {:class (stl/css :plugins-empty-logo)} i/puzzle] [:div {:class (stl/css :plugins-empty-logo)} i/puzzle]
[:div {:class (stl/css :plugins-empty-text)} (tr "workspace.plugins.empty-plugins")] [:div {:class (stl/css :plugins-empty-text)} (tr "workspace.plugins.empty-plugins")]
[:a {:class (stl/css :plugins-link) [:a {:class (stl/css :plugins-link)
:href cf/plugins-list-uri :href cfg/plugins-list-uri
:target "_blank" :target "_blank"
:on-click #(st/emit! (ptk/event ::ev/event {::ev/name "open-plugins-list"}))} :on-click #(st/emit! (ptk/event ::ev/event {::ev/name "open-plugins-list"}))}
(tr "workspace.plugins.plugin-list-link") i/external-link]] (tr "workspace.plugins.plugin-list-link") i/external-link]]
@ -287,8 +287,9 @@
[:div {:class (stl/css :modal-content)} [:div {:class (stl/css :modal-content)}
[:& plugins-permission-list {:permissions permissions}] [:& plugins-permission-list {:permissions permissions}]
[:div {:class (stl/css :permissions-disclaimer)} (when-not (contains? cfg/plugins-whitelist host)
(tr "workspace.plugins.permissions.disclaimer")]] [:div {:class (stl/css :permissions-disclaimer)}
(tr "workspace.plugins.permissions.disclaimer")])]
[:div {:class (stl/css :modal-footer)} [:div {:class (stl/css :modal-footer)}
[:div {:class (stl/css :action-buttons)} [:div {:class (stl/css :action-buttons)}

View file

@ -272,7 +272,7 @@ div.input-error {
@include bodySmallTypography; @include bodySmallTypography;
padding: $s-16; padding: $s-16;
background: var(--color-background-quaternary); background: var(--color-background-quaternary);
color: var(--color-foreground-quaternary); color: var(--color-foreground-primary);
border-radius: $br-4; border-radius: $br-4;
} }