🐛 Fix allow change team image for editor role users

This commit is contained in:
Alejandro Alonso 2023-03-29 11:42:31 +02:00 committed by Alonso Torres
parent fa4c7a1eb7
commit f05f527336
3 changed files with 36 additions and 15 deletions

View file

@ -900,6 +900,10 @@
stats (mf/deref refs/dashboard-team-stats)
you-owner? (get-in team [:permissions :is-owner])
you-admin? (get-in team [:permissions :is-admin])
can-edit? (or you-owner? you-admin?)
on-image-click
(mf/use-callback #(dom/click (mf/ref-val finput)))
@ -931,12 +935,14 @@
[:div.label (tr "dashboard.team-info")]
[:div.name (:name team)]
[:div.icon
[:span.update-overlay {:on-click on-image-click} i/image]
(when can-edit?
[:span.update-overlay {:on-click on-image-click} i/image])
[:img {:src (cfg/resolve-team-photo-url team)}]
[:& file-uploader {:accept "image/jpeg,image/png"
:multi false
:ref finput
:on-selected on-file-selected}]]]
(when can-edit?
[:& file-uploader {:accept "image/jpeg,image/png"
:multi false
:ref finput
:on-selected on-file-selected}])]]
[:div.block.owner-block
[:div.label (tr "dashboard.team-members")]