From 2f4cb1974574cde94f531e383007b32b3d99b116 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 20 Nov 2024 12:43:51 +0100 Subject: [PATCH 1/3] :bug: Fix typo in keepAspectRatio #9336 --- frontend/src/app/plugins/format.cljs | 2 +- frontend/src/app/plugins/parser.cljs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/plugins/format.cljs b/frontend/src/app/plugins/format.cljs index 86a3d0d26..b39f422bc 100644 --- a/frontend/src/app/plugins/format.cljs +++ b/frontend/src/app/plugins/format.cljs @@ -103,7 +103,7 @@ ;; height: number; ;; mtype?: string; ;; id: string; -;; keepApectRatio?: boolean; +;; keepAspectRatio?: boolean; ;; }; (defn format-image [{:keys [name width height mtype id keep-aspect-ratio] :as image}] diff --git a/frontend/src/app/plugins/parser.cljs b/frontend/src/app/plugins/parser.cljs index 8d6137cc1..c58e6f1ea 100644 --- a/frontend/src/app/plugins/parser.cljs +++ b/frontend/src/app/plugins/parser.cljs @@ -66,7 +66,7 @@ ;; height: number; ;; mtype?: string; ;; id: string; -;; keepApectRatio?: boolean; +;; keepAspectRatio?: boolean; ;;} (defn parse-image-data [^js image-data] @@ -77,7 +77,7 @@ :width (obj/get image-data "width") :height (obj/get image-data "height") :mtype (obj/get image-data "mtype") - :keep-aspect-ratio (obj/get image-data "keepApectRatio")}))) + :keep-aspect-ratio (obj/get image-data "keepAspectRatio")}))) ;; export type Gradient = { ;; type: 'linear' | 'radial'; From 0cae9d6ad5c7c484e2220cdcf80cac8d1f781e4e Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Wed, 20 Nov 2024 15:37:08 +0100 Subject: [PATCH 2/3] :bug: Fix bad redirect after leaving team --- frontend/src/app/main/data/dashboard.cljs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/app/main/data/dashboard.cljs b/frontend/src/app/main/data/dashboard.cljs index 795c112e6..e4530c9f9 100644 --- a/frontend/src/app/main/data/dashboard.cljs +++ b/frontend/src/app/main/data/dashboard.cljs @@ -1118,6 +1118,9 @@ (rx/of (rt/nav :dashboard-projects {:team-id team-id})))))) ([team-id] (ptk/reify ::go-to-projects-1 + ptk/UpdateEvent + (update [_ state] + (assoc state :current-team-id team-id)) ptk/WatchEvent (watch [_ _ _] (rx/of (rt/nav :dashboard-projects {:team-id team-id})))))) From a8ee9be7b9a3d6cd82a5cf444cd7b94a38ca3101 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 22 Nov 2024 11:14:39 +0100 Subject: [PATCH 3/3] :bug: Fix text layer default name with v2 text editor --- .../app/main/ui/workspace/shapes/text/v2_editor.cljs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/workspace/shapes/text/v2_editor.cljs b/frontend/src/app/main/ui/workspace/shapes/text/v2_editor.cljs index 01444ff74..62f773d1d 100644 --- a/frontend/src/app/main/ui/workspace/shapes/text/v2_editor.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/text/v2_editor.cljs @@ -27,6 +27,13 @@ [app.util.text.content.styles :as styles] [rumext.v2 :as mf])) +(defn- gen-name + [editor] + (when (some? editor) + (let [editor-root (.-root editor) + result (.-textContent editor-root)] + (when (not= result "") result)))) + (defn- initialize-event-handlers "Internal editor events handler initializer/destructor" [shape-id content selection-ref editor-ref container-ref] @@ -51,6 +58,8 @@ instance (dwt/create-editor editor-node options) + update-name? (nil? content) + on-key-up (fn [event] (dom/stop-propagation event) @@ -60,7 +69,7 @@ on-blur (fn [] (when-let [content (content/dom->cljs (dwt/get-editor-root instance))] - (st/emit! (dwt/v2-update-text-shape-content shape-id content true))) + (st/emit! (dwt/v2-update-text-shape-content shape-id content update-name? (gen-name instance)))) (let [container-node (mf/ref-val container-ref)] (dom/set-style! container-node "opacity" 0)))