0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-25 07:58:49 -05:00

🐛 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"
}
},
"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"
}

View file

@ -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?