From 08ccd7be70b17662beee41be1e5db5f1a0e1c6fb Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 24 Aug 2022 14:03:38 +0200 Subject: [PATCH] :bug: Fix drag and drop boards --- frontend/src/app/main/data/workspace/transforms.cljs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index 02d8d7fc8d..0cf7664d3a 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -16,6 +16,7 @@ [app.common.pages.common :as cpc] [app.common.pages.helpers :as cph] [app.common.spec :as us] + [app.common.uuid :as uuid] [app.main.data.workspace.changes :as dch] [app.main.data.workspace.collapse :as dwc] [app.main.data.workspace.comments :as dwcm] @@ -876,7 +877,15 @@ changes (-> (pcb/empty-changes it page-id) (pcb/with-objects objects) - (pcb/update-shapes moving-frames (fn [shape] (assoc shape :hide-in-viewer true))) + (pcb/update-shapes moving-frames (fn [shape] + ;; Hide in viwer must be enabled just when a board is moved inside another artboard an nested to it, we have to avoid situations like: + ;; - Moving inside the same frame + ;; - Moving outside the frame + (cond-> shape + (and (not= frame-id (:id shape)) + (not= frame-id (:frame-id shape)) + (not= frame-id uuid/zero)) + (assoc :hide-in-viewer true)))) (pcb/change-parent frame-id moving-shapes))] (when-not (empty? changes)