From 686f96eb27447635aa7cc2fbd786d836df113c1f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 23 Nov 2020 11:43:30 +0100 Subject: [PATCH] :bug: Properly pass users to comments component on workspace. --- frontend/resources/locales.json | 30 +++++++++++++------ .../src/app/main/ui/workspace/comments.cljs | 10 +++---- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/frontend/resources/locales.json b/frontend/resources/locales.json index f08ce41e8..30e154271 100644 --- a/frontend/resources/locales.json +++ b/frontend/resources/locales.json @@ -1275,6 +1275,12 @@ "en" : "Admin" } }, + "labels.all" : { + "used-in" : [ "src/app/main/ui/workspace/comments.cljs:161" ], + "translations" : { + "en" : "All" + } + }, "labels.cancel" : { "used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:203" ], "translations" : { @@ -1285,7 +1291,7 @@ } }, "labels.comments" : { - "used-in" : [ "src/app/main/ui/dashboard/comments.cljs:75" ], + "used-in" : [ "src/app/main/ui/dashboard/comments.cljs:80" ], "translations" : { "en" : "Comments" } @@ -1315,13 +1321,13 @@ } }, "labels.delete-comment" : { - "used-in" : [ "src/app/main/ui/comments.cljs:273" ], + "used-in" : [ "src/app/main/ui/comments.cljs:274" ], "translations" : { "en" : "Delete comment" } }, "labels.delete-comment-thread" : { - "used-in" : [ "src/app/main/ui/comments.cljs:272" ], + "used-in" : [ "src/app/main/ui/comments.cljs:273" ], "translations" : { "en" : "Delete thread" } @@ -1336,7 +1342,7 @@ } }, "labels.edit" : { - "used-in" : [ "src/app/main/ui/comments.cljs:270" ], + "used-in" : [ "src/app/main/ui/comments.cljs:271" ], "translations" : { "en" : "Edit" } @@ -1405,10 +1411,10 @@ } }, "labels.no-comments-available" : { + "used-in" : [ "src/app/main/ui/dashboard/comments.cljs:104" ], "translations" : { "en" : "No comments" - }, - "unused" : true + } }, "labels.old-password" : { "used-in" : [ "src/app/main/ui/settings/password.cljs:81" ], @@ -1419,6 +1425,12 @@ "es" : "ContraseƱa anterior" } }, + "labels.only-yours" : { + "used-in" : [ "src/app/main/ui/workspace/comments.cljs:162" ], + "translations" : { + "en" : "Only yours" + } + }, "labels.owner" : { "used-in" : [ "src/app/main/ui/dashboard/team.cljs:171", "src/app/main/ui/dashboard/team.cljs:291" ], "translations" : { @@ -1660,19 +1672,19 @@ } }, "modals.delete-comment-thread.accept" : { - "used-in" : [ "src/app/main/ui/comments.cljs:222" ], + "used-in" : [ "src/app/main/ui/comments.cljs:223" ], "translations" : { "en" : "Delete conversation" } }, "modals.delete-comment-thread.message" : { - "used-in" : [ "src/app/main/ui/comments.cljs:221" ], + "used-in" : [ "src/app/main/ui/comments.cljs:222" ], "translations" : { "en" : "Are you sure you want to delete this conversation? All comments in this thread will be deleted." } }, "modals.delete-comment-thread.title" : { - "used-in" : [ "src/app/main/ui/comments.cljs:220" ], + "used-in" : [ "src/app/main/ui/comments.cljs:221" ], "translations" : { "en" : "Delete conversation" } diff --git a/frontend/src/app/main/ui/workspace/comments.cljs b/frontend/src/app/main/ui/workspace/comments.cljs index 25a69c9f8..a753f60ae 100644 --- a/frontend/src/app/main/ui/workspace/comments.cljs +++ b/frontend/src/app/main/ui/workspace/comments.cljs @@ -36,6 +36,7 @@ pos-y (* (- (:y vbox)) zoom) profile (mf/deref refs/profile) + users (mf/deref refs/workspace-users) local (mf/deref refs/comments-local) threads-map (mf/deref threads-ref) @@ -56,9 +57,7 @@ on-draft-submit (mf/use-callback (fn [draft] - (st/emit! (dcm/create-thread draft) - #_(dcm/close-thread)))) - ] + (st/emit! (dcm/create-thread draft))))] (mf/use-effect (mf/deps file-id) @@ -82,6 +81,7 @@ (when-let [id (:open local)] (when-let [thread (get threads-map id)] [:& cmt/thread-comments {:thread thread + :users users :zoom zoom}])) (when-let [draft (:comment drawing)] @@ -158,8 +158,8 @@ [:div.label "Comments"] [:div.options {:on-click #(reset! options? true)} [:div.label (case (:mode local) - (nil :all) "All" - :yours "Only yours")] + (nil :all) (tr "labels.all") + :yours (tr "labels.only-yours"))] [:div.icon i/arrow-down]] [:& dropdown {:show @options?