Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39b92aa

Browse files
author
FalkWolsky
committed
Supressed editDSL actions - as we have pure viewer
1 parent 647d7f4 commit 39b92aa

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

viewer/packages/lowcoder/src/comps/generators/uiCompBuilder.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function HidableView(props: {
4444
</>
4545
);
4646
}
47-
}
47+
}
4848

4949
export function uiChildren<
5050
ChildrenCompMap extends Record<string, Comp<unknown>>,
@@ -87,6 +87,13 @@ export class UICompBuilder<
8787
this.viewFn = viewFn;
8888
}
8989

90+
// TODO: Kagayaki - we need to check, how can we "remove" setPropertyViewFn - but keep the support for the component plugins (npmLoader) (remote-comp)
91+
setPropertyViewFn(
92+
propertyViewFn: any
93+
) {
94+
return true;
95+
}
96+
9097
setExposeStateConfigs(
9198
configs: ExposingConfig<ChildrenToComp<ChildrenCompMap>>[]
9299
) {

viewer/packages/lowcoder/src/comps/utils/useCompInstance.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,20 @@ export function getCompContainer<T extends CompConstructor>(params: GetContainer
204204
// 1ms
205205
const reduceFn = wrapWithPromiseHandling((act: CompAction) => {
206206
let action = act;
207-
if (reduceContext && reduceContext.readOnly && action.editDSL) {
207+
208+
/* if (reduceContext && reduceContext.readOnly && action.editDSL) {
208209
log.info("editDSL should be false in view mode, action: ", action);
209-
action = { ...action, editDSL: false };
210-
}
210+
// action = { ...action, editDSL: false };
211+
} */
211212

212213
// console.info("~~ action: ", action);
213214
tmpComp = reduceContext
214215
? reduceInContext(reduceContext, () => tmpComp.reduce(action))
215216
: tmpComp.reduce(action);
216-
actions.push(action);
217+
218+
if (reduceContext && !reduceContext.readOnly && !action.editDSL) {
219+
actions.push(action);
220+
}
217221

218222
// record the time of the first calm down
219223
if (!this.appCalmDowned) {

0 commit comments

Comments
 (0)