diff --git a/client/packages/lowcoder/src/comps/comps/formComp/formComp.tsx b/client/packages/lowcoder/src/comps/comps/formComp/formComp.tsx index e0fce300c..84a7b7156 100644 --- a/client/packages/lowcoder/src/comps/comps/formComp/formComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/formComp/formComp.tsx @@ -208,13 +208,17 @@ const FormBaseComp = (function () { ); }) .setPropertyViewFn((children) => { + const editorContext = useContext(EditorContext); + const isLogicMode = editorContext.editorModeStatus === "logic" || editorContext.editorModeStatus === "both"; + const isLayoutMode = editorContext.editorModeStatus === "layout" || editorContext.editorModeStatus === "both"; + return ( <>
{children.resetAfterSubmit.propertyView({ label: trans("formComp.resetAfterSubmit") })}
- {(useContext(EditorContext).editorModeStatus === "logic" || useContext(EditorContext).editorModeStatus === "both") && ( + {isLogicMode && ( <>
{children.onEvent.getPropertyView()} {disabledPropertyView(children)} @@ -225,7 +229,7 @@ const FormBaseComp = (function () { )} - {(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && ( + {isLayoutMode && ( <>
{children.container.getPropertyView()} @@ -233,14 +237,14 @@ const FormBaseComp = (function () { )} - {(useContext(EditorContext).editorModeStatus === "logic" || useContext(EditorContext).editorModeStatus === "both") && ( + {isLogicMode && (
{children.initialData.propertyView({ label: trans("formComp.initialData") })} {children.invalidFormMessage.propertyView({ label: trans("formComp.invalidFormMessage") })}
)} - {(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && ( + {isLayoutMode && ( <>
{children.container.stylePropertyView()} @@ -383,9 +387,7 @@ let FormTmpComp = class extends FormBaseComp implements IForm { case CompActionTypes.UPDATE_NODES_V2: { const ret = super.reduce(action); // When the initial value changes, update the form - if (ret.children.initialData !== this.children.initialData) { - // FIXME: kill setTimeout ? - setTimeout(() => { + requestAnimationFrame(() => { this.dispatch( customAction( { @@ -396,7 +398,6 @@ let FormTmpComp = class extends FormBaseComp implements IForm { ) ); }); - } return ret; } case CompActionTypes.CUSTOM: diff --git a/client/packages/lowcoder/src/redux/sagas/orgSagas.ts b/client/packages/lowcoder/src/redux/sagas/orgSagas.ts index dd64bf1c9..e4157abde 100644 --- a/client/packages/lowcoder/src/redux/sagas/orgSagas.ts +++ b/client/packages/lowcoder/src/redux/sagas/orgSagas.ts @@ -367,13 +367,15 @@ export function* fetchWorkspacesSaga(action: ReduxAction<{page: number, pageSize const apiData = response.data.data; // Transform orgId/orgName to match Org interface - const transformedItems = apiData.data.map(item => ({ - id: item.orgView.orgId, - name: item.orgView.orgName, - createdAt: item.orgView.createdAt, - updatedAt: item.orgView.updatedAt, - isCurrentOrg: item.isCurrentOrg, - })); + const transformedItems = apiData.data + .filter(item => item.orgView && item.orgView.orgId) + .map(item => ({ + id: item.orgView.orgId, + name: item.orgView.orgName, + createdAt: item.orgView.createdAt, + updatedAt: item.orgView.updatedAt, + isCurrentOrg: item.isCurrentOrg, + })); yield put({ type: ReduxActionTypes.FETCH_WORKSPACES_SUCCESS,