mirror of
https://github.com/penpot/penpot.git
synced 2025-04-04 19:11:20 -05:00
🐛 Fix rename blocked boards (#5845)
This commit is contained in:
parent
8b6a9b373d
commit
6bb7fa26f4
4 changed files with 19 additions and 13 deletions
|
@ -65,6 +65,7 @@ is a number of cores)
|
|||
- Fix problem opening url when page-id didn't exist [Taiga #10157](https://tree.taiga.io/project/penpot/issue/10157)
|
||||
- Fix problem with onboarding to a team [Taiga #10143](https://tree.taiga.io/project/penpot/issue/10143)
|
||||
- Fix problem with grid layout crashing [Taiga #10127](https://tree.taiga.io/project/penpot/issue/10127)
|
||||
- Fix rename locked boards [Taiga #10174](https://tree.taiga.io/project/penpot/issue/10174)
|
||||
|
||||
## 2.4.3
|
||||
|
||||
|
|
|
@ -120,16 +120,17 @@
|
|||
[:& layer-name {:ref name-ref
|
||||
:shape-id id
|
||||
:shape-name name
|
||||
:shape-touched? touched?
|
||||
:is-shape-touched touched?
|
||||
:disabled-double-click read-only?
|
||||
:on-start-edit on-disable-drag
|
||||
:on-stop-edit on-enable-drag
|
||||
:depth depth
|
||||
:is-blocked blocked?
|
||||
:parent-size parent-size
|
||||
:selected? selected?
|
||||
:is-selected selected?
|
||||
:type-comp component-tree?
|
||||
:type-frame (cfh/frame-shape? item)
|
||||
:hidden? hidden?}]
|
||||
:is-hidden hidden?}]
|
||||
|
||||
(when (not read-only?)
|
||||
[:div {:class (stl/css-case
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
(mf/defc layer-name
|
||||
{::mf/wrap-props false
|
||||
::mf/forward-ref true}
|
||||
[{:keys [shape-id shape-name shape-touched? disabled-double-click
|
||||
on-start-edit on-stop-edit depth parent-size selected?
|
||||
type-comp type-frame hidden?]} external-ref]
|
||||
[{:keys [shape-id shape-name is-shape-touched disabled-double-click
|
||||
on-start-edit on-stop-edit depth parent-size is-selected
|
||||
type-comp type-frame is-hidden is-blocked]} external-ref]
|
||||
(let [edition* (mf/use-state false)
|
||||
edition? (deref edition*)
|
||||
|
||||
|
@ -42,9 +42,10 @@
|
|||
|
||||
start-edit
|
||||
(mf/use-fn
|
||||
(mf/deps disabled-double-click on-start-edit shape-id)
|
||||
(mf/deps disabled-double-click on-start-edit shape-id is-blocked)
|
||||
(fn []
|
||||
(when (not disabled-double-click)
|
||||
(when (and (not is-blocked)
|
||||
(not disabled-double-click))
|
||||
(on-start-edit)
|
||||
(reset! edition* true)
|
||||
(st/emit! (dw/start-rename-shape shape-id)))))
|
||||
|
@ -102,8 +103,8 @@
|
|||
{:class (stl/css-case
|
||||
:element-name true
|
||||
:left-ellipsis has-path?
|
||||
:selected selected?
|
||||
:hidden hidden?
|
||||
:selected is-selected
|
||||
:hidden is-hidden
|
||||
:type-comp type-comp
|
||||
:type-frame type-frame)
|
||||
:style {"--depth" depth "--parent-size" parent-size}
|
||||
|
@ -112,5 +113,5 @@
|
|||
(if (dbg/enabled? :show-ids)
|
||||
(str (d/nilv shape-name "") " | " (str/slice (str shape-id) 24))
|
||||
(d/nilv shape-name ""))]
|
||||
(when (and (dbg/enabled? :show-touched) ^boolean shape-touched?)
|
||||
(when (and (dbg/enabled? :show-touched) ^boolean is-shape-touched)
|
||||
[:span {:class (stl/css :element-name-touched)} "*"])])))
|
||||
|
|
|
@ -96,6 +96,8 @@
|
|||
"var(--color-accent-tertiary)")
|
||||
"#8f9da3") ;; TODO: Set this color on the DS
|
||||
|
||||
blocked? (:blocked frame)
|
||||
|
||||
on-pointer-down
|
||||
(mf/use-fn
|
||||
(mf/deps (:id frame) on-frame-select workspace-read-only?)
|
||||
|
@ -145,9 +147,10 @@
|
|||
|
||||
start-edit
|
||||
(mf/use-fn
|
||||
(mf/deps frame-id edition?)
|
||||
(mf/deps frame-id edition? blocked? workspace-read-only?)
|
||||
(fn []
|
||||
(when-not (-> @st/state :workspace-global :read-only?)
|
||||
(when (and (not blocked?)
|
||||
(not workspace-read-only?))
|
||||
(if (not edition?)
|
||||
(reset! edition* true)
|
||||
(st/emit! (dw/start-rename-shape frame-id))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue