diff --git a/frontend/src/container/AppLayout/index.tsx b/frontend/src/container/AppLayout/index.tsx index 4cf2e0f5bb..893f487471 100644 --- a/frontend/src/container/AppLayout/index.tsx +++ b/frontend/src/container/AppLayout/index.tsx @@ -255,19 +255,16 @@ function AppLayout(props: AppLayoutProps): JSX.Element { const isDashboardListView = (): boolean => routeKey === 'ALL_DASHBOARD'; const isAlertHistory = (): boolean => routeKey === 'ALERT_HISTORY'; const isAlertOverview = (): boolean => routeKey === 'ALERT_OVERVIEW'; - const isDashboardView = (): boolean => { - /** - * need to match using regex here as the getRoute function will not work for - * routes with id - */ - const regex = /^\/dashboard\/[a-zA-Z0-9_-]+$/; - return regex.test(pathname); - }; + const isPathMatch = (regex: RegExp): boolean => regex.test(pathname); - const isDashboardWidgetView = (): boolean => { - const regex = /^\/dashboard\/[a-zA-Z0-9_-]+\/new$/; - return regex.test(pathname); - }; + const isDashboardView = (): boolean => + isPathMatch(/^\/dashboard\/[a-zA-Z0-9_-]+$/); + + const isDashboardWidgetView = (): boolean => + isPathMatch(/^\/dashboard\/[a-zA-Z0-9_-]+\/new$/); + + const isTraceDetailsView = (): boolean => + isPathMatch(/^\/trace\/[a-zA-Z0-9]+(\?.*)?$/); useEffect(() => { if (isDarkMode) { @@ -356,6 +353,8 @@ function AppLayout(props: AppLayoutProps): JSX.Element { isMessagingQueues() ? 0 : '0 1rem', + + ...(isTraceDetailsView() ? { marginRight: 0 } : {}), }} > {isToDisplayLayout && !renderFullScreen && } diff --git a/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx b/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx index 39e180ee12..d8eb1a6972 100644 --- a/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx +++ b/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx @@ -1,4 +1,4 @@ -import { Button, Modal, Tabs, Tooltip, Typography } from 'antd'; +import { Button, Modal, Row, Tabs, Tooltip, Typography } from 'antd'; import Editor from 'components/Editor'; import { StyledSpace } from 'components/Styled'; import { QueryParams } from 'constants/query'; @@ -6,7 +6,8 @@ import ROUTES from 'constants/routes'; import { useIsDarkMode } from 'hooks/useDarkMode'; import createQueryParams from 'lib/createQueryParams'; import history from 'lib/history'; -import { useState } from 'react'; +import { PanelRight } from 'lucide-react'; +import { Dispatch, SetStateAction, useState } from 'react'; import { useSelector } from 'react-redux'; import { useParams } from 'react-router-dom'; import { AppState } from 'store/reducers'; @@ -28,6 +29,7 @@ function SelectedSpanDetails(props: SelectedSpanDetailsProps): JSX.Element { firstSpanStartTime, traceStartTime = minTime, traceEndTime = maxTime, + setCollapsed, } = props; const { id: traceId } = useParams(); @@ -96,14 +98,14 @@ function SelectedSpanDetails(props: SelectedSpanDetailsProps): JSX.Element { styledclass={[styles.selectedSpanDetailsContainer, styles.overflow]} direction="vertical" > - - Details for selected Span - + + Details for selected Span +