mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 00:35:56 +08:00
fix: code scanning issues is fixed (#3522)
This commit is contained in:
parent
41f7a7993d
commit
86c34bd87d
8
frontend/src/container/ErrorDetails/config.ts
Normal file
8
frontend/src/container/ErrorDetails/config.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export const keyToExclude = [
|
||||
'exceptionStacktrace',
|
||||
'exceptionType',
|
||||
'errorId',
|
||||
'timestamp',
|
||||
'exceptionMessage',
|
||||
'exceptionEscaped',
|
||||
];
|
@ -14,12 +14,13 @@ import { useQuery } from 'react-query';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { PayloadProps as GetByErrorTypeAndServicePayload } from 'types/api/errors/getByErrorTypeAndService';
|
||||
|
||||
import { keyToExclude } from './config';
|
||||
import { DashedContainer, EditorContainer, EventContainer } from './styles';
|
||||
|
||||
function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
|
||||
const { idPayload } = props;
|
||||
const { t } = useTranslation(['errorDetails', 'common']);
|
||||
const { search } = useLocation();
|
||||
const { search, pathname } = useLocation();
|
||||
|
||||
const params = useMemo(() => new URLSearchParams(search), [search]);
|
||||
|
||||
@ -70,18 +71,6 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
|
||||
[],
|
||||
);
|
||||
|
||||
const keyToExclude = useMemo(
|
||||
() => [
|
||||
'exceptionStacktrace',
|
||||
'exceptionType',
|
||||
'errorId',
|
||||
'timestamp',
|
||||
'exceptionMessage',
|
||||
'exceptionEscaped',
|
||||
],
|
||||
[],
|
||||
);
|
||||
|
||||
const { notifications } = useNotifications();
|
||||
|
||||
const onClickErrorIdHandler = async (
|
||||
@ -102,9 +91,7 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
|
||||
errorId: id,
|
||||
};
|
||||
|
||||
history.replace(
|
||||
`${history.location.pathname}?${createQueryParams(queryParams)}`,
|
||||
);
|
||||
history.replace(`${pathname}?${createQueryParams(queryParams)}`);
|
||||
} catch (error) {
|
||||
notifications.error({
|
||||
message: t('something_went_wrong'),
|
||||
|
@ -19,6 +19,7 @@ import {
|
||||
} from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { connect, useSelector } from 'react-redux';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { DeleteWidget } from 'store/actions/dashboard/deleteWidget';
|
||||
@ -62,6 +63,7 @@ function WidgetGraphComponent({
|
||||
const [hovered, setHovered] = useState(false);
|
||||
const { notifications } = useNotifications();
|
||||
const { t } = useTranslation(['common']);
|
||||
const { pathname } = useLocation();
|
||||
|
||||
const { graphVisibilityStates: localstoredVisibilityStates } = useMemo(
|
||||
() =>
|
||||
@ -195,11 +197,7 @@ function WidgetGraphComponent({
|
||||
graphType: widget?.panelTypes,
|
||||
widgetId: uuid,
|
||||
};
|
||||
setTimeout(() => {
|
||||
history.push(
|
||||
`${history.location.pathname}/new?${createQueryParams(queryParams)}`,
|
||||
);
|
||||
}, 1500);
|
||||
history.push(`${pathname}/new?${createQueryParams(queryParams)}`);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -6,6 +6,7 @@ import createQueryParams from 'lib/createQueryParams';
|
||||
import history from 'lib/history';
|
||||
import { CSSProperties, useCallback } from 'react';
|
||||
import { connect, useSelector } from 'react-redux';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { bindActionCreators, Dispatch } from 'redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import {
|
||||
@ -24,6 +25,8 @@ function DashboardGraphSlider({ toggleAddWidget }: Props): JSX.Element {
|
||||
(state) => state.dashboards,
|
||||
);
|
||||
|
||||
const { pathname } = useLocation();
|
||||
|
||||
const { notifications } = useNotifications();
|
||||
|
||||
const [selectedDashboard] = dashboards;
|
||||
@ -51,16 +54,14 @@ function DashboardGraphSlider({ toggleAddWidget }: Props): JSX.Element {
|
||||
),
|
||||
};
|
||||
|
||||
history.push(
|
||||
`${history.location.pathname}/new?${createQueryParams(queryParams)}`,
|
||||
);
|
||||
history.push(`${pathname}/new?${createQueryParams(queryParams)}`);
|
||||
} catch (error) {
|
||||
notifications.error({
|
||||
message: 'Something went wrong',
|
||||
});
|
||||
}
|
||||
},
|
||||
[data, toggleAddWidget, notifications],
|
||||
[data, toggleAddWidget, notifications, pathname],
|
||||
);
|
||||
const isDarkMode = useIsDarkMode();
|
||||
const fillColor: CSSProperties['color'] = isDarkMode ? 'white' : 'black';
|
||||
|
@ -70,7 +70,7 @@ export const updateURL = (
|
||||
userSelectedFilter: JSON.stringify(Object.fromEntries(userSelectedFilter)),
|
||||
};
|
||||
history.replace(
|
||||
`${history.location.pathname}?${createQueryParams(queryParams)}`,
|
||||
`${window.location.pathname}?${createQueryParams(queryParams)}`,
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user