From 7feda98eb31b865455a7cdd874760d2fb762dfcc Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 23 Jun 2023 12:22:33 +0200 Subject: [PATCH 1/3] :sparkles: Add the ability to disable the google fonts provider --- CHANGES.md | 3 ++- frontend/src/app/config.cljs | 3 ++- frontend/src/app/main/fonts.cljs | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7206595e3f..f0a812b249 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # CHANGELOG -## :rocket: 1.19.0 +## 1.19.0 ### :boom: Breaking changes & Deprecations @@ -13,6 +13,7 @@ - Show interactions setting at the view mode [Taiga #1330](https://tree.taiga.io/project/penpot/issue/1330) - Improve dashboard performance related to thumbnails; now the thumbnails are rendered as bitmap images. +- Add the ability to disable google fonts provider with the `disable-google-fonts-provider` flag ### :bug: Bugs fixed diff --git a/frontend/src/app/config.cljs b/frontend/src/app/config.cljs index 70a7e23d3b..4e3bda7cef 100644 --- a/frontend/src/app/config.cljs +++ b/frontend/src/app/config.cljs @@ -59,7 +59,8 @@ :webworker)) (def default-flags - [:enable-newsletter-subscription]) + [:enable-newsletter-subscription + :enable-google-fonts-provider]) (defn- parse-flags [global] diff --git a/frontend/src/app/main/fonts.cljs b/frontend/src/app/main/fonts.cljs index 96091475c5..b041904636 100644 --- a/frontend/src/app/main/fonts.cljs +++ b/frontend/src/app/main/fonts.cljs @@ -65,7 +65,9 @@ (merge db (d/index-by :id fonts)))))) (register! :builtin local-fonts) -(register! :google google-fonts) + +(when (contains? cf/flags :google-fonts-provider) + (register! :google google-fonts)) (defn get-font-data [id] (get @fontsdb id)) From 81658c90d111281e4f944d1c80165d3d4a5374fa Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 23 Jun 2023 12:33:34 +0200 Subject: [PATCH 2/3] :sparkles: Add the ability to disable dashboard templates section --- CHANGES.md | 1 + frontend/src/app/config.cljs | 1 + frontend/src/app/main/ui/dashboard.cljs | 24 +++++++++++-------- .../src/app/main/ui/dashboard/projects.cljs | 7 ++++-- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f0a812b249..9b9b326f1f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ - Improve dashboard performance related to thumbnails; now the thumbnails are rendered as bitmap images. - Add the ability to disable google fonts provider with the `disable-google-fonts-provider` flag +- Add the ability to disable dashboard templates section with the `disable-dashboard-templates-section` flag ### :bug: Bugs fixed diff --git a/frontend/src/app/config.cljs b/frontend/src/app/config.cljs index 4e3bda7cef..704ac51b86 100644 --- a/frontend/src/app/config.cljs +++ b/frontend/src/app/config.cljs @@ -60,6 +60,7 @@ (def default-flags [:enable-newsletter-subscription + :enable-dashboard-templates-section :enable-google-fonts-provider]) (defn- parse-flags diff --git a/frontend/src/app/main/ui/dashboard.cljs b/frontend/src/app/main/ui/dashboard.cljs index 881928a88d..5df57f6603 100644 --- a/frontend/src/app/main/ui/dashboard.cljs +++ b/frontend/src/app/main/ui/dashboard.cljs @@ -9,6 +9,7 @@ [app.common.data :as d] [app.common.math :as mth] [app.common.spec :as us] + [app.config :as cf] [app.main.data.dashboard :as dd] [app.main.data.dashboard.shortcuts :as sc] [app.main.data.events :as ev] @@ -259,11 +260,13 @@ :projects projects :profile profile :default-project-id default-project-id}] - [:& templates-section {:profile profile - :project project - :default-project-id default-project-id - :team team - :content-width @content-width}]] + + (when (contains? cf/flags :dashboard-templates-section) + [:& templates-section {:profile profile + :project project + :default-project-id default-project-id + :team team + :content-width @content-width}])] :dashboard-fonts [:& fonts-page {:team team}] @@ -275,11 +278,12 @@ (when project [:* [:& files-section {:team team :project project}] - [:& templates-section {:profile profile - :project project - :default-project-id default-project-id - :team team - :content-width @content-width}]]) + (when (contains? cf/flags :dashboard-templates-section) + [:& templates-section {:profile profile + :project project + :default-project-id default-project-id + :team team + :content-width @content-width}])]) :dashboard-search [:& search-page {:team team diff --git a/frontend/src/app/main/ui/dashboard/projects.cljs b/frontend/src/app/main/ui/dashboard/projects.cljs index 95a9648db6..eca9a2342e 100644 --- a/frontend/src/app/main/ui/dashboard/projects.cljs +++ b/frontend/src/app/main/ui/dashboard/projects.cljs @@ -9,6 +9,7 @@ [app.common.data :as d] [app.common.geom.point :as gpt] [app.common.math :as mth] + [app.config :as cf] [app.main.data.dashboard :as dd] [app.main.data.events :as ev] [app.main.data.messages :as msg] @@ -195,7 +196,7 @@ on-menu-click (mf/use-fn (fn [event] - (dom/prevent-default event) + (dom/prevent-default event) (let [client-position (dom/get-client-position event) position (if (and (nil? (:y client-position)) (nil? (:x client-position))) @@ -414,7 +415,9 @@ (when team-hero? [:& team-hero {:team team :close-fn close-banner}]) - (when (or (not tutorial-viewed?) (not walkthrough-viewed?)) + (when (and (contains? cf/flags :dashboard-templates-section) + (or (not tutorial-viewed?) + (not walkthrough-viewed?))) [:div.hero-projects (when (and (not tutorial-viewed?) (:is-default team)) [:& tutorial-project From b138550c0d2306b2af84df82d2e631a5d13038ab Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 23 Jun 2023 12:59:03 +0200 Subject: [PATCH 3/3] :bug: Fix issue on awsns http handler --- backend/src/app/http/awsns.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/app/http/awsns.clj b/backend/src/app/http/awsns.clj index a761ad8d96..681e7045f7 100644 --- a/backend/src/app/http/awsns.clj +++ b/backend/src/app/http/awsns.clj @@ -36,10 +36,10 @@ (defmethod ig/init-key ::routes [_ {:keys [::wrk/executor] :as cfg}] - (letfn [(handler [request respond _] + (letfn [(handler [request] (let [data (-> request yrq/body slurp)] (px/run! executor #(handle-request cfg data))) - (respond {::yrs/status 200}))] + {::yrs/status 200})] ["/sns" {:handler handler :allowed-methods #{:post}}]))