From d13b9ef3eaeca1ad3c7997d9a950f19e59cd1e63 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 22 Jul 2024 11:27:29 +0200 Subject: [PATCH] :bug: Fix wrap not working in plugins --- common/src/app/common/types/shape/layout.cljc | 5 ++--- frontend/src/app/plugins/flex.cljs | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/common/src/app/common/types/shape/layout.cljc b/common/src/app/common/types/shape/layout.cljc index d30598974..4f8e542ac 100644 --- a/common/src/app/common/types/shape/layout.cljc +++ b/common/src/app/common/types/shape/layout.cljc @@ -48,8 +48,7 @@ #{:flex :grid}) (def flex-direction-types - ;;TODO remove reverse-column and reverse-row after script - #{:row :reverse-row :row-reverse :column :reverse-column :column-reverse}) + #{:row :row-reverse :column :column-reverse}) (def grid-direction-types #{:row :column}) @@ -58,7 +57,7 @@ #{:simple :multiple}) (def wrap-types - #{:wrap :nowrap :no-wrap}) ;;TODO remove no-wrap after script + #{:wrap :nowrap}) (def padding-type #{:simple :multiple}) diff --git a/frontend/src/app/plugins/flex.cljs b/frontend/src/app/plugins/flex.cljs index 9b6e89673..9f65e6f34 100644 --- a/frontend/src/app/plugins/flex.cljs +++ b/frontend/src/app/plugins/flex.cljs @@ -66,6 +66,22 @@ (let [id (obj/get self "$id")] (st/emit! (dwsl/update-layout #{id} {:layout-flex-dir value}))))))} + {:name "wrap" + :get #(-> % u/proxy->shape :layout-wrap-type d/name) + :set + (fn [self value] + (let [value (keyword value)] + (cond + (not (contains? ctl/wrap-types value)) + (u/display-not-valid :wrap value) + + (not (r/check-permission plugin-id "content:write")) + (u/display-not-valid :wrap "Plugin doesn't have 'content:write' permission") + + :else + (let [id (obj/get self "$id")] + (st/emit! (dwsl/update-layout #{id} {:layout-wrap-type value}))))))} + {:name "alignItems" :get #(-> % u/proxy->shape :layout-align-items d/name) :set