From 5336bbbe65ec383c42b4b83c0f26cd4d0281579e Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 11 Feb 2021 11:23:48 +0100 Subject: [PATCH 1/4] :bug: Fixes problem change color to texts from the palette --- CHANGES.md | 1 + frontend/src/app/main/ui/workspace/shapes/text/editor.cljs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index d94ed54fd..3eef0a134 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,7 @@ - Fix unexpected exception when uploading image - Fix 404 when acces shared link [#615](https://github.com/penpot/penpot/issues/615) - Fix show correct error when google auth is disabled +- Fix apply a color to a text selection from color palette was not working ### Community contributions by (Thank you! :heart:) diff --git a/frontend/src/app/main/ui/workspace/shapes/text/editor.cljs b/frontend/src/app/main/ui/workspace/shapes/text/editor.cljs index 68a143cfb..d279c16fa 100644 --- a/frontend/src/app/main/ui/workspace/shapes/text/editor.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/text/editor.cljs @@ -173,13 +173,15 @@ options (dom/get-element-by-class "element-options") assets (dom/get-element-by-class "assets-bar") cpicker (dom/get-element-by-class "colorpicker-tooltip") + palette (dom/get-element-by-class "color-palette") self (mf/ref-val self-ref) selecting? (mf/ref-val selecting-ref)] (when-not (or (and options (.contains options target)) (and assets (.contains assets target)) (and self (.contains self target)) - (and cpicker (.contains cpicker target))) + (and cpicker (.contains cpicker target)) + (and palette (.contains palette target))) (do (if selecting? From 7846682223b9a0eccd6d19135103f21cb55bf946 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 11 Feb 2021 11:34:24 +0100 Subject: [PATCH 2/4] :bug: Fixes logo icon navigation in viewer --- CHANGES.md | 1 + frontend/src/app/main/data/viewer.cljs | 9 +++++++++ frontend/src/app/main/ui/viewer/header.cljs | 11 +++-------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3eef0a134..1fe83c1b6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,6 +24,7 @@ - Fix 404 when acces shared link [#615](https://github.com/penpot/penpot/issues/615) - Fix show correct error when google auth is disabled - Fix apply a color to a text selection from color palette was not working +- Fix logo icon in viewer should go to dashboard ### Community contributions by (Thank you! :heart:) diff --git a/frontend/src/app/main/data/viewer.cljs b/frontend/src/app/main/data/viewer.cljs index 550b5ddb9..cc2a09ea6 100644 --- a/frontend/src/app/main/data/viewer.cljs +++ b/frontend/src/app/main/data/viewer.cljs @@ -417,3 +417,12 @@ (update [_ state] (assoc-in state [:viewer-local :hover] (when hover? id))))) + +(defn go-to-dashboard + ([] (go-to-dashboard nil)) + ([{:keys [team-id]}] + (ptk/reify ::go-to-dashboard + ptk/WatchEvent + (watch [_ state stream] + (let [team-id (or team-id (get-in state [:viewer-data :project :team-id]))] + (rx/of (rt/nav :dashboard-projects {:team-id team-id}))))))) diff --git a/frontend/src/app/main/ui/viewer/header.cljs b/frontend/src/app/main/ui/viewer/header.cljs index 59310a1de..c97025f13 100644 --- a/frontend/src/app/main/ui/viewer/header.cljs +++ b/frontend/src/app/main/ui/viewer/header.cljs @@ -196,14 +196,9 @@ on-goback (mf/use-callback - (mf/deps project-id file-id page-id anonymous?) - (fn [] - (if anonymous? - (st/emit! (rt/nav :login)) - (st/emit! (rt/nav :workspace - {:project-id project-id - :file-id file-id} - {:page-id page-id}))))) + (mf/deps project) + (st/emitf (dv/go-to-dashboard project))) + on-edit (mf/use-callback (mf/deps project-id file-id page-id) From 0a6e0d0f2c6e506aec00e8854f03a648ca46e70e Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 11 Feb 2021 11:58:45 +0100 Subject: [PATCH 3/4] :bug: Fixes dashboard preview text alignment --- CHANGES.md | 1 + frontend/resources/styles/main/partials/dashboard-grid.scss | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 1fe83c1b6..82508934e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,7 @@ - Fix show correct error when google auth is disabled - Fix apply a color to a text selection from color palette was not working - Fix logo icon in viewer should go to dashboard +- Fix text alignment in preview [#594](https://github.com/penpot/penpot/issues/594) ### Community contributions by (Thank you! :heart:) diff --git a/frontend/resources/styles/main/partials/dashboard-grid.scss b/frontend/resources/styles/main/partials/dashboard-grid.scss index d39ec4e3f..e877491e3 100644 --- a/frontend/resources/styles/main/partials/dashboard-grid.scss +++ b/frontend/resources/styles/main/partials/dashboard-grid.scss @@ -38,6 +38,10 @@ width: 18%; box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); + .grid-item-th { + text-align: initial; + } + &.placeholder { min-width: 115px; max-width: 115px; From 42a55015fa7ff01bfdb21d03e550ba8361b1b490 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 11 Feb 2021 13:03:41 +0100 Subject: [PATCH 4/4] :bug: Fixes problem when pasting URL's from the browser address bar --- CHANGES.md | 1 + frontend/src/app/main/data/workspace.cljs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 82508934e..1e1204380 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,7 @@ - Fix apply a color to a text selection from color palette was not working - Fix logo icon in viewer should go to dashboard - Fix text alignment in preview [#594](https://github.com/penpot/penpot/issues/594) +- Fix problem when pasting URL's copied from the browser url bar ### Community contributions by (Thank you! :heart:) diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index acb58b487..79d370c33 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -1481,11 +1481,16 @@ ptk/WatchEvent (watch [_ state stream] (try - (let [paste-data (wapi/read-from-paste-event event) + (let [objects (dwc/lookup-page-objects state) + paste-data (wapi/read-from-paste-event event) image-data (wapi/extract-images paste-data) text-data (wapi/extract-text paste-data) decoded-data (and (t/transit? text-data) - (t/decode text-data))] + (t/decode text-data)) + + edit-id (get-in state [:workspace-local :edition]) + is-editing-text? (and edit-id (= :text (get-in objects [edit-id :type])))] + (cond (seq image-data) (rx/from (map paste-image image-data)) @@ -1495,7 +1500,9 @@ (rx/filter #(= :copied-shapes (:type %))) (rx/map #(paste-shape % in-viewport?))) - (string? text-data) + ;; Some paste events can be fired while we're editing a text + ;; we forbid that scenario so the default behaviour is executed + (and (string? text-data) (not is-editing-text?)) (rx/of (paste-text text-data)) :else