mirror of
https://github.com/penpot/penpot.git
synced 2025-03-17 10:11:22 -05:00
Merge pull request #5207 from penpot/palba-viewer-role-can-unpublish
🐛 Fix view role user have menu option for unpublish a library
This commit is contained in:
commit
e0a4ec8b87
1 changed files with 12 additions and 8 deletions
|
@ -479,7 +479,7 @@
|
|||
(mf/defc file-menu*
|
||||
{::mf/props :obj
|
||||
::mf/private true}
|
||||
[{:keys [on-close file can-edit]}]
|
||||
[{:keys [on-close file]}]
|
||||
(let [file-id (:id file)
|
||||
shared? (:is-shared file)
|
||||
|
||||
|
@ -487,6 +487,9 @@
|
|||
frames (->> (cfh/get-immediate-children objects uuid/zero)
|
||||
(filterv cfh/frame-shape?))
|
||||
|
||||
perms (mf/use-ctx ctx/team-permissions)
|
||||
can-edit (:can-edit perms)
|
||||
|
||||
on-remove-shared
|
||||
(mf/use-fn
|
||||
(mf/deps file-id)
|
||||
|
@ -567,11 +570,12 @@
|
|||
:on-close on-close}
|
||||
|
||||
(if ^boolean shared?
|
||||
[:> dropdown-menu-item* {:class (stl/css :submenu-item)
|
||||
:on-click on-remove-shared
|
||||
:on-key-down on-remove-shared-key-down
|
||||
:id "file-menu-remove-shared"}
|
||||
[:span {:class (stl/css :item-name)} (tr "dashboard.unpublish-shared")]]
|
||||
(when can-edit
|
||||
[:> dropdown-menu-item* {:class (stl/css :submenu-item)
|
||||
:on-click on-remove-shared
|
||||
:on-key-down on-remove-shared-key-down
|
||||
:id "file-menu-remove-shared"}
|
||||
[:span {:class (stl/css :item-name)} (tr "dashboard.unpublish-shared")]])
|
||||
|
||||
(when can-edit
|
||||
[:> dropdown-menu-item* {:class (stl/css :submenu-item)
|
||||
|
@ -846,12 +850,12 @@
|
|||
:on-close close-sub-menu}]
|
||||
|
||||
:plugins
|
||||
[:& plugins-menu*
|
||||
[:> plugins-menu*
|
||||
{:open-plugins open-plugins-manager
|
||||
:on-close close-sub-menu}]
|
||||
|
||||
:help-info
|
||||
[:& help-info-menu*
|
||||
[:> help-info-menu*
|
||||
{:layout layout
|
||||
:on-close close-sub-menu}]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue