🐛 Properly pass users to comments component on workspace.

This commit is contained in:
Andrey Antukh 2020-11-23 11:43:30 +01:00 committed by Alonso Torres
parent 9f9f146444
commit 686f96eb27
2 changed files with 26 additions and 14 deletions

View file

@ -1275,6 +1275,12 @@
"en" : "Admin" "en" : "Admin"
} }
}, },
"labels.all" : {
"used-in" : [ "src/app/main/ui/workspace/comments.cljs:161" ],
"translations" : {
"en" : "All"
}
},
"labels.cancel" : { "labels.cancel" : {
"used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:203" ], "used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:203" ],
"translations" : { "translations" : {
@ -1285,7 +1291,7 @@
} }
}, },
"labels.comments" : { "labels.comments" : {
"used-in" : [ "src/app/main/ui/dashboard/comments.cljs:75" ], "used-in" : [ "src/app/main/ui/dashboard/comments.cljs:80" ],
"translations" : { "translations" : {
"en" : "Comments" "en" : "Comments"
} }
@ -1315,13 +1321,13 @@
} }
}, },
"labels.delete-comment" : { "labels.delete-comment" : {
"used-in" : [ "src/app/main/ui/comments.cljs:273" ], "used-in" : [ "src/app/main/ui/comments.cljs:274" ],
"translations" : { "translations" : {
"en" : "Delete comment" "en" : "Delete comment"
} }
}, },
"labels.delete-comment-thread" : { "labels.delete-comment-thread" : {
"used-in" : [ "src/app/main/ui/comments.cljs:272" ], "used-in" : [ "src/app/main/ui/comments.cljs:273" ],
"translations" : { "translations" : {
"en" : "Delete thread" "en" : "Delete thread"
} }
@ -1336,7 +1342,7 @@
} }
}, },
"labels.edit" : { "labels.edit" : {
"used-in" : [ "src/app/main/ui/comments.cljs:270" ], "used-in" : [ "src/app/main/ui/comments.cljs:271" ],
"translations" : { "translations" : {
"en" : "Edit" "en" : "Edit"
} }
@ -1405,10 +1411,10 @@
} }
}, },
"labels.no-comments-available" : { "labels.no-comments-available" : {
"used-in" : [ "src/app/main/ui/dashboard/comments.cljs:104" ],
"translations" : { "translations" : {
"en" : "No comments" "en" : "No comments"
}, }
"unused" : true
}, },
"labels.old-password" : { "labels.old-password" : {
"used-in" : [ "src/app/main/ui/settings/password.cljs:81" ], "used-in" : [ "src/app/main/ui/settings/password.cljs:81" ],
@ -1419,6 +1425,12 @@
"es" : "Contraseña anterior" "es" : "Contraseña anterior"
} }
}, },
"labels.only-yours" : {
"used-in" : [ "src/app/main/ui/workspace/comments.cljs:162" ],
"translations" : {
"en" : "Only yours"
}
},
"labels.owner" : { "labels.owner" : {
"used-in" : [ "src/app/main/ui/dashboard/team.cljs:171", "src/app/main/ui/dashboard/team.cljs:291" ], "used-in" : [ "src/app/main/ui/dashboard/team.cljs:171", "src/app/main/ui/dashboard/team.cljs:291" ],
"translations" : { "translations" : {
@ -1660,19 +1672,19 @@
} }
}, },
"modals.delete-comment-thread.accept" : { "modals.delete-comment-thread.accept" : {
"used-in" : [ "src/app/main/ui/comments.cljs:222" ], "used-in" : [ "src/app/main/ui/comments.cljs:223" ],
"translations" : { "translations" : {
"en" : "Delete conversation" "en" : "Delete conversation"
} }
}, },
"modals.delete-comment-thread.message" : { "modals.delete-comment-thread.message" : {
"used-in" : [ "src/app/main/ui/comments.cljs:221" ], "used-in" : [ "src/app/main/ui/comments.cljs:222" ],
"translations" : { "translations" : {
"en" : "Are you sure you want to delete this conversation? All comments in this thread will be deleted." "en" : "Are you sure you want to delete this conversation? All comments in this thread will be deleted."
} }
}, },
"modals.delete-comment-thread.title" : { "modals.delete-comment-thread.title" : {
"used-in" : [ "src/app/main/ui/comments.cljs:220" ], "used-in" : [ "src/app/main/ui/comments.cljs:221" ],
"translations" : { "translations" : {
"en" : "Delete conversation" "en" : "Delete conversation"
} }

View file

@ -36,6 +36,7 @@
pos-y (* (- (:y vbox)) zoom) pos-y (* (- (:y vbox)) zoom)
profile (mf/deref refs/profile) profile (mf/deref refs/profile)
users (mf/deref refs/workspace-users)
local (mf/deref refs/comments-local) local (mf/deref refs/comments-local)
threads-map (mf/deref threads-ref) threads-map (mf/deref threads-ref)
@ -56,9 +57,7 @@
on-draft-submit on-draft-submit
(mf/use-callback (mf/use-callback
(fn [draft] (fn [draft]
(st/emit! (dcm/create-thread draft) (st/emit! (dcm/create-thread draft))))]
#_(dcm/close-thread))))
]
(mf/use-effect (mf/use-effect
(mf/deps file-id) (mf/deps file-id)
@ -82,6 +81,7 @@
(when-let [id (:open local)] (when-let [id (:open local)]
(when-let [thread (get threads-map id)] (when-let [thread (get threads-map id)]
[:& cmt/thread-comments {:thread thread [:& cmt/thread-comments {:thread thread
:users users
:zoom zoom}])) :zoom zoom}]))
(when-let [draft (:comment drawing)] (when-let [draft (:comment drawing)]
@ -158,8 +158,8 @@
[:div.label "Comments"] [:div.label "Comments"]
[:div.options {:on-click #(reset! options? true)} [:div.options {:on-click #(reset! options? true)}
[:div.label (case (:mode local) [:div.label (case (:mode local)
(nil :all) "All" (nil :all) (tr "labels.all")
:yours "Only yours")] :yours (tr "labels.only-yours"))]
[:div.icon i/arrow-down]] [:div.icon i/arrow-down]]
[:& dropdown {:show @options? [:& dropdown {:show @options?