Console
@@ -125,8 +205,11 @@ function ConsolePanel(props: Props) {
name="filter"
height={28}
onChange={onFilterChange}
+ value={filter}
/>
+ {/* @ts-ignore */}
+ {/* @ts-ignore */}
}
size="small"
- show={filtered.length === 0}
+ show={filteredList.length === 0}
>
+ {/* @ts-ignore */}
{({ height, width }: any) => (
+ // @ts-ignore
)}
+ {/* @ts-ignore */}
);
@@ -170,6 +258,7 @@ export default connectPlayer((state: any) => {
})
);
return {
+ time: state.time,
logs: logs.concat(logExceptions),
};
})(ConsolePanel);
diff --git a/frontend/app/components/shared/DevTools/ConsoleRow/ConsoleRow.tsx b/frontend/app/components/shared/DevTools/ConsoleRow/ConsoleRow.tsx
index aae911d42..83929cbed 100644
--- a/frontend/app/components/shared/DevTools/ConsoleRow/ConsoleRow.tsx
+++ b/frontend/app/components/shared/DevTools/ConsoleRow/ConsoleRow.tsx
@@ -2,8 +2,6 @@ import React, { useState } from 'react';
import cn from 'classnames';
import { Icon } from 'UI';
import JumpButton from 'Shared/DevTools/JumpButton';
-import { useModal } from 'App/components/Modal';
-import ErrorDetailsModal from 'App/components/Dashboard/components/Errors/ErrorDetailsModal';
interface Props {
log: any;
@@ -12,24 +10,20 @@ interface Props {
renderWithNL?: any;
style?: any;
recalcHeight?: () => void;
+ onClick: () => void;
}
function ConsoleRow(props: Props) {
const { log, iconProps, jump, renderWithNL, style, recalcHeight } = props;
- const { showModal } = useModal();
const [expanded, setExpanded] = useState(false);
const lines = log.value.split('\n').filter((l: any) => !!l);
const canExpand = lines.length > 1;
const clickable = canExpand || !!log.errorId;
- const onErrorClick = () => {
- showModal(
, { right: true });
- };
-
const toggleExpand = () => {
- setExpanded(!expanded)
- setTimeout(() => recalcHeight(), 0)
- }
+ setExpanded(!expanded);
+ setTimeout(() => recalcHeight(), 0);
+ };
return (
(!!log.errorId ? onErrorClick() : toggleExpand()) : () => {}
- }
+ onClick={clickable ? () => (!!log.errorId ? props.onClick() : toggleExpand()) : () => {}}
>
@@ -57,7 +49,13 @@ function ConsoleRow(props: Props) {
)}
{renderWithNL(lines.pop())}
- {canExpand && expanded && lines.map((l: string, i: number) =>
{l}
)}
+ {canExpand &&
+ expanded &&
+ lines.map((l: string, i: number) => (
+
+ {l}
+
+ ))}
jump(log.time)} />
diff --git a/frontend/app/components/shared/DevTools/NetworkPanel/NetworkPanel.tsx b/frontend/app/components/shared/DevTools/NetworkPanel/NetworkPanel.tsx
index 1acb51ac2..634aa9bae 100644
--- a/frontend/app/components/shared/DevTools/NetworkPanel/NetworkPanel.tsx
+++ b/frontend/app/components/shared/DevTools/NetworkPanel/NetworkPanel.tsx
@@ -142,9 +142,6 @@ function NetworkPanel(props: Props) {
const { resources, time, domContentLoadedTime, loadTime, domBuildingTime, fetchList } = props;
const { showModal } = useModal();
- const [sortBy, setSortBy] = useState('time');
- const [sortAscending, setSortAscending] = useState(true);
-
const [filteredList, setFilteredList] = useState([]);
const [showOnlyErrors, setShowOnlyErrors] = useState(false);
const [isDetailsModalActive, setIsDetailsModalActive] = useState(false);
@@ -234,13 +231,6 @@ function NetworkPanel(props: Props) {
(list = list.filter((networkCall: any) => networkCall.url !== fetchCall.url))
);
list = list.concat(fetchList);
- // list = list.sort((a: any, b: any) => {
- // return compare(a, b, sortBy);
- // });
-
- // if (!sortAscending) {
- // list = list.reverse();
- // }
list = list.filter(
({ type, name, status, success }: any) =>
@@ -249,7 +239,7 @@ function NetworkPanel(props: Props) {
(showOnlyErrors ? parseInt(status) >= 400 || !success : true)
);
setFilteredList(list);
- }, [resources, filter, sortBy, sortAscending, showOnlyErrors, activeTab]);
+ }, [resources, filter, showOnlyErrors, activeTab]);
const referenceLines = useMemo(() => {
const arr = [];
@@ -283,13 +273,6 @@ function NetworkPanel(props: Props) {
setPauseSync(true);
};
- const handleSort = (sortKey: string) => {
- if (sortKey === sortBy) {
- setSortAscending(!sortAscending);
- }
- setSortBy(sortKey);
- };
-
useEffect(() => {
devTools.update(INDEX_KEY, { filter, activeTab });
}, [filter, activeTab]);
@@ -387,8 +370,6 @@ function NetworkPanel(props: Props) {
devTools.update(INDEX_KEY, { index: filteredList.indexOf(row) });
jump(row.time);
}}
- sortBy={sortBy}
- sortAscending={sortAscending}
activeIndex={activeIndex}
>
{[
@@ -401,28 +382,24 @@ function NetworkPanel(props: Props) {
label: 'Status',
dataKey: 'status',
width: 70,
- // onClick: handleSort,
},
{
label: 'Type',
dataKey: 'type',
width: 90,
render: renderType,
- // onClick: handleSort,
},
{
label: 'Name',
width: 240,
dataKey: 'name',
render: renderName,
- // onClick: handleSort,
},
{
label: 'Size',
width: 80,
dataKey: 'decodedBodySize',
render: renderSize,
- // onClick: handleSort,
hidden: activeTab === XHR,
},
{
@@ -430,7 +407,6 @@ function NetworkPanel(props: Props) {
width: 80,
dataKey: 'duration',
render: renderDuration,
- // onClick: handleSort,
},
]}
diff --git a/frontend/app/components/shared/DevTools/StackEventPanel/StackEventPanel.tsx b/frontend/app/components/shared/DevTools/StackEventPanel/StackEventPanel.tsx
index 929a0e283..557c72172 100644
--- a/frontend/app/components/shared/DevTools/StackEventPanel/StackEventPanel.tsx
+++ b/frontend/app/components/shared/DevTools/StackEventPanel/StackEventPanel.tsx
@@ -127,6 +127,13 @@ function StackEventPanel(props: Props) {
);
};
+ useEffect(() => {
+ if (_list.current) {
+ // @ts-ignore
+ _list.current.scrollToRow(activeIndex);
+ }
+ }, [activeIndex]);
+
return (