From b9b4abf1e0b9a51db51daa8db203324a7f0e338d Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Wed, 24 Jul 2024 16:10:41 +0200 Subject: [PATCH] Fix edit modal not opening --- frontend/src/app/main/ui/workspace/tokens/context_menu.cljs | 4 ++-- frontend/src/app/main/ui/workspace/tokens/token_types.cljs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs b/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs index 14e1c1935..fcf3d95a7 100644 --- a/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs @@ -33,7 +33,7 @@ :selected-pred #(seq (% ids-by-attributes))})) (defn generic-attribute-actions [attributes title {:keys [token selected-shapes]}] - (let [{:keys [on-update-shape]} (get wtty/token-types (:type token)) + (let [{:keys [on-update-shape]} (wtty/get-token-properties token) {:keys [selected-pred shape-ids]} (attribute-actions token selected-shapes attributes)] (map (fn [attribute] (let [selected? (selected-pred attribute) @@ -200,7 +200,7 @@ (generic-attribute-actions #{:y} "Y" context-data)))})) (defn default-actions [{:keys [token]}] - (let [{:keys [modal]} (get wtty/token-types token)] + (let [{:keys [modal]} (wtty/get-token-properties token)] [{:title "Delete Token" :action #(st/emit! (dt/delete-token (:id token)))} {:title "Duplicate Token" diff --git a/frontend/src/app/main/ui/workspace/tokens/token_types.cljs b/frontend/src/app/main/ui/workspace/tokens/token_types.cljs index 04ae55aea..d3bb2c0e5 100644 --- a/frontend/src/app/main/ui/workspace/tokens/token_types.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/token_types.cljs @@ -100,5 +100,8 @@ {:label "Text Decoration" :key :text-decoration} {:label "Text Case" :key :text-case}]}}]))) +(defn get-token-properties [token] + (get token-types (:type token))) + (defn token-attributes [token-type] (get-in token-types [token-type :attributes]))