From acc1fac8debb157bfd23c6c02e11c71062aef828 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Mon, 15 Apr 2024 16:07:05 +0200 Subject: [PATCH 1/4] :bug: Fix color picker names are not displayed correctly on their tooltips --- frontend/src/app/main/ui/components/tab_container.cljs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/components/tab_container.cljs b/frontend/src/app/main/ui/components/tab_container.cljs index bd3ff67276..20c79a417f 100644 --- a/frontend/src/app/main/ui/components/tab_container.cljs +++ b/frontend/src/app/main/ui/components/tab_container.cljs @@ -54,9 +54,10 @@ (let [props (.-props tab) id (.-id props) title (.-title props) - sid (d/name id)] + sid (d/name id) + tooltip (if (string? title) title nil)] [:div {:key (str/concat "tab-" sid) - :title title + :title tooltip :data-id sid :on-click on-click :class (stl/css-case From ec8c84744063a0b2df4a6e5b7c3765d66aa77d5d Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 16 Apr 2024 13:12:21 +0200 Subject: [PATCH 2/4] :bug: Fix wrong permissions on shared prototype for owners --- backend/src/app/rpc/commands/viewer.clj | 5 +++++ frontend/src/app/main/ui/viewer/header.cljs | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/backend/src/app/rpc/commands/viewer.clj b/backend/src/app/rpc/commands/viewer.clj index c2887ef967..70d5193c16 100644 --- a/backend/src/app/rpc/commands/viewer.clj +++ b/backend/src/app/rpc/commands/viewer.clj @@ -38,6 +38,11 @@ team (-> (db/get conn :team {:id (:team-id project)}) (teams/decode-row)) + members (into #{} (->> (teams/get-team-members conn (:team-id project)) + (map :id))) + + perms (assoc perms :in-team (contains? members profile-id)) + _ (-> (cfeat/get-team-enabled-features cf/flags team) (cfeat/check-client-features! (:features params)) (cfeat/check-file-features! (:features file))) diff --git a/frontend/src/app/main/ui/viewer/header.cljs b/frontend/src/app/main/ui/viewer/header.cljs index 6e3051cf73..77460f0b6b 100644 --- a/frontend/src/app/main/ui/viewer/header.cljs +++ b/frontend/src/app/main/ui/viewer/header.cljs @@ -180,7 +180,7 @@ :on-zoom-fit handle-zoom-fit :on-fullscreen toggle-fullscreen}] - (when (:can-edit permissions) + (when (:in-team permissions) [:span {:on-click go-to-workspace :class (stl/css :edit-btn)} i/curve]) @@ -191,7 +191,9 @@ :on-click toggle-fullscreen} i/expand] - (when (:is-admin permissions) + (when (and + (:in-team permissions) + (:is-admin permissions)) [:button {:on-click open-share-dialog :class (stl/css :share-btn)} (tr "labels.share")]) @@ -301,8 +303,8 @@ ;; If the user doesn't have permission we disable the link [:a {:class (stl/css :home-link) :on-click go-to-dashboard - :style {:cursor (when-not (:can-edit permissions) "auto") - :pointer-events (when-not (:can-edit permissions) "none")}} + :style {:cursor (when-not (:in-team permissions) "auto") + :pointer-events (when-not (:in-team permissions) "none")}} [:span {:class (stl/css :logo-icon)} i/logo-icon]] @@ -321,7 +323,7 @@ :title (tr "viewer.header.interactions-section" (sc/get-tooltip :open-interactions))} i/play] - (when (or (:can-edit permissions) + (when (or (:in-team permissions) (= (:who-comment permissions) "all")) [:button {:on-click navigate :data-value "comments" From 16fa0b0330e0a1481a60a8d2f9a57b128357a803 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 16 Apr 2024 17:24:33 +0200 Subject: [PATCH 3/4] :sparkles: Improve email clean mechanism --- backend/src/app/rpc/commands/profile.clj | 4 ++++ backend/test/backend_tests/rpc_profile_test.clj | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/backend/src/app/rpc/commands/profile.clj b/backend/src/app/rpc/commands/profile.clj index 89a50b6ad3..fe33da10dc 100644 --- a/backend/src/app/rpc/commands/profile.clj +++ b/backend/src/app/rpc/commands/profile.clj @@ -46,6 +46,10 @@ (let [email (str/lower email) email (if (str/starts-with? email "mailto:") (subs email 7) + email) + email (if (or (str/starts-with? email "<") + (str/ends-with? email ">")) + (str/trim email "<>") email)] email)) diff --git a/backend/test/backend_tests/rpc_profile_test.clj b/backend/test/backend_tests/rpc_profile_test.clj index cbaff60380..00d2f2ac0d 100644 --- a/backend/test/backend_tests/rpc_profile_test.clj +++ b/backend/test/backend_tests/rpc_profile_test.clj @@ -27,6 +27,14 @@ (t/use-fixtures :once th/state-init) (t/use-fixtures :each th/database-reset) + +(t/deftest clean-email + (t/is "foo@example.com" (profile/clean-email "mailto:foo@example.com")) + (t/is "foo@example.com" (profile/clean-email "mailto:")) + (t/is "foo@example.com" (profile/clean-email "")) + (t/is "foo@example.com" (profile/clean-email "foo@example.com>")) + (t/is "foo@example.com" (profile/clean-email " Date: Tue, 16 Apr 2024 17:31:23 +0200 Subject: [PATCH 4/4] :sparkles: Add minor improvement to worker module logging --- backend/src/app/worker/runner.clj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/app/worker/runner.clj b/backend/src/app/worker/runner.clj index e68fa484db..be3663365d 100644 --- a/backend/src/app/worker/runner.clj +++ b/backend/src/app/worker/runner.clj @@ -139,7 +139,7 @@ :else (try - (l/trc :hint "start" + (l/dbg :hint "start" :name (:name task) :task-id (str task-id) :queue queue @@ -149,7 +149,7 @@ result (handle-task task) elapsed (dt/format-duration (tpoint))] - (l/trc :hint "end" + (l/dbg :hint "end" :name (:name task) :task-id (str task-id) :queue queue @@ -228,9 +228,9 @@ (recur)))) (catch InterruptedException _ - (l/debug :hint "interrupted" - :id id - :queue queue)) + (l/dbg :hint "interrupted" + :id id + :queue queue)) (catch Throwable cause (l/err :hint "unexpected exception" :id id