Skip to content

Child element on Form not populating #1872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions client/packages/lowcoder/src/comps/comps/formComp/formComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
<Section name={sectionNames.basic}>
{children.resetAfterSubmit.propertyView({ label: trans("formComp.resetAfterSubmit") })}
</Section>

{(useContext(EditorContext).editorModeStatus === "logic" || useContext(EditorContext).editorModeStatus === "both") && (
{isLogicMode && (
<><Section name={sectionNames.interaction}>
{children.onEvent.getPropertyView()}
{disabledPropertyView(children)}
Expand All @@ -225,22 +229,22 @@ const FormBaseComp = (function () {
</>
)}

{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && (
{isLayoutMode && (
<>
<Section name={sectionNames.layout}>
{children.container.getPropertyView()}
</Section>
</>
)}

{(useContext(EditorContext).editorModeStatus === "logic" || useContext(EditorContext).editorModeStatus === "both") && (
{isLogicMode && (
<Section name={sectionNames.advanced}>
{children.initialData.propertyView({ label: trans("formComp.initialData") })}
{children.invalidFormMessage.propertyView({ label: trans("formComp.invalidFormMessage") })}
</Section>
)}

{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && (
{isLayoutMode && (
<>
<Section name={sectionNames.style}>
{children.container.stylePropertyView()}
Expand Down Expand Up @@ -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<SetDataAction>(
{
Expand All @@ -396,7 +398,6 @@ let FormTmpComp = class extends FormBaseComp implements IForm {
)
);
});
}
return ret;
}
case CompActionTypes.CUSTOM:
Expand Down
16 changes: 9 additions & 7 deletions client/packages/lowcoder/src/redux/sagas/orgSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading