0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-20 19:51:23 -05:00

Merge pull request #6076 from penpot/alotor-fix-problem-inspect

🐛 Fix problem with readonly and inspect
This commit is contained in:
Andrey Antukh 2025-03-14 15:50:01 +01:00 committed by GitHub
commit 7403f60366
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 11 deletions

View file

@ -12,7 +12,7 @@
tab [Taiga #10377](https://tree.taiga.io/project/penpot/issue/10377)
- Fix minor inconsistencies on RPC `get-file-libraries` and `get-file`
methods (add missing team-id prop)
- Fix problem with viewer role and inspect mode [Taiga #9751](https://tree.taiga.io/project/penpot/issue/9751)
## 2.5.3

View file

@ -197,16 +197,25 @@
:id "inspect"
:content inspect-content}])]
(mf/with-effect [permissions]
(when-not (:can-edit permissions)
(on-change-tab :inspect)))
[:div {:class (stl/css :tool-window)}
[:> tab-switcher* {:tabs tabs
:default-selected "info"
:on-change-tab on-change-tab
:selected (name options-mode)
:class (stl/css :options-tab-switcher)}]]))
(if (:can-edit permissions)
[:> tab-switcher* {:tabs tabs
:default-selected "info"
:on-change-tab on-change-tab
:selected (name options-mode)
:class (stl/css :options-tab-switcher)}]
[:div {:class (stl/css-case :element-options true
:inspect-options true
:read-only true)}
[:& hrs/right-sidebar {:page-id page-id
:objects objects
:file-id file-id
:frame shape-parent-frame
:shapes selected-shapes
:on-change-section on-change-section
:on-expand on-expand
:from :workspace}]])]))
;; TODO: this need optimizations, selected-objects and
;; selected-objects-with-children are derefed always but they only

View file

@ -33,6 +33,11 @@
padding-top: $s-8;
}
.read-only {
grid-template-areas: "right-sidebar";
padding: var(--sp-s);
}
.design-options,
.interaction-options {
overflow: auto;

View file

@ -231,7 +231,7 @@
show-selrect? (and selrect (empty? drawing) (not text-editing?))
show-measures? (and (not transform)
(not node-editing?)
(or show-distances? mode-inspect?))
(or show-distances? mode-inspect? read-only?))
show-artboard-names? (contains? layout :display-artboard-names)
hide-ui? (contains? layout :hide-ui)
show-rulers? (and (contains? layout :rulers) (not hide-ui?))