From 8d5ee92f165ee0554cd7a3cdc3c62a01c395b262 Mon Sep 17 00:00:00 2001 From: Luis de Dios Date: Fri, 1 Aug 2025 13:21:19 +0200 Subject: [PATCH] :bug: Fix show 'add new property' from menu when a variant is selected (#7042) --- .../src/app/main/ui/workspace/sidebar/assets/common.cljs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/assets/common.cljs b/frontend/src/app/main/ui/workspace/sidebar/assets/common.cljs index 4c5a3a2461..14fe950691 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/assets/common.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/assets/common.cljs @@ -361,6 +361,7 @@ main-instance? (ctk/main-instance? shape) component-id (:component-id shape) + variant-id (:variant-id shape) library-id (:component-file shape) local-component? (= library-id current-file-id) @@ -441,6 +442,9 @@ (st/emit! (dwv/add-new-variant id)) (st/emit! (dwv/transform-in-variant id)))) + do-add-new-property + #(st/emit! (dwv/add-new-property variant-id {:property-value "Value 1"})) + do-show-local-component #(st/emit! (dwl/go-to-local-component :id component-id)) @@ -497,5 +501,8 @@ (when (and variants? (or (not multi) same-variant?) main-instance?) {:title (tr "workspace.shape.menu.add-variant") :shortcut :create-component - :action do-add-variant})]] + :action do-add-variant}) + (when (and variants? same-variant? main-instance? variant-id) + {:title (tr "workspace.shape.menu.add-variant-property") + :action do-add-new-property})]] (filter (complement nil?) menu-entries)))