Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfc128f4

Browse files
committed
fix: Form child element not updating
1 parentf60c3e6 commitfc128f4

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

‎client/packages/lowcoder/src/comps/comps/formComp/formComp.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,17 @@ const FormBaseComp = (function () {
208208
);
209209
})
210210
.setPropertyViewFn((children)=>{
211+
consteditorContext=useContext(EditorContext);
212+
constisLogicMode=editorContext.editorModeStatus==="logic"||editorContext.editorModeStatus==="both";
213+
constisLayoutMode=editorContext.editorModeStatus==="layout"||editorContext.editorModeStatus==="both";
214+
211215
return(
212216
<>
213217
<Sectionname={sectionNames.basic}>
214218
{children.resetAfterSubmit.propertyView({label:trans("formComp.resetAfterSubmit")})}
215219
</Section>
216220

217-
{(useContext(EditorContext).editorModeStatus==="logic"||useContext(EditorContext).editorModeStatus==="both")&&(
221+
{isLogicMode&&(
218222
<><Sectionname={sectionNames.interaction}>
219223
{children.onEvent.getPropertyView()}
220224
{disabledPropertyView(children)}
@@ -225,22 +229,22 @@ const FormBaseComp = (function () {
225229
</>
226230
)}
227231

228-
{(useContext(EditorContext).editorModeStatus==="layout"||useContext(EditorContext).editorModeStatus==="both")&&(
232+
{isLayoutMode&&(
229233
<>
230234
<Sectionname={sectionNames.layout}>
231235
{children.container.getPropertyView()}
232236
</Section>
233237
</>
234238
)}
235239

236-
{(useContext(EditorContext).editorModeStatus==="logic"||useContext(EditorContext).editorModeStatus==="both")&&(
240+
{isLogicMode&&(
237241
<Sectionname={sectionNames.advanced}>
238242
{children.initialData.propertyView({label:trans("formComp.initialData")})}
239243
{children.invalidFormMessage.propertyView({label:trans("formComp.invalidFormMessage")})}
240244
</Section>
241245
)}
242246

243-
{(useContext(EditorContext).editorModeStatus==="layout"||useContext(EditorContext).editorModeStatus==="both")&&(
247+
{isLayoutMode&&(
244248
<>
245249
<Sectionname={sectionNames.style}>
246250
{children.container.stylePropertyView()}
@@ -383,9 +387,7 @@ let FormTmpComp = class extends FormBaseComp implements IForm {
383387
caseCompActionTypes.UPDATE_NODES_V2:{
384388
constret=super.reduce(action);
385389
// When the initial value changes, update the form
386-
if(ret.children.initialData!==this.children.initialData){
387-
// FIXME: kill setTimeout ?
388-
setTimeout(()=>{
390+
requestAnimationFrame(()=>{
389391
this.dispatch(
390392
customAction<SetDataAction>(
391393
{
@@ -396,7 +398,6 @@ let FormTmpComp = class extends FormBaseComp implements IForm {
396398
)
397399
);
398400
});
399-
}
400401
returnret;
401402
}
402403
caseCompActionTypes.CUSTOM:

‎client/packages/lowcoder/src/redux/sagas/orgSagas.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,15 @@ export function* fetchWorkspacesSaga(action: ReduxAction<{page: number, pageSize
367367
constapiData=response.data.data;
368368

369369
// Transform orgId/orgName to match Org interface
370-
consttransformedItems=apiData.data.map(item=>({
371-
id:item.orgView.orgId,
372-
name:item.orgView.orgName,
373-
createdAt:item.orgView.createdAt,
374-
updatedAt:item.orgView.updatedAt,
375-
isCurrentOrg:item.isCurrentOrg,
376-
}));
370+
consttransformedItems=apiData.data
371+
.filter(item=>item.orgView&&item.orgView.orgId)
372+
.map(item=>({
373+
id:item.orgView.orgId,
374+
name:item.orgView.orgName,
375+
createdAt:item.orgView.createdAt,
376+
updatedAt:item.orgView.updatedAt,
377+
isCurrentOrg:item.isCurrentOrg,
378+
}));
377379

378380
yieldput({
379381
type:ReduxActionTypes.FETCH_WORKSPACES_SUCCESS,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp