From d9d0883c09523c19f5e7e21ab46ed00fee7fcc4b Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Thu, 14 Mar 2024 20:48:22 +0500 Subject: [PATCH 1/4] fix crashing on reordering comps inside module --- .../src/pages/editor/LeftLayersContent.tsx | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/client/packages/lowcoder/src/pages/editor/LeftLayersContent.tsx b/client/packages/lowcoder/src/pages/editor/LeftLayersContent.tsx index 178e25138..911427601 100644 --- a/client/packages/lowcoder/src/pages/editor/LeftLayersContent.tsx +++ b/client/packages/lowcoder/src/pages/editor/LeftLayersContent.tsx @@ -33,6 +33,7 @@ import { import { DownOutlined } from "@ant-design/icons"; import { ItemType } from "antd/es/menu/hooks/useItems"; import ColorPicker, { configChangeParams } from "components/ColorPicker"; +import { ModuleLayoutComp } from "@lowcoder-ee/comps/comps/moduleContainerComp/moduleLayoutComp"; export type DisabledCollisionStatus = "true" | "false"; // "true" means collision is not enabled - Layering works, "false" means collision is enabled - Layering does not work @@ -209,17 +210,31 @@ export const LeftLayersContent = (props: LeftLayersContentProps) => { const dsl = editorState.rootComp.toJsonValue(); let layout: any = {}; - parentNode.children.forEach((data, index) => { - layout[data.key] = { - ...dsl.ui.layout[data.key], - pos: index, - }; - }) - - editorState.rootComp.children.ui.dispatchChangeValueAction({ - ...dsl.ui, - layout, - }) + if(dsl.ui.compType === 'module') { + parentNode.children.forEach((data, index) => { + layout[data.key] = { + ...dsl.ui.comp.container.layout[data.key], + pos: index, + }; + }) + const moduleLayoutComp = editorState.rootComp.children.ui.getModuleLayoutComp(); + moduleLayoutComp?.children.container.dispatchChangeValueAction({ + ...dsl.ui.comp.container, + layout, + }) + } else { + parentNode.children.forEach((data, index) => { + layout[data.key] = { + ...dsl.ui.layout[data.key], + pos: index, + }; + }) + + editorState.rootComp.children.ui.dispatchChangeValueAction({ + ...dsl.ui, + layout, + }) + } return newTreeData; }); } From 3af570bdc85f00a7e00cce4041a6649425483df6 Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Thu, 14 Mar 2024 20:48:52 +0500 Subject: [PATCH 2/4] fix broken modal issue --- client/packages/lowcoder/src/comps/hooks/modalComp.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/packages/lowcoder/src/comps/hooks/modalComp.tsx b/client/packages/lowcoder/src/comps/hooks/modalComp.tsx index fe9a6503a..9adc36385 100644 --- a/client/packages/lowcoder/src/comps/hooks/modalComp.tsx +++ b/client/packages/lowcoder/src/comps/hooks/modalComp.tsx @@ -161,7 +161,7 @@ let TmpModalComp = (function () { items={gridItemCompToGridItems(items)} autoHeight={props.autoHeight} minHeight={paddingValues ? DEFAULT_HEIGHT - paddingValues[0] * 2 + "px" : ""} - containerPadding={paddingValues ? [paddingValues[0], paddingValues[1]] : [24,24]} + containerPadding={paddingValues ? [paddingValues[0] ?? 0, paddingValues[1] ?? 0] : [24,24]} hintPlaceholder={HintPlaceHolder} /> From 8ef0a65924f2d1b30a0dcf83ecde452ba07cc8bc Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Fri, 15 Mar 2024 01:42:18 +0500 Subject: [PATCH 3/4] fix bulk action updates doesn't change all comps height --- client/packages/lowcoder/src/layout/gridLayout.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/packages/lowcoder/src/layout/gridLayout.tsx b/client/packages/lowcoder/src/layout/gridLayout.tsx index 83facb75e..9dec97a2d 100644 --- a/client/packages/lowcoder/src/layout/gridLayout.tsx +++ b/client/packages/lowcoder/src/layout/gridLayout.tsx @@ -400,8 +400,15 @@ class GridLayout extends React.Component { // const ops = layoutOpUtils.push(this.state.ops, stickyItemOp(i, { h })); // this.setState({ ops }); if (this.state.changedHs?.[i] !== h) { - const changedHeights = { ...this.state.changedHs, [i]: h }; - this.setState({ changedHs: changedHeights }); + this.setState((prevState) => { + return { + ...prevState, + changedHs: { + ...prevState.changedHs, + [i]: h, + } + } + }) } }; From 9137090458d4f09c62b273c04bda8747ab8393e5 Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Fri, 15 Mar 2024 02:03:51 +0500 Subject: [PATCH 4/4] fix iconSelector issue in js --- client/packages/lowcoder/src/comps/controls/iconControl.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/packages/lowcoder/src/comps/controls/iconControl.tsx b/client/packages/lowcoder/src/comps/controls/iconControl.tsx index ca954b47d..e33688510 100644 --- a/client/packages/lowcoder/src/comps/controls/iconControl.tsx +++ b/client/packages/lowcoder/src/comps/controls/iconControl.tsx @@ -165,7 +165,7 @@ function IconCodeEditor(props: { visible={visible} setVisible={setVisible} trigger="contextMenu" - parent={document.querySelector(`${CodeEditorTooltipContainer}`)} + // parent={document.querySelector(`${CodeEditorTooltipContainer}`)} searchKeywords={i18nObjs.iconSearchKeywords} /> ),