Skip to content

Commit cacd76c

Browse files
committed
chore: del log
1 parent 66d171e commit cacd76c

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

frontend/src/app/pages/DashBoardPage/components/WidgetCore/DataChartWidget/index.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ export const DataChartWidget: React.FC<{}> = memo(() => {
4646
const { id: widgetId } = widget;
4747
const { widgetChartClick } = useContext(WidgetMethodContext);
4848
const { ref, cacheW, cacheH } = useCacheWidthHeight();
49-
// console.log('_cacheW', cacheW);
50-
// console.log('cacheH', cacheH);
5149

5250
const widgetRef = useRef<Widget>(widget);
5351
useEffect(() => {
@@ -121,8 +119,6 @@ export const DataChartWidget: React.FC<{}> = memo(() => {
121119
);
122120

123121
const chartFrame = useMemo(() => {
124-
// console.log('_chartFrame', widgetId);
125-
126122
if (!dataChart) {
127123
return `not found dataChart`;
128124
}

frontend/src/app/pages/DashBoardPage/components/WidgetProvider/WidgetDataProvider.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
import { WidgetData } from 'app/pages/DashBoardPage/pages/Board/slice/types';
20-
import React, { createContext, FC, useContext } from 'react';
20+
import React, { createContext, FC, useContext, useMemo } from 'react';
2121
import { useSelector } from 'react-redux';
2222
import { selectWidgetDataById } from '../../pages/Board/slice/selector';
2323
import { BoardState } from '../../pages/Board/slice/types';
@@ -42,7 +42,9 @@ export const WidgetDataProvider: FC<{ widgetId: string }> = ({
4242
const editWidgetData = useSelector((state: { editBoard: EditBoardState }) =>
4343
selectEditWidgetData(state, widgetId),
4444
);
45-
const widgetData = editing ? editWidgetData : viewWidgetData;
45+
const widgetData = useMemo(() => {
46+
return editing ? editWidgetData : viewWidgetData;
47+
}, [editing, viewWidgetData, editWidgetData]);
4648
return (
4749
<WidgetDataContext.Provider value={{ data: widgetData }}>
4850
{boardId ? children : null}

frontend/src/app/pages/DashBoardPage/hooks/useAutoBoardRenderItem.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*/
18-
1918
import { useWidgetRowHeight } from 'app/hooks/useWidgetRowHeight';
2019
import { throttle } from 'echarts';
2120
import {
2221
RefObject,
2322
useCallback,
2423
useContext,
2524
useEffect,
26-
useLayoutEffect,
2725
useMemo,
2826
useRef,
2927
} from 'react';
@@ -35,9 +33,13 @@ export default function useAutoBoardRenderItem(
3533
margin: [number, number],
3634
) {
3735
const { ref, widgetRowHeight } = useWidgetRowHeight();
36+
3837
const { renderedWidgetById } = useContext(BoardContext);
38+
3939
const currentLayout = useRef<Layout[]>([]);
40+
4041
let waitItemInfos = useRef<{ id: string; rendered: boolean }[]>([]);
42+
4143
const gridWrapRef: RefObject<HTMLDivElement> = useRef(null);
4244

4345
useEffect(() => {
@@ -61,6 +63,7 @@ export default function useAutoBoardRenderItem(
6163
},
6264
[margin, widgetRowHeight],
6365
);
66+
6467
const lazyRender = useCallback(() => {
6568
if (!gridWrapRef.current) return;
6669
if (!waitItemInfos.current.length) return;
@@ -75,9 +78,10 @@ export default function useAutoBoardRenderItem(
7578
}, [calcItemTop, renderedWidgetById]);
7679

7780
const ttRender = useMemo(() => throttle(lazyRender, 50), [lazyRender]);
78-
useLayoutEffect(() => {
81+
82+
useEffect(() => {
7983
if (gridWrapRef.current) {
80-
lazyRender();
84+
setImmediate(() => lazyRender());
8185
gridWrapRef.current.removeEventListener('scroll', ttRender, false);
8286
gridWrapRef.current.addEventListener('scroll', ttRender, false);
8387
// issues#339

frontend/src/app/pages/DashBoardPage/pages/Board/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ export const Board: React.FC<BoardProps> = memo(
193193
let boardType = dashboard?.config?.type;
194194

195195
if (dashboard && boardType) {
196-
console.log('_has dashboard');
197196
return (
198197
<div className="board-provider">
199198
<BoardProvider

0 commit comments

Comments
 (0)