Skip to content

Commit 8283f52

Browse files
authored
Merge pull request #781 from raheeliftikhar5/module_loading_issues
Module loading issues
2 parents d51734a + 365e46f commit 8283f52

File tree

6 files changed

+38
-24
lines changed

6 files changed

+38
-24
lines changed

client/packages/lowcoder-design/src/components/ScrollBar.tsx

+13-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import styled from "styled-components";
55
import { DebouncedFunc } from 'lodash'; // Assuming you're using lodash's DebouncedFunc type
66

77

8-
const ScrollBarWrapper = styled.div<{ hidePlaceholder?: boolean }>`
8+
const ScrollBarWrapper = styled.div<{ $hideplaceholder?: boolean }>`
99
min-height: 0;
1010
height: 100%;
1111
width: 100%;
@@ -37,7 +37,7 @@ const ScrollBarWrapper = styled.div<{ hidePlaceholder?: boolean }>`
3737
bottom: 10px;
3838
}
3939
40-
${props => props.hidePlaceholder && `
40+
${props => Boolean(props.$hideplaceholder) && `
4141
.simplebar-placeholder {
4242
display: none !important;
4343
}
@@ -54,11 +54,20 @@ interface IProps {
5454
scrollableNodeProps?: {
5555
onScroll: DebouncedFunc<(e: any) => void>;
5656
};
57-
hidePlaceholder?: boolean;
57+
$hideplaceholder?: boolean;
5858
hideScrollbar?: boolean;
5959
}
6060

61-
export const ScrollBar = ({ height = "100%", className, children, style, scrollableNodeProps, hideScrollbar = false, ...otherProps }: IProps) => {
61+
export const ScrollBar = ({
62+
height = "100%",
63+
className,
64+
children,
65+
style,
66+
scrollableNodeProps,
67+
hideScrollbar = false,
68+
$hideplaceholder = false,
69+
...otherProps
70+
}: IProps) => {
6271
// You can now use the style prop directly or pass it to SimpleBar
6372
const combinedStyle = { ...style, height }; // Example of combining height with passed style
6473

client/packages/lowcoder-design/src/components/Section.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const BaseSection = (props: ISectionConfig<ReactNode>) => {
106106
const { compName, state, toggle } = useContext(PropertySectionContext);
107107
const open = props.open !== undefined ? props.open : name ? state[compName]?.[name] !== false : true;
108108

109-
console.log("open", open, props.open);
109+
// console.log("open", open, props.open);
110110

111111
const handleToggle = () => {
112112
if (!name) {

client/packages/lowcoder/src/appView/AppView.tsx

+19-14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { default as App } from "antd/es/app";
2+
import GlobalInstances from "components/GlobalInstances";
13
import { RootComp } from "comps/comps/rootComp";
24
import { GetContainerParams, useCompInstance } from "comps/utils/useCompInstance";
35
import { createBrowserHistory } from "history";
@@ -88,19 +90,22 @@ export function AppView(props: AppViewProps) {
8890
}, [moduleInputs]);
8991

9092
return (
91-
<Provider store={reduxStore}>
92-
<ExternalEditorContext.Provider
93-
value={{
94-
applicationId: appId,
95-
appType: 1,
96-
readOnly: true,
97-
hideHeader: true,
98-
}}
99-
>
100-
<Router history={browserHistory}>
101-
<Route path="/" render={() => comp?.getView()} />
102-
</Router>
103-
</ExternalEditorContext.Provider>
104-
</Provider>
93+
<App>
94+
<GlobalInstances />
95+
<Provider store={reduxStore}>
96+
<ExternalEditorContext.Provider
97+
value={{
98+
applicationId: appId,
99+
appType: 1,
100+
readOnly: true,
101+
hideHeader: true,
102+
}}
103+
>
104+
<Router history={browserHistory}>
105+
<Route path="/" render={() => comp?.getView()} />
106+
</Router>
107+
</ExternalEditorContext.Provider>
108+
</Provider>
109+
</App>
105110
);
106111
}

client/packages/lowcoder/src/comps/comps/moduleContainerComp/moduleLayoutComp.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class ModuleLayoutComp extends ModuleLayoutCompBase implements IContainer
116116
const rowCount = this.children.containerRowCount.getView();
117117
return (
118118
<div>
119-
<ScrollBar style={{ height: "100%", margin: "0px", padding: "0px" }} hidePlaceholder={false}>
119+
<ScrollBar style={{ height: "100%", margin: "0px", padding: "0px" }} $hideplaceholder={false}>
120120
<ModuleLayoutView
121121
positionParams={this.children.positionParams.getView()}
122122
containerSize={this.children.containerSize.getView()}

client/packages/lowcoder/src/comps/queries/queryComp.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ function QueryView(props: QueryViewProps) {
282282
) {
283283
setTimeout(() => {
284284
comp.dispatch(deferAction(executeQueryAction({})));
285-
});
285+
}, 100);
286286
}
287287
}, []);
288288

client/packages/lowcoder/src/comps/queries/queryComp/queryNotificationControl.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const SuccessMessageAction = new MultiCompBuilder(
2323
{
2424
text: StringControl,
2525
},
26-
(props) => (duration: number) => props.text && messageInstance.success(props.text, duration)
26+
(props) => (duration: number) => props.text && messageInstance?.success(props.text, duration)
2727
)
2828
.setPropertyViewFn((children) => (
2929
<>
@@ -109,14 +109,14 @@ const QueryNotificationTmpControl = new MultiCompBuilder(
109109
props.fail.forEach((item) => {
110110
const props = (item.getView() as any)({ data: result.data });
111111
if (props.condition && props.text) {
112-
messageInstance.error(props.text, duration);
112+
messageInstance?.error(props.text, duration);
113113
hasNoticed = true;
114114
}
115115
});
116116

117117
// Execute system notification if triggered manually without custom notification and query fails
118118
if (!result.success && !hasNoticed) {
119-
hasNoticed = !!messageInstance.error(
119+
hasNoticed = !!messageInstance?.error(
120120
trans("query.failMessageWithName", {
121121
name,
122122
result: JSON.stringify(pick(result, ["code", "message"])),

0 commit comments

Comments
 (0)