mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 06:58:58 -05:00
Merge pull request #2575 from penpot/hiru-reset-changes-deleted-component
This commit is contained in:
commit
6a296a3e52
3 changed files with 17 additions and 15 deletions
|
@ -18,6 +18,7 @@
|
|||
[app.common.types.color :as ctc]
|
||||
[app.common.types.component :as ctk]
|
||||
[app.common.types.container :as ctn]
|
||||
[app.common.types.file :as ctf]
|
||||
[app.common.types.shape-tree :as ctst]
|
||||
[app.common.types.typography :as cty]
|
||||
[app.main.data.workspace.groups :as dwg]
|
||||
|
@ -453,6 +454,11 @@
|
|||
component (cph/get-component libraries
|
||||
(:component-file shape-inst)
|
||||
(:component-id shape-inst))
|
||||
component (or component
|
||||
(and reset?
|
||||
(ctf/get-deleted-component
|
||||
(get-in libraries [(:component-file shape-inst) :data])
|
||||
(:component-id shape-inst))))
|
||||
shape-main (when component
|
||||
(ctn/get-shape component (:shape-ref shape-inst)))
|
||||
|
||||
|
|
|
@ -484,9 +484,8 @@
|
|||
[:& menu-entry {:title (tr "workspace.shape.menu.detach-instance")
|
||||
:shortcut (sc/get-tooltip :detach-component)
|
||||
:on-click do-detach-component}]
|
||||
;; This is commented due this functionality is not yet available
|
||||
;; [:& menu-entry {:title (tr "workspace.shape.menu.reset-overrides")
|
||||
;; :on-click do-reset-component}]
|
||||
[:& menu-entry {:title (tr "workspace.shape.menu.reset-overrides")
|
||||
:on-click do-reset-component}]
|
||||
(when components-v2
|
||||
[:& menu-entry {:title (tr "workspace.shape.menu.restore-main")
|
||||
:on-click do-restore-component}])]
|
||||
|
@ -505,9 +504,8 @@
|
|||
[:& menu-entry {:title (tr "workspace.shape.menu.detach-instance")
|
||||
:shortcut (sc/get-tooltip :detach-component)
|
||||
:on-click do-detach-component}]
|
||||
;; This is commented due this functionality is not yet available
|
||||
;; [:& menu-entry {:title (tr "workspace.shape.menu.reset-overrides")
|
||||
;; :on-click do-reset-component}]
|
||||
[:& menu-entry {:title (tr "workspace.shape.menu.reset-overrides")
|
||||
:on-click do-reset-component}]
|
||||
(when components-v2
|
||||
[:& menu-entry {:title (tr "workspace.shape.menu.restore-main")
|
||||
:on-click do-restore-component}])]
|
||||
|
|
|
@ -106,23 +106,21 @@
|
|||
(if local-component?
|
||||
(if is-dangling?
|
||||
[[(tr "workspace.shape.menu.detach-instance") do-detach-component]
|
||||
;; [(tr "workspace.shape.menu.reset-overrides") _do-reset-component]
|
||||
[(tr "workspace.shape.menu.reset-overrides") _do-reset-component]
|
||||
(when components-v2
|
||||
[(tr "workspace.shape.menu.restore-main") do-restore-component])]
|
||||
|
||||
[[(tr "workspace.shape.menu.detach-instance") do-detach-component]
|
||||
;; [(tr "workspace.shape.menu.reset-overrides") _do-reset-component]
|
||||
[(tr "workspace.shape.menu.reset-overrides") _do-reset-component]
|
||||
[(tr "workspace.shape.menu.update-main") do-update-component]
|
||||
[(tr "workspace.shape.menu.show-main") do-show-component]])
|
||||
|
||||
(if is-dangling?
|
||||
[[(tr "workspace.shape.menu.detach-instance") do-detach-component]
|
||||
;; [(tr "workspace.shape.menu.reset-overrides") _do-reset-component]
|
||||
[(tr "workspace.shape.menu.reset-overrides") _do-reset-component]
|
||||
(when components-v2
|
||||
[(tr "workspace.shape.menu.restore-main") do-restore-component])]
|
||||
[[(tr "workspace.shape.menu.detach-instance") do-detach-component]
|
||||
;; [(tr "workspace.shape.menu.reset-overrides") _do-reset-component]
|
||||
;; [(tr "workspace.shape.menu.update-main") _do-update-remote-component]
|
||||
[(tr "workspace.shape.menu.go-main") do-navigate-component-file]
|
||||
])))}]]]]])))
|
||||
|
||||
[(tr "workspace.shape.menu.reset-overrides") _do-reset-component]
|
||||
[(tr "workspace.shape.menu.update-main") _do-update-remote-component]
|
||||
[(tr "workspace.shape.menu.go-main") do-navigate-component-file]])))}]]]]])))
|
||||
|
|
Loading…
Add table
Reference in a new issue