mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 07:29:08 -05:00
commit
8bd9c0d031
3 changed files with 15 additions and 7 deletions
|
@ -38,6 +38,11 @@
|
||||||
team (-> (db/get conn :team {:id (:team-id project)})
|
team (-> (db/get conn :team {:id (:team-id project)})
|
||||||
(teams/decode-row))
|
(teams/decode-row))
|
||||||
|
|
||||||
|
members (into #{} (->> (teams/get-team-members conn (:team-id project))
|
||||||
|
(map :id)))
|
||||||
|
|
||||||
|
perms (assoc perms :in-team (contains? members profile-id))
|
||||||
|
|
||||||
_ (-> (cfeat/get-team-enabled-features cf/flags team)
|
_ (-> (cfeat/get-team-enabled-features cf/flags team)
|
||||||
(cfeat/check-client-features! (:features params))
|
(cfeat/check-client-features! (:features params))
|
||||||
(cfeat/check-file-features! (:features file)))
|
(cfeat/check-file-features! (:features file)))
|
||||||
|
|
|
@ -54,9 +54,10 @@
|
||||||
(let [props (.-props tab)
|
(let [props (.-props tab)
|
||||||
id (.-id props)
|
id (.-id props)
|
||||||
title (.-title props)
|
title (.-title props)
|
||||||
sid (d/name id)]
|
sid (d/name id)
|
||||||
|
tooltip (if (string? title) title nil)]
|
||||||
[:div {:key (str/concat "tab-" sid)
|
[:div {:key (str/concat "tab-" sid)
|
||||||
:title title
|
:title tooltip
|
||||||
:data-id sid
|
:data-id sid
|
||||||
:on-click on-click
|
:on-click on-click
|
||||||
:class (stl/css-case
|
:class (stl/css-case
|
||||||
|
|
|
@ -180,7 +180,7 @@
|
||||||
:on-zoom-fit handle-zoom-fit
|
:on-zoom-fit handle-zoom-fit
|
||||||
:on-fullscreen toggle-fullscreen}]
|
:on-fullscreen toggle-fullscreen}]
|
||||||
|
|
||||||
(when (:can-edit permissions)
|
(when (:in-team permissions)
|
||||||
[:span {:on-click go-to-workspace
|
[:span {:on-click go-to-workspace
|
||||||
:class (stl/css :edit-btn)}
|
:class (stl/css :edit-btn)}
|
||||||
i/curve])
|
i/curve])
|
||||||
|
@ -191,7 +191,9 @@
|
||||||
:on-click toggle-fullscreen}
|
:on-click toggle-fullscreen}
|
||||||
i/expand]
|
i/expand]
|
||||||
|
|
||||||
(when (:is-admin permissions)
|
(when (and
|
||||||
|
(:in-team permissions)
|
||||||
|
(:is-admin permissions))
|
||||||
[:button {:on-click open-share-dialog
|
[:button {:on-click open-share-dialog
|
||||||
:class (stl/css :share-btn)}
|
:class (stl/css :share-btn)}
|
||||||
(tr "labels.share")])
|
(tr "labels.share")])
|
||||||
|
@ -301,8 +303,8 @@
|
||||||
;; If the user doesn't have permission we disable the link
|
;; If the user doesn't have permission we disable the link
|
||||||
[:a {:class (stl/css :home-link)
|
[:a {:class (stl/css :home-link)
|
||||||
:on-click go-to-dashboard
|
:on-click go-to-dashboard
|
||||||
:style {:cursor (when-not (:can-edit permissions) "auto")
|
:style {:cursor (when-not (:in-team permissions) "auto")
|
||||||
:pointer-events (when-not (:can-edit permissions) "none")}}
|
:pointer-events (when-not (:in-team permissions) "none")}}
|
||||||
[:span {:class (stl/css :logo-icon)}
|
[:span {:class (stl/css :logo-icon)}
|
||||||
i/logo-icon]]
|
i/logo-icon]]
|
||||||
|
|
||||||
|
@ -321,7 +323,7 @@
|
||||||
:title (tr "viewer.header.interactions-section" (sc/get-tooltip :open-interactions))}
|
:title (tr "viewer.header.interactions-section" (sc/get-tooltip :open-interactions))}
|
||||||
i/play]
|
i/play]
|
||||||
|
|
||||||
(when (or (:can-edit permissions)
|
(when (or (:in-team permissions)
|
||||||
(= (:who-comment permissions) "all"))
|
(= (:who-comment permissions) "all"))
|
||||||
[:button {:on-click navigate
|
[:button {:on-click navigate
|
||||||
:data-value "comments"
|
:data-value "comments"
|
||||||
|
|
Loading…
Add table
Reference in a new issue