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:
Vishal Sharma 2022-07-15 12:35:15 +05:30 committed by GitHub
parent c5c7fb238f
commit c90e9ffa34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 36 deletions

View File

@ -101,9 +101,7 @@ function AllErrors(): JSX.Element {
render: (value, record): JSX.Element => (
<Tooltip overlay={(): JSX.Element => value}>
<Link
to={`${ROUTES.ERROR_DETAIL}?serviceName=${
record.serviceName
}&exceptionType=${record.exceptionType}&groupId=${
to={`${ROUTES.ERROR_DETAIL}?groupId=${
record.groupID
}&timestamp=${getNanoSeconds(record.lastSeen)}`}
>

View File

@ -90,11 +90,9 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
}
history.replace(
`${history.location.pathname}?${urlKey.serviceName}=${serviceName}&${
urlKey.exceptionType
}=${errorType}&groupId=${idPayload.groupID}&timestamp=${getNanoSeconds(
timespamp,
)}&errorId=${id}`,
`${history.location.pathname}?&groupId=${
idPayload.groupID
}&timestamp=${getNanoSeconds(timespamp)}&errorId=${id}`,
);
} catch (error) {
notification.error({

View File

@ -23,8 +23,6 @@ function ErrorDetails(): JSX.Element {
const { search } = useLocation();
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 errorId = params.get(urlKey.errorId);
const timestamp = params.get(urlKey.timestamp);
@ -50,34 +48,17 @@ function ErrorDetails(): JSX.Element {
},
);
const { data, status } = useQuery(
[
'expectionType',
expectionType,
'serviceName',
serviceName,
maxTime,
minTime,
groupId,
],
{
queryFn: () =>
getByErrorType({
groupID: groupId || '',
timestamp: timestamp || '',
}),
enabled:
!!expectionType && !!serviceName && !!groupId && IdStatus !== 'success',
},
);
const { data, status } = useQuery([maxTime, minTime, groupId], {
queryFn: () =>
getByErrorType({
groupID: groupId || '',
timestamp: timestamp || '',
}),
enabled: !!groupId && IdStatus !== 'success',
});
// if errorType and serviceName is null redirecting to the ALL_ERROR page not now
if (
serviceName === null ||
expectionType === null ||
groupId === null ||
timestamp === null
) {
if (groupId === null || timestamp === null) {
return <Redirect to={ROUTES.ALL_ERROR} />;
}