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

Merge pull request #631 from penpot/bugfixing

Bugfixing
This commit is contained in:
Andrey Antukh 2021-02-11 13:21:25 +01:00 committed by GitHub
commit 608b5cc9f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 12 deletions

View file

@ -23,6 +23,10 @@
- Fix unexpected exception when uploading image - Fix unexpected exception when uploading image
- Fix 404 when acces shared link [#615](https://github.com/penpot/penpot/issues/615) - Fix 404 when acces shared link [#615](https://github.com/penpot/penpot/issues/615)
- Fix show correct error when google auth is disabled - 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)
- Fix problem when pasting URL's copied from the browser url bar
### Community contributions by (Thank you! :heart:) ### Community contributions by (Thank you! :heart:)

View file

@ -38,6 +38,10 @@
width: 18%; width: 18%;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
.grid-item-th {
text-align: initial;
}
&.placeholder { &.placeholder {
min-width: 115px; min-width: 115px;
max-width: 115px; max-width: 115px;

View file

@ -417,3 +417,12 @@
(update [_ state] (update [_ state]
(assoc-in state [:viewer-local :hover] (when hover? id))))) (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})))))))

View file

@ -1481,11 +1481,16 @@
ptk/WatchEvent ptk/WatchEvent
(watch [_ state stream] (watch [_ state stream]
(try (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) image-data (wapi/extract-images paste-data)
text-data (wapi/extract-text paste-data) text-data (wapi/extract-text paste-data)
decoded-data (and (t/transit? text-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 (cond
(seq image-data) (seq image-data)
(rx/from (map paste-image image-data)) (rx/from (map paste-image image-data))
@ -1495,7 +1500,9 @@
(rx/filter #(= :copied-shapes (:type %))) (rx/filter #(= :copied-shapes (:type %)))
(rx/map #(paste-shape % in-viewport?))) (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)) (rx/of (paste-text text-data))
:else :else

View file

@ -196,14 +196,9 @@
on-goback on-goback
(mf/use-callback (mf/use-callback
(mf/deps project-id file-id page-id anonymous?) (mf/deps project)
(fn [] (st/emitf (dv/go-to-dashboard project)))
(if anonymous?
(st/emit! (rt/nav :login))
(st/emit! (rt/nav :workspace
{:project-id project-id
:file-id file-id}
{:page-id page-id})))))
on-edit on-edit
(mf/use-callback (mf/use-callback
(mf/deps project-id file-id page-id) (mf/deps project-id file-id page-id)

View file

@ -173,13 +173,15 @@
options (dom/get-element-by-class "element-options") options (dom/get-element-by-class "element-options")
assets (dom/get-element-by-class "assets-bar") assets (dom/get-element-by-class "assets-bar")
cpicker (dom/get-element-by-class "colorpicker-tooltip") cpicker (dom/get-element-by-class "colorpicker-tooltip")
palette (dom/get-element-by-class "color-palette")
self (mf/ref-val self-ref) self (mf/ref-val self-ref)
selecting? (mf/ref-val selecting-ref)] selecting? (mf/ref-val selecting-ref)]
(when-not (or (and options (.contains options target)) (when-not (or (and options (.contains options target))
(and assets (.contains assets target)) (and assets (.contains assets target))
(and self (.contains self target)) (and self (.contains self target))
(and cpicker (.contains cpicker target))) (and cpicker (.contains cpicker target))
(and palette (.contains palette target)))
(do (do
(if selecting? (if selecting?