From c90e9ffa3401142e8311bf5036443f59f6ba809e Mon Sep 17 00:00:00 2001 From: Vishal Sharma Date: Fri, 15 Jul 2022 12:35:15 +0530 Subject: [PATCH] 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 --- frontend/src/container/AllError/index.tsx | 4 +- frontend/src/container/ErrorDetails/index.tsx | 8 ++-- frontend/src/pages/ErrorDetails/index.tsx | 37 +++++-------------- 3 files changed, 13 insertions(+), 36 deletions(-) diff --git a/frontend/src/container/AllError/index.tsx b/frontend/src/container/AllError/index.tsx index eef4fca88b..253af7dfe1 100644 --- a/frontend/src/container/AllError/index.tsx +++ b/frontend/src/container/AllError/index.tsx @@ -101,9 +101,7 @@ function AllErrors(): JSX.Element { render: (value, record): JSX.Element => ( value}> diff --git a/frontend/src/container/ErrorDetails/index.tsx b/frontend/src/container/ErrorDetails/index.tsx index ea8a3c2e3e..a200744890 100644 --- a/frontend/src/container/ErrorDetails/index.tsx +++ b/frontend/src/container/ErrorDetails/index.tsx @@ -90,11 +90,9 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element { } history.replace( - `${history.location.pathname}?${urlKey.serviceName}=${serviceName}&${ - urlKey.exceptionType - }=${errorType}&groupId=${idPayload.groupID}×tamp=${getNanoSeconds( - timespamp, - )}&errorId=${id}`, + `${history.location.pathname}?&groupId=${ + idPayload.groupID + }×tamp=${getNanoSeconds(timespamp)}&errorId=${id}`, ); } catch (error) { notification.error({ diff --git a/frontend/src/pages/ErrorDetails/index.tsx b/frontend/src/pages/ErrorDetails/index.tsx index 25bffe874d..348391b741 100644 --- a/frontend/src/pages/ErrorDetails/index.tsx +++ b/frontend/src/pages/ErrorDetails/index.tsx @@ -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 ; }