From 44e31f1890e97a8c625a2b94cec6d4515cff4700 Mon Sep 17 00:00:00 2001 From: Aitor Date: Tue, 25 Jul 2023 09:05:59 +0200 Subject: [PATCH 01/16] :books: Add missing change in CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 430f07ad1..fd77dae98 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -85,6 +85,7 @@ - Fix assets right click button for multiple selection [Taiga #5545](https://tree.taiga.io/project/penpot/issue/5545) - Fix problem with precision in resizes [Taiga #5623](https://tree.taiga.io/project/penpot/issue/5623) - Fix absolute positioned layouts not showing flex properties [Taiga #5630](https://tree.taiga.io/project/penpot/issue/5630) +- Fix text gradient handlers [Taiga #4047](https://tree.taiga.io/project/penpot/issue/4047) ### :arrow_up: Deps updates From 6e73e7cc715f18fdffef6336e47cf95fd3cef35f Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 25 Jul 2023 09:45:52 +0200 Subject: [PATCH 02/16] Fix incorrect style for layers tab titles --- .../resources/styles/main/partials/sidebar-layers.scss | 6 ++++++ frontend/resources/styles/main/partials/sidebar.scss | 9 +++++++++ frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/resources/styles/main/partials/sidebar-layers.scss b/frontend/resources/styles/main/partials/sidebar-layers.scss index f408a8fc4..2aa2eb5e4 100644 --- a/frontend/resources/styles/main/partials/sidebar-layers.scss +++ b/frontend/resources/styles/main/partials/sidebar-layers.scss @@ -416,6 +416,12 @@ span.element-name { .page-name { padding: 8px; margin-top: 8px; + color: #e3e3e3; + font-size: 0.875rem; + max-width: 90%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .icon-search { margin-top: 8px; diff --git a/frontend/resources/styles/main/partials/sidebar.scss b/frontend/resources/styles/main/partials/sidebar.scss index b1890d5ec..9112fe1a9 100644 --- a/frontend/resources/styles/main/partials/sidebar.scss +++ b/frontend/resources/styles/main/partials/sidebar.scss @@ -60,6 +60,15 @@ white-space: nowrap; } + span.pages-title { + color: #e3e3e3; + font-size: 0.875rem; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + span.tool-badge { border: 1px solid $color-primary; border-radius: $br2; diff --git a/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs b/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs index 087228815..f6397ad3b 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs @@ -270,7 +270,7 @@ [:div#sitemap.tool-window {:ref parent-ref :style #js {"--height" (str size "px")}} [:div.tool-window-bar - [:span (tr "workspace.sidebar.sitemap")] + [:span.pages-title (tr "workspace.sidebar.sitemap")] (if workspace-read-only? [:div.view-only-mode (tr "labels.view-only")] [:div.add-page {:on-click create} i/close]) From 1b31a02c14811f4924b7c6a4c4e257332e184f02 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Mon, 24 Jul 2023 09:46:30 +0200 Subject: [PATCH 03/16] :bug: Fix when user deletes one file during import it is impossible to finish importing of second file --- CHANGES.md | 1 + frontend/src/app/main/ui/dashboard/import.cljs | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fd77dae98..5edc09ba2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -86,6 +86,7 @@ - Fix problem with precision in resizes [Taiga #5623](https://tree.taiga.io/project/penpot/issue/5623) - Fix absolute positioned layouts not showing flex properties [Taiga #5630](https://tree.taiga.io/project/penpot/issue/5630) - Fix text gradient handlers [Taiga #4047](https://tree.taiga.io/project/penpot/issue/4047) +- Fix when user deletes one file during import it is impossible to finish importing of second file [Taiga #5656](https://tree.taiga.io/project/penpot/issue/5656) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/dashboard/import.cljs b/frontend/src/app/main/ui/dashboard/import.cljs index 1aa8fbc73..5a24b393a 100644 --- a/frontend/src/app/main/ui/dashboard/import.cljs +++ b/frontend/src/app/main/ui/dashboard/import.cljs @@ -337,18 +337,18 @@ (st/emit! (modal/hide)) (when on-finish-import (on-finish-import)))) + files (->> (:files @state) (filterv (comp not :deleted?))) + num-importing (+ - (->> @state :files (filter #(= (:status %) :importing)) count) + (->> files (filter #(= (:status %) :importing)) count) (:importing-templates @state)) - warning-files (->> @state :files (filter #(and (= (:status %) :import-finish) (d/not-empty? (:errors %)))) count) - success-files (->> @state :files (filter #(and (= (:status %) :import-finish) (empty? (:errors %)))) count) - pending-analysis? (> (->> @state :files (filter #(= (:status %) :analyzing)) count) 0) + warning-files (->> files (filter #(and (= (:status %) :import-finish) (d/not-empty? (:errors %)))) count) + success-files (->> files (filter #(and (= (:status %) :import-finish) (empty? (:errors %)))) count) + pending-analysis? (> (->> files (filter #(= (:status %) :analyzing)) count) 0) pending-import? (> num-importing 0) - files (->> (:files @state) (filterv (comp not :deleted?))) - ;; pending-import? (> (->> @state :files (filter #(= (:status %) :importing)) count) 0) - ;; files (->> (:files @state) (filterv (comp not :deleted?))) + valid-files? (or (some? template) (> (+ (->> files (filterv (fn [x] (not= (:status x) :analyze-error))) count)) 0))] From db7c4a926581c24662a5de44f27d4fdac898293a Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Mon, 24 Jul 2023 12:53:58 +0200 Subject: [PATCH 04/16] :bug: Fix export multiple images when only one of them has export settings --- CHANGES.md | 1 + .../sidebar/options/menus/exports.cljs | 41 +++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5edc09ba2..20c84c94b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -87,6 +87,7 @@ - Fix absolute positioned layouts not showing flex properties [Taiga #5630](https://tree.taiga.io/project/penpot/issue/5630) - Fix text gradient handlers [Taiga #4047](https://tree.taiga.io/project/penpot/issue/4047) - Fix when user deletes one file during import it is impossible to finish importing of second file [Taiga #5656](https://tree.taiga.io/project/penpot/issue/5656) +- Fix export multiple images when only one of them has export settings [Taiga #5649](https://tree.taiga.io/project/penpot/issue/5649) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/exports.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/exports.cljs index 191051640..879c49173 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/exports.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/exports.cljs @@ -26,18 +26,20 @@ (mf/defc exports-menu {::mf/wrap [#(mf/memo' % (mf/check-props ["ids" "values" "type" "page-id" "file-id"]))]} [{:keys [ids type values page-id file-id] :as props}] - (let [exports (:exports values []) + (let [exports (:exports values []) - state (mf/deref refs/export) - in-progress? (:in-progress state) + state (mf/deref refs/export) + in-progress? (:in-progress state) - sname (when (seqable? exports) - (let [shapes (wsh/lookup-shapes @st/state ids) - sname (-> shapes first :name) - suffix (-> exports first :suffix)] - (cond-> sname - (and (= 1 (count exports)) (some? suffix)) - (str suffix)))) + shapes-with-exports (->> (wsh/lookup-shapes @st/state ids) + (filter #(pos? (count (:exports %))))) + + sname (when (seqable? exports) + (let [sname (-> shapes-with-exports first :name) + suffix (-> exports first :suffix)] + (cond-> sname + (and (= 1 (count exports)) (some? suffix)) + (str suffix)))) scale-enabled? (mf/use-callback @@ -50,7 +52,22 @@ (fn [event] (dom/prevent-default event) (if (= :multiple type) - (st/emit! (de/show-workspace-export-dialog {:selected (reverse ids)})) + ;; I can select multiple shapes all of them with no export settings and one of them with only one + ;; In that situation we must export it directly + (if (and (= 1 (count shapes-with-exports)) (= 1 (-> shapes-with-exports first :exports count))) + (let [shape (-> shapes-with-exports first) + export (-> shape :exports first) + sname (:name shape) + suffix (:suffix export) + defaults {:page-id page-id + :file-id file-id + :name sname + :object-id (:id (first shapes-with-exports))}] + (cond-> sname + (some? suffix) + (str suffix)) + (st/emit! (de/request-simple-export {:export (merge export defaults)}))) + (st/emit! (de/show-workspace-export-dialog {:selected (reverse ids)}))) ;; In other all cases we only allowed to have a single ;; shape-id because multiple shape-ids are handled @@ -182,4 +199,4 @@ :disabled in-progress?} (if in-progress? (tr "workspace.options.exporting-object") - (tr "workspace.options.export-object" (c (count ids))))])])) + (tr "workspace.options.export-object" (c (count shapes-with-exports))))])])) From ea2e25b46d39cb906180b860a9734564e54d2f6a Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Mon, 24 Jul 2023 13:27:19 +0200 Subject: [PATCH 05/16] :bug: Making old-password non required again --- backend/src/app/rpc/commands/profile.clj | 3 ++- frontend/src/app/main/data/users.cljs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/app/rpc/commands/profile.clj b/backend/src/app/rpc/commands/profile.clj index 56b352ffc..c79e4c773 100644 --- a/backend/src/app/rpc/commands/profile.clj +++ b/backend/src/app/rpc/commands/profile.clj @@ -133,7 +133,8 @@ (def schema:update-profile-password [:map {:title "update-profile-password"} [:password [::sm/word-string {:max 500}]] - [:old-password [::sm/word-string {:max 500}]]]) + ;; Social registered users don't have old-password + [:old-password {:optional true} [:maybe [::sm/word-string {:max 500}]]]]) (sv/defmethod ::update-profile-password {:doc/added "1.0" diff --git a/frontend/src/app/main/data/users.cljs b/frontend/src/app/main/data/users.cljs index 9e042aa9b..92d2e8bb1 100644 --- a/frontend/src/app/main/data/users.cljs +++ b/frontend/src/app/main/data/users.cljs @@ -337,7 +337,8 @@ [:map {:closed true} [:password-1 :string] [:password-2 :string] - [:password-old :string]]) + ;; Social registered users don't have old-password + [:password-old {:optional true} [:maybe :string]]]) (defn update-password [data] From ec131382b37eb5672e6306d99101139ecd26c9dd Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Mon, 24 Jul 2023 15:39:22 +0200 Subject: [PATCH 06/16] :bug: Fix error when a user different than the thread creator edits a comment --- CHANGES.md | 1 + backend/src/app/rpc/commands/comments.clj | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 20c84c94b..ff0d415f6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -88,6 +88,7 @@ - Fix text gradient handlers [Taiga #4047](https://tree.taiga.io/project/penpot/issue/4047) - Fix when user deletes one file during import it is impossible to finish importing of second file [Taiga #5656](https://tree.taiga.io/project/penpot/issue/5656) - Fix export multiple images when only one of them has export settings [Taiga #5649](https://tree.taiga.io/project/penpot/issue/5649) +- Fix error when a user different than the thread creator edits a comment [Taiga #5647](https://tree.taiga.io/project/penpot/issue/5647) ### :arrow_up: Deps updates diff --git a/backend/src/app/rpc/commands/comments.clj b/backend/src/app/rpc/commands/comments.clj index e91529a3b..b8352f622 100644 --- a/backend/src/app/rpc/commands/comments.clj +++ b/backend/src/app/rpc/commands/comments.clj @@ -468,8 +468,8 @@ {::doc/added "1.15"} [{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id ::rpc/request-at id share-id content] :as params}] (db/with-atomic [conn pool] - (let [{:keys [thread-id] :as comment} (get-comment conn id ::db/for-update? true) - {:keys [file-id page-id owner-id] :as thread} (get-comment-thread conn thread-id ::db/for-update? true)] + (let [{:keys [thread-id owner-id] :as comment} (get-comment conn id ::db/for-update? true) + {:keys [file-id page-id] :as thread} (get-comment-thread conn thread-id ::db/for-update? true)] (files/check-comment-permissions! conn profile-id file-id share-id) From 955bf0ef9ea5dba9a6c8e209b7c459e7c14a1175 Mon Sep 17 00:00:00 2001 From: Eva Date: Mon, 24 Jul 2023 08:28:05 +0200 Subject: [PATCH 07/16] :bug: Fix empty reply comments --- frontend/src/app/main/ui/comments.cljs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/comments.cljs b/frontend/src/app/main/ui/comments.cljs index 0b0cdff15..fe4651d8b 100644 --- a/frontend/src/app/main/ui/comments.cljs +++ b/frontend/src/app/main/ui/comments.cljs @@ -214,7 +214,11 @@ :select-on-focus true :on-change on-change}] [:div.buttons - [:input.btn-primary {:type "button" :value "Post" :on-click on-submit*}] + [:input.btn-primary {:type "button" + :value "Post" + :on-click on-submit* + :disabled (or (fm/all-spaces? @content) + (str/empty-or-nil? @content))}] [:input.btn-secondary {:type "button" :value "Cancel" :on-click on-cancel}]]])) (mf/defc comment-item From 959e069ea9f1f0b798aa254f71631f3a5c14394a Mon Sep 17 00:00:00 2001 From: Eva Date: Mon, 24 Jul 2023 08:28:27 +0200 Subject: [PATCH 08/16] :bug: Fix unnecessary button --- CHANGES.md | 1 + frontend/src/app/main/ui/dashboard/import.cljs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index ff0d415f6..90980f908 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -89,6 +89,7 @@ - Fix when user deletes one file during import it is impossible to finish importing of second file [Taiga #5656](https://tree.taiga.io/project/penpot/issue/5656) - Fix export multiple images when only one of them has export settings [Taiga #5649](https://tree.taiga.io/project/penpot/issue/5649) - Fix error when a user different than the thread creator edits a comment [Taiga #5647](https://tree.taiga.io/project/penpot/issue/5647) +- Fix unnecessary button [Taiga #3312](https://tree.taiga.io/project/penpot/issue/3312) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/dashboard/import.cljs b/frontend/src/app/main/ui/dashboard/import.cljs index 5a24b393a..bb26e8d0a 100644 --- a/frontend/src/app/main/ui/dashboard/import.cljs +++ b/frontend/src/app/main/ui/dashboard/import.cljs @@ -400,7 +400,7 @@ [:div.modal-footer [:div.action-buttons - (when (or (= :analyzing (:status @state)) pending-import?) + (when (= :analyzing (:status @state)) [:input.cancel-button {:type "button" :value (tr "labels.cancel") From 9048c013087a0a55b4b52cff24d66ce614d4cb53 Mon Sep 17 00:00:00 2001 From: Eva Date: Tue, 25 Jul 2023 09:53:01 +0200 Subject: [PATCH 09/16] :bug: Fix copy color information in several formats --- CHANGES.md | 1 + common/src/app/common/data.cljc | 6 ++++++ .../ui/viewer/inspect/attributes/fill.cljs | 9 ++++++++- frontend/src/app/util/color.cljs | 19 +++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 90980f908..112f1f52e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -90,6 +90,7 @@ - Fix export multiple images when only one of them has export settings [Taiga #5649](https://tree.taiga.io/project/penpot/issue/5649) - Fix error when a user different than the thread creator edits a comment [Taiga #5647](https://tree.taiga.io/project/penpot/issue/5647) - Fix unnecessary button [Taiga #3312](https://tree.taiga.io/project/penpot/issue/3312) +- Fix copy color information in several formats [Taiga #4723](https://tree.taiga.io/project/penpot/issue/4723) ### :arrow_up: Deps updates diff --git a/common/src/app/common/data.cljc b/common/src/app/common/data.cljc index 2a3320f6b..d1a9bb0db 100644 --- a/common/src/app/common/data.cljc +++ b/common/src/app/common/data.cljc @@ -752,6 +752,12 @@ [key (delay (generator-fn key))])) keys)) +(defn opacity-to-hex [opacity] + (let [opacity (* opacity 255) + value (mth/round opacity)] + (.. value + (toString 16) + (padStart 2 "0")))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; String Functions diff --git a/frontend/src/app/main/ui/viewer/inspect/attributes/fill.cljs b/frontend/src/app/main/ui/viewer/inspect/attributes/fill.cljs index 500ddd500..43fe7dffb 100644 --- a/frontend/src/app/main/ui/viewer/inspect/attributes/fill.cljs +++ b/frontend/src/app/main/ui/viewer/inspect/attributes/fill.cljs @@ -35,6 +35,13 @@ {:to-prop "background" :format #(uc/color->background (shape->color shape))})) +(defn copy-data-format [shape format] + (cg/generate-css-props + shape + fill-attributes + {:to-prop "background-color" + :format #(uc/color->format->background (shape->color shape) format)})) + (mf/defc fill-block [{:keys [shape]}] (let [color-format (mf/use-state :hex) color (shape->color shape)] @@ -43,7 +50,7 @@ [:& color-row {:color color :format @color-format :on-change-format #(reset! color-format %) - :copy-data (copy-data shape)}]])) + :copy-data (copy-data-format shape @color-format)}]])) (mf/defc fill-panel [{:keys [shapes]}] diff --git a/frontend/src/app/util/color.cljs b/frontend/src/app/util/color.cljs index 428aa3fb5..30f49882e 100644 --- a/frontend/src/app/util/color.cljs +++ b/frontend/src/app/util/color.cljs @@ -7,6 +7,7 @@ (ns app.util.color "Color conversion utils." (:require + [app.common.data :as d] [app.util.i18n :as i18n :refer [tr]] [app.util.object :as obj] [app.util.strings :as ust] @@ -150,6 +151,24 @@ :else "transparent"))) +(defn color->format->background [{:keys [color opacity gradient]} format] + (let [opacity (or opacity 1)] + (cond + (and gradient (not= :multiple gradient)) + (gradient->css gradient) + + (not= color :multiple) + (case format + :rgba (let [[r g b] (hex->rgb color)] + (str/fmt "rgba(%s, %s, %s, %s)" r g b opacity)) + + :hsla (let [[h s l] (hex->hsl color)] + (str/fmt "hsla(%s, %s, %s, %s)" h (* 100 s) (* 100 l) opacity)) + + :hex (str color (str/upper (d/opacity-to-hex opacity)))) + + :else "transparent"))) + (defn multiple? [{:keys [id file-id value color gradient]}] (or (= value :multiple) (= color :multiple) From bec09fb5d1b13d018f01e77ce7c4d5a6ebed96e9 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 25 Jul 2023 12:52:47 +0200 Subject: [PATCH 10/16] :sparkles: Improve connection errors handling on workspace save operation --- .../app/main/data/workspace/persistence.cljs | 18 +++++++++++++----- frontend/src/app/main/errors.cljs | 3 ++- frontend/src/app/main/ui.cljs | 1 + 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/main/data/workspace/persistence.cljs b/frontend/src/app/main/data/workspace/persistence.cljs index cf74bbf1f..e0b08734b 100644 --- a/frontend/src/app/main/data/workspace/persistence.cljs +++ b/frontend/src/app/main/data/workspace/persistence.cljs @@ -182,11 +182,19 @@ (rx/of (shapes-changes-persisted-finished)))))) (rx/catch (fn [cause] - (rx/concat - (if (= :authentication (:type cause)) - (rx/empty) - (rx/of (rt/assign-exception cause))) - (rx/throw cause))))))))) + (cond + (= :authentication (:type cause)) + (rx/throw cause) + + (instance? js/TypeError cause) + (->> (rx/timer 2000) + (rx/map (fn [_] + (persist-changes file-id file-revn changes pending-commits)))) + + :else + (rx/concat + (rx/of (rt/assign-exception cause)) + (rx/throw cause)))))))))) ;; Event to be thrown after the changes have been persisted (defn shapes-changes-persisted-finished diff --git a/frontend/src/app/main/errors.cljs b/frontend/src/app/main/errors.cljs index ea60fa7b8..7bd072645 100644 --- a/frontend/src/app/main/errors.cljs +++ b/frontend/src/app/main/errors.cljs @@ -66,7 +66,8 @@ (defmethod ptk/handle-error :default [error] - (ts/schedule #(st/emit! (rt/assign-exception (::instance error)))) + (when-let [cause (::instance error)] + (ts/schedule #(st/emit! (rt/assign-exception cause)))) (print-group! "Unhandled Error" (fn [] (print-trace! error) diff --git a/frontend/src/app/main/ui.cljs b/frontend/src/app/main/ui.cljs index 7528fdcd3..93c848be8 100644 --- a/frontend/src/app/main/ui.cljs +++ b/frontend/src/app/main/ui.cljs @@ -142,6 +142,7 @@ (mf/with-effect [theme] (dom/set-html-theme-color theme)) + [:& (mf/provider ctx/current-route) {:value route} [:& (mf/provider ctx/current-profile) {:value profile} (if edata From 653bc66b8ff3ca3ccb36e7ce153eeedd58daba3f Mon Sep 17 00:00:00 2001 From: Eva Date: Tue, 25 Jul 2023 12:35:24 +0200 Subject: [PATCH 11/16] :bug: Fix dropdown width --- CHANGES.md | 2 +- .../main/partials/sidebar-element-options.scss | 16 ++++++++++++++++ .../workspace/sidebar/options/menus/layer.cljs | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 112f1f52e..033dcc348 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -91,7 +91,7 @@ - Fix error when a user different than the thread creator edits a comment [Taiga #5647](https://tree.taiga.io/project/penpot/issue/5647) - Fix unnecessary button [Taiga #3312](https://tree.taiga.io/project/penpot/issue/3312) - Fix copy color information in several formats [Taiga #4723](https://tree.taiga.io/project/penpot/issue/4723) - +- Fix dropdown width [Taiga #5541](https://tree.taiga.io/project/penpot/issue/5541) ### :arrow_up: Deps updates - Update google fonts catalog (at 2023/07/06) [Taiga #5592](https://tree.taiga.io/project/penpot/issue/5592) diff --git a/frontend/resources/styles/main/partials/sidebar-element-options.scss b/frontend/resources/styles/main/partials/sidebar-element-options.scss index 7febf9415..ce5ab80fa 100644 --- a/frontend/resources/styles/main/partials/sidebar-element-options.scss +++ b/frontend/resources/styles/main/partials/sidebar-element-options.scss @@ -316,6 +316,22 @@ &:hover { border: 1px solid $color-gray-20; } + + &.no-check { + .custom-select-dropdown { + width: 100%; + min-width: unset; + .check-icon { + display: none; + } + li.checked-element { + padding-left: 0.5rem; + &.is-selected { + background-color: $color-primary; + } + } + } + } } .opened { border: 1px solid $color-primary; diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs index f8c8bb32d..be41c258d 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs @@ -152,7 +152,7 @@ [:div.element-set-content [:div.row-flex [:& select - {:class "flex-grow" + {:class "flex-grow no-check" :default-value selected-blend-mode :options options :on-change handle-change-blend-mode From 1aa7960863626f3eba05752e5bca26564cbde4e6 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 25 Jul 2023 14:50:42 +0200 Subject: [PATCH 12/16] :bug: Fix retrieve unread comment threads extra calls --- frontend/src/app/main/data/comments.cljs | 2 +- frontend/src/app/main/ui/dashboard/comments.cljs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/main/data/comments.cljs b/frontend/src/app/main/data/comments.cljs index 225ddae8b..46bf3c752 100644 --- a/frontend/src/app/main/data/comments.cljs +++ b/frontend/src/app/main/data/comments.cljs @@ -322,7 +322,7 @@ (rx/concat (rx/of (partial fetched-comments comments)) - (->> (rx/from (map :file-id comments)) + (->> (rx/from (into #{} (map :file-id) comments)) (rx/merge-map #(rp/cmd! :get-profiles-for-file-comments {:file-id %})) (rx/reduce #(merge %1 (d/index-by :id %2)) {}) (rx/map #(partial fetched-users %)))))) diff --git a/frontend/src/app/main/ui/dashboard/comments.cljs b/frontend/src/app/main/ui/dashboard/comments.cljs index 2da270779..dc92961dd 100644 --- a/frontend/src/app/main/ui/dashboard/comments.cljs +++ b/frontend/src/app/main/ui/dashboard/comments.cljs @@ -22,17 +22,12 @@ (mf/defc comments-section [{:keys [profile team]}] - - (mf/use-effect - (mf/deps team) - (fn [] - (st/emit! (dcm/retrieve-unread-comment-threads (:id team))))) - (let [show-dropdown? (mf/use-state false) show-dropdown (mf/use-fn #(reset! show-dropdown? true)) hide-dropdown (mf/use-fn #(reset! show-dropdown? false)) threads-map (mf/deref refs/comment-threads) users (mf/deref refs/current-team-comments-users) + team-id (:id team) tgroups (->> (vals threads-map) (sort-by :modified-at) @@ -46,6 +41,11 @@ (st/emit! (-> (dwcm/navigate thread) (with-meta {::ev/origin "dashboard"})))))] + (mf/use-effect + (mf/deps team-id) + (fn [] + (st/emit! (dcm/retrieve-unread-comment-threads team-id)))) + (mf/use-effect (mf/deps @show-dropdown?) (fn [] From 8a3c580d0f3b338898dc0b3dcaafa16bc6a81009 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 25 Jul 2023 16:52:24 +0200 Subject: [PATCH 13/16] :bug: Fix undo layer mode preview --- .../src/app/main/ui/workspace/sidebar/options/menus/layer.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs index be41c258d..c76fcb474 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layer.cljs @@ -62,6 +62,7 @@ :selected-blend-mode value :option-highlighted? false :preview-complete? true) + (st/emit! (dw/unset-preview-blend-mode ids)) (on-change :blend-mode value))) handle-blend-mode-enter From 92ee6320f54f38294c7715e67c6092584092b1a1 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 25 Jul 2023 16:57:39 +0200 Subject: [PATCH 14/16] :bug: Fix enable comment mode and insert image keeps on comment mode --- CHANGES.md | 2 ++ frontend/src/app/main/ui/workspace/left_toolbar.cljs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 033dcc348..3deefff77 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -92,6 +92,8 @@ - Fix unnecessary button [Taiga #3312](https://tree.taiga.io/project/penpot/issue/3312) - Fix copy color information in several formats [Taiga #4723](https://tree.taiga.io/project/penpot/issue/4723) - Fix dropdown width [Taiga #5541](https://tree.taiga.io/project/penpot/issue/5541) +- Fix enable comment mode and insert image keeps on comment mode [Taiga #5678](https://tree.taiga.io/project/penpot/issue/5678) + ### :arrow_up: Deps updates - Update google fonts catalog (at 2023/07/06) [Taiga #5592](https://tree.taiga.io/project/penpot/issue/5592) diff --git a/frontend/src/app/main/ui/workspace/left_toolbar.cljs b/frontend/src/app/main/ui/workspace/left_toolbar.cljs index 6439725af..2a61a3120 100644 --- a/frontend/src/app/main/ui/workspace/left_toolbar.cljs +++ b/frontend/src/app/main/ui/workspace/left_toolbar.cljs @@ -30,7 +30,10 @@ file-id (mf/use-ctx ctx/current-file-id) on-click - (mf/use-fn #(dom/click (mf/ref-val ref))) + (mf/use-fn + (fn [] + (st/emit! :interrupt dw/clear-edition-mode) + (dom/click (mf/ref-val ref)))) on-selected (mf/use-fn From 7036dddad16d639717ecc05a38f676c9789bb65e Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 26 Jul 2023 07:37:23 +0200 Subject: [PATCH 15/16] :bug: Fix enable undo just after using pencil --- CHANGES.md | 1 + frontend/src/app/main/data/workspace/common.cljs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 3deefff77..119d895cf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -93,6 +93,7 @@ - Fix copy color information in several formats [Taiga #4723](https://tree.taiga.io/project/penpot/issue/4723) - Fix dropdown width [Taiga #5541](https://tree.taiga.io/project/penpot/issue/5541) - Fix enable comment mode and insert image keeps on comment mode [Taiga #5678](https://tree.taiga.io/project/penpot/issue/5678) +- Fix enable undo just after using pencil [Taiga #5674](https://tree.taiga.io/project/penpot/issue/5674) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/data/workspace/common.cljs b/frontend/src/app/main/data/workspace/common.cljs index 11fef1fd5..c4ea1a7e9 100644 --- a/frontend/src/app/main/data/workspace/common.cljs +++ b/frontend/src/app/main/data/workspace/common.cljs @@ -119,7 +119,7 @@ (watch [it state _] (let [edition (get-in state [:workspace-local :edition]) drawing (get state :workspace-drawing)] - (when-not (or (some? edition) (not-empty drawing)) + (when-not (or (some? edition) (some? (:object drawing))) (let [undo (:workspace-undo state) items (:items undo) index (or (:index undo) (dec (count items)))] From 934c6c5aae946d7ad707ce3ba718f753f2bd8b3e Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 26 Jul 2023 10:04:26 +0200 Subject: [PATCH 16/16] :bug: Avoid just white spaces for old password --- CHANGES.md | 2 ++ frontend/src/app/main/ui/components/forms.cljs | 10 ++++++++++ frontend/src/app/main/ui/settings/password.cljs | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 119d895cf..5739dd035 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -94,6 +94,8 @@ - Fix dropdown width [Taiga #5541](https://tree.taiga.io/project/penpot/issue/5541) - Fix enable comment mode and insert image keeps on comment mode [Taiga #5678](https://tree.taiga.io/project/penpot/issue/5678) - Fix enable undo just after using pencil [Taiga #5674](https://tree.taiga.io/project/penpot/issue/5674) +- Fix 400 error when user changes password [Taiga #5643](https://tree.taiga.io/project/penpot/issue/5643) +- Fix cannot undo layer styles [Taiga #5676](https://tree.taiga.io/project/penpot/issue/5676) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/components/forms.cljs b/frontend/src/app/main/ui/components/forms.cljs index deb8f6a46..9c415a4e5 100644 --- a/frontend/src/app/main/ui/components/forms.cljs +++ b/frontend/src/app/main/ui/components/forms.cljs @@ -439,3 +439,13 @@ (cond-> errors (all-spaces? (get data field)) (assoc field {:message error-msg})))) + +(defn validate-not-all-spaces + [field error-msg] + (fn [errors data] + (let [value (get data field)] + (cond-> errors + (and + (all-spaces? value) + (> (count value) 0)) + (assoc field {:message error-msg}))))) diff --git a/frontend/src/app/main/ui/settings/password.cljs b/frontend/src/app/main/ui/settings/password.cljs index 48f15b00b..a2f2c727b 100644 --- a/frontend/src/app/main/ui/settings/password.cljs +++ b/frontend/src/app/main/ui/settings/password.cljs @@ -71,7 +71,8 @@ [{:keys [locale] :as props}] (let [initial (mf/use-memo (constantly {:password-old nil})) form (fm/use-form :spec ::password-form - :validators [(fm/validate-not-empty :password-1 (tr "auth.password-not-empty")) + :validators [(fm/validate-not-all-spaces :password-old (tr "auth.password-not-empty")) + (fm/validate-not-empty :password-1 (tr "auth.password-not-empty")) (fm/validate-not-empty :password-2 (tr "auth.password-not-empty")) password-equality] :initial initial)]