mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 16:58:59 +08:00
fix: remove requirement of exceptionType and serviceName from errorDetail page URL (#1400)
* fix: remove requirement of exceptionType and serviceName from errorDetail page URL * chore: id is updated * chore: commented code is removed * chore: eslint error is fixed Co-authored-by: Palash <palashgdev@gmail.com>
This commit is contained in:
parent
c5c7fb238f
commit
c90e9ffa34
@ -101,9 +101,7 @@ function AllErrors(): JSX.Element {
|
|||||||
render: (value, record): JSX.Element => (
|
render: (value, record): JSX.Element => (
|
||||||
<Tooltip overlay={(): JSX.Element => value}>
|
<Tooltip overlay={(): JSX.Element => value}>
|
||||||
<Link
|
<Link
|
||||||
to={`${ROUTES.ERROR_DETAIL}?serviceName=${
|
to={`${ROUTES.ERROR_DETAIL}?groupId=${
|
||||||
record.serviceName
|
|
||||||
}&exceptionType=${record.exceptionType}&groupId=${
|
|
||||||
record.groupID
|
record.groupID
|
||||||
}×tamp=${getNanoSeconds(record.lastSeen)}`}
|
}×tamp=${getNanoSeconds(record.lastSeen)}`}
|
||||||
>
|
>
|
||||||
|
@ -90,11 +90,9 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
history.replace(
|
history.replace(
|
||||||
`${history.location.pathname}?${urlKey.serviceName}=${serviceName}&${
|
`${history.location.pathname}?&groupId=${
|
||||||
urlKey.exceptionType
|
idPayload.groupID
|
||||||
}=${errorType}&groupId=${idPayload.groupID}×tamp=${getNanoSeconds(
|
}×tamp=${getNanoSeconds(timespamp)}&errorId=${id}`,
|
||||||
timespamp,
|
|
||||||
)}&errorId=${id}`,
|
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notification.error({
|
notification.error({
|
||||||
|
@ -23,8 +23,6 @@ function ErrorDetails(): JSX.Element {
|
|||||||
const { search } = useLocation();
|
const { search } = useLocation();
|
||||||
const params = useMemo(() => new URLSearchParams(search), [search]);
|
const params = useMemo(() => new URLSearchParams(search), [search]);
|
||||||
|
|
||||||
const serviceName = params.get(urlKey.serviceName);
|
|
||||||
const expectionType = params.get(urlKey.exceptionType);
|
|
||||||
const groupId = params.get(urlKey.groupId);
|
const groupId = params.get(urlKey.groupId);
|
||||||
const errorId = params.get(urlKey.errorId);
|
const errorId = params.get(urlKey.errorId);
|
||||||
const timestamp = params.get(urlKey.timestamp);
|
const timestamp = params.get(urlKey.timestamp);
|
||||||
@ -50,34 +48,17 @@ function ErrorDetails(): JSX.Element {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const { data, status } = useQuery(
|
const { data, status } = useQuery([maxTime, minTime, groupId], {
|
||||||
[
|
queryFn: () =>
|
||||||
'expectionType',
|
getByErrorType({
|
||||||
expectionType,
|
groupID: groupId || '',
|
||||||
'serviceName',
|
timestamp: timestamp || '',
|
||||||
serviceName,
|
}),
|
||||||
maxTime,
|
enabled: !!groupId && IdStatus !== 'success',
|
||||||
minTime,
|
});
|
||||||
groupId,
|
|
||||||
],
|
|
||||||
{
|
|
||||||
queryFn: () =>
|
|
||||||
getByErrorType({
|
|
||||||
groupID: groupId || '',
|
|
||||||
timestamp: timestamp || '',
|
|
||||||
}),
|
|
||||||
enabled:
|
|
||||||
!!expectionType && !!serviceName && !!groupId && IdStatus !== 'success',
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// if errorType and serviceName is null redirecting to the ALL_ERROR page not now
|
// if errorType and serviceName is null redirecting to the ALL_ERROR page not now
|
||||||
if (
|
if (groupId === null || timestamp === null) {
|
||||||
serviceName === null ||
|
|
||||||
expectionType === null ||
|
|
||||||
groupId === null ||
|
|
||||||
timestamp === null
|
|
||||||
) {
|
|
||||||
return <Redirect to={ROUTES.ALL_ERROR} />;
|
return <Redirect to={ROUTES.ALL_ERROR} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user