From c57899705b84803ca42773d9113bdecc0688cf1b Mon Sep 17 00:00:00 2001 From: "pong.promrat" Date: Tue, 21 Oct 2025 20:21:19 +0700 Subject: [PATCH] *Fix every widget above it was duplicated - https://team.digiserve.org/main/pl/sbmb7jh8yt84fxu5caa1mafr3a --- .../Designer/editors/views/ABViewContainer.js | 4 ++++ .../ui_work_interface_workspace_editor_layout.js | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/rootPages/Designer/editors/views/ABViewContainer.js b/src/rootPages/Designer/editors/views/ABViewContainer.js index 4edf15e8..5d7a9e54 100644 --- a/src/rootPages/Designer/editors/views/ABViewContainer.js +++ b/src/rootPages/Designer/editors/views/ABViewContainer.js @@ -81,6 +81,10 @@ export default function (AB) { init(AB) { var Dashboard = $$(this.ids.component); if (Dashboard) { + // Clear out any existing child views + Dashboard.getChildViews().forEach((childView) => { + Dashboard.removeView(childView); + }); webix.extend(Dashboard, webix.OverlayBox); webix.extend(Dashboard, webix.ProgressBar); } diff --git a/src/rootPages/Designer/ui_work_interface_workspace_editor_layout.js b/src/rootPages/Designer/ui_work_interface_workspace_editor_layout.js index 68e7f97d..6bdefd91 100644 --- a/src/rootPages/Designer/ui_work_interface_workspace_editor_layout.js +++ b/src/rootPages/Designer/ui_work_interface_workspace_editor_layout.js @@ -257,7 +257,18 @@ export default function (AB) { } // editorComponent.ui.id = ids.editArea; // webix.ui(editorComponent.ui, $$(ids.editArea)); - $$(ids.editArea).addView(editorComponent.ui()); + const editorUI = editorComponent.ui(); + editorUI.id = `${ids.editArea}_dashboard_layout`; + + // clear out widgets in our dashboard area + const idDashboard = editorUI.rows[0].id; + const $dashboard = $$(idDashboard); + if ($dashboard) $dashboard.clearAll(); + + // add the editorUI if it is not already added + if ($$(ids.editArea).queryView({ id: editorUI.id }) == null) + $$(ids.editArea).addView(editorUI); + editorComponent.init(this.AB, 2); // note: parentAccessLevel = 2 here in our Designer