Skip to content

Commit 1e7cb91

Browse files
committed
Processed loading indicator.
1 parent be65063 commit 1e7cb91

File tree

6 files changed

+19
-3
lines changed

6 files changed

+19
-3
lines changed

client/packages/lowcoder/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
display: flex;
2929
pointer-events: none;
3030
flex-direction: column;
31+
top: 0;
32+
z-index: 10000;
3133
}
3234
#loading svg {
3335
animation: breath 1s linear infinite;

client/packages/lowcoder/src/comps/comps/rootComp.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { ExternalEditorContext } from "util/context/ExternalEditorContext";
3434
import { useUserViewMode } from "util/hooks";
3535
import React from "react";
3636
import { isEqual } from "lodash";
37+
import {LoadingBarHideTrigger} from "@lowcoder-ee/util/hideLoading";
3738

3839
const EditorView = lazy(
3940
() => import("pages/editor/editorView"),
@@ -138,6 +139,7 @@ const RootView = React.memo((props: RootViewProps) => {
138139
<div key={key}>{comp.children.queries.children[key].getView()}</div>
139140
))}
140141
<Suspense fallback={!readOnly || isUserViewMode ? SuspenseFallback : null}>
142+
<LoadingBarHideTrigger />
141143
<EditorView uiComp={comp.children.ui} preloadComp={comp.children.preload} />
142144
</Suspense>
143145
</EditorContext.Provider>

client/packages/lowcoder/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as uuid from "uuid";
88
import "regenerator-runtime/runtime";
99
import { debug } from "loglevel";
1010
import "./index.less";
11-
import log from "loglevel";
1211
import "antd-mobile/es/global";
1312
import 'animate.css';
1413
import {initTranslator as initTranslatorDesign} from "i18n/design";
@@ -25,7 +24,7 @@ if (!window.ResizeObserver) {
2524
window.ResizeObserver = ResizeObserver;
2625
}
2726

28-
function hideLoading() {
27+
export function hideLoading() {
2928
// hide loading
3029
const node = document.getElementById("loading");
3130
if (node) {
@@ -49,6 +48,5 @@ initTranslatorDesign().then(() => {
4948
const bootstrap = await import("./bootstrap/view/app").then(module => module.bootstrap);
5049
bootstrap();
5150
}
52-
hideLoading();
5351
})
5452
})

client/packages/lowcoder/src/pages/ApplicationV2/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import AppEditor from "../editor/AppEditor";
6868
import { set } from "lodash";
6969
import {MultiIconDisplay} from "@lowcoder-ee/comps/comps/multiIconDisplay";
7070
import {initTranslator as initTranslatorDesign} from "i18n/design";
71+
import {LoadingBarHideTrigger} from "@lowcoder-ee/util/hideLoading";
7172

7273
const TabLabel = styled.div`
7374
font-weight: 500;
@@ -218,6 +219,7 @@ export default function ApplicationHome() {
218219

219220
return (
220221
<DivStyled>
222+
<LoadingBarHideTrigger />
221223
<Layout
222224
sections={[
223225
{

client/packages/lowcoder/src/pages/userAuth/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { fetchConfigAction } from "redux/reduxActions/configActions";
1111
import { fetchUserAction } from "redux/reduxActions/userActions";
1212
import LoginAdmin from "./loginAdmin";
1313
import _ from "lodash";
14+
import {LoadingBarHideTrigger} from "@lowcoder-ee/util/hideLoading";
1415

1516
export default function UserAuth() {
1617
const dispatch = useDispatch();
@@ -50,6 +51,7 @@ export default function UserAuth() {
5051
fetchUserAfterAuthSuccess,
5152
}}
5253
>
54+
<LoadingBarHideTrigger />
5355
<Switch location={location}>
5456
<Redirect exact from={USER_AUTH_URL} to={AUTH_LOGIN_URL} />
5557
<Route exact path={ADMIN_AUTH_URL} component={LoginAdmin} />
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import {useEffect} from "react";
2+
import {hideLoading} from "@lowcoder-ee/index";
3+
4+
export const LoadingBarHideTrigger = function(props: any) {
5+
useEffect(() => {
6+
setTimeout(() => hideLoading(), 300);
7+
}, []);
8+
9+
return <></>
10+
};

0 commit comments

Comments
 (0)