diff --git a/Common/UI/Components/Alerts/Alert.tsx b/Common/UI/Components/Alerts/Alert.tsx index ce2cfcd3780..a594a19eace 100644 --- a/Common/UI/Components/Alerts/Alert.tsx +++ b/Common/UI/Components/Alerts/Alert.tsx @@ -21,13 +21,13 @@ export interface ComponentProps { onClose?: () => void; type?: AlertType; onClick?: () => void; - doNotShowIcon?: boolean; - dataTestId?: string; - textClassName?: string; - className?: string; - color?: Color; - id?: string; - textOnRight?: string; + doNotShowIcon?: boolean | undefined; + dataTestId?: string | undefined; + textClassName?: string | undefined; + className?: string | undefined; + color?: Color | undefined; + id?: string | undefined; + textOnRight?: string | undefined; } const Alert: FunctionComponent = ( diff --git a/Dashboard/src/Pages/Telemetry/Documentation.tsx b/Dashboard/src/Pages/Telemetry/Documentation.tsx new file mode 100644 index 00000000000..ed55b03b53b --- /dev/null +++ b/Dashboard/src/Pages/Telemetry/Documentation.tsx @@ -0,0 +1,15 @@ +import TelemetryDocumentation from "../../Components/Telemetry/Documentation"; +import PageComponentProps from "../PageComponentProps"; +import React, { Fragment, FunctionComponent, ReactElement } from "react"; + +const TelemetryDocumentationPage: FunctionComponent< + PageComponentProps +> = (): ReactElement => { + return ( + + + + ); +}; + +export default TelemetryDocumentationPage; diff --git a/Dashboard/src/Pages/Telemetry/Exceptions/View/Layout.tsx b/Dashboard/src/Pages/Telemetry/Exceptions/View/Layout.tsx index 12794fa50ba..42e12cee2b3 100644 --- a/Dashboard/src/Pages/Telemetry/Exceptions/View/Layout.tsx +++ b/Dashboard/src/Pages/Telemetry/Exceptions/View/Layout.tsx @@ -1,15 +1,27 @@ import { getTelemetryBreadcrumbs } from "../../../../Utils/Breadcrumbs"; -import { RouteUtil } from "../../../../Utils/RouteMap"; +import RouteMap, { RouteUtil } from "../../../../Utils/RouteMap"; import PageComponentProps from "../../../PageComponentProps"; import Page from "Common/UI/Components/Page/Page"; import Navigation from "Common/UI/Utils/Navigation"; import React, { FunctionComponent, ReactElement } from "react"; import { Outlet } from "react-router-dom"; +import PageMap from "../../../../Utils/PageMap"; const MetricsLayout: FunctionComponent< PageComponentProps > = (): ReactElement => { const path: string = Navigation.getRoutePath(RouteUtil.getRoutes()); + + if (path.endsWith("exceptions")) { + Navigation.navigate( + RouteUtil.populateRouteParams( + RouteMap[PageMap.TELEMETRY_EXCEPTIONS_UNRESOLVED]!, + ), + ); + + return <>; + } + return ( = (): ReactElement => { const path: string = Navigation.getRoutePath(RouteUtil.getRoutes()); + if (path.endsWith("telemetry") || path.endsWith("telemetry/*")) { + Navigation.navigate( + RouteUtil.populateRouteParams(RouteMap[PageMap.TELEMETRY_SERVICES]!), + ); + + return <>; + } + return ( { }} icon={IconProp.SquareStack} /> + +> = lazy(() => { + return import("../Pages/Telemetry/Documentation"); +}); + const TelemetryLogs: LazyExoticComponent> = lazy(() => { return import("../Pages/Telemetry/Logs"); @@ -290,6 +296,18 @@ const TelemetryRoutes: FunctionComponent = ( } /> + + + + + } + /> {/* Metric View */} @@ -333,9 +351,9 @@ const TelemetryRoutes: FunctionComponent = ( index element={ - } diff --git a/Dashboard/src/Utils/Breadcrumbs/TelemetryBreadcrumbs.ts b/Dashboard/src/Utils/Breadcrumbs/TelemetryBreadcrumbs.ts index 4440c009da4..e2d5bd5509c 100644 --- a/Dashboard/src/Utils/Breadcrumbs/TelemetryBreadcrumbs.ts +++ b/Dashboard/src/Utils/Breadcrumbs/TelemetryBreadcrumbs.ts @@ -10,6 +10,11 @@ export function getTelemetryBreadcrumbs(path: string): Array | undefined { "Telemetry", "Services", ]), + ...BuildBreadcrumbLinksByTitles(PageMap.TELEMETRY_DOCUMENTATION, [ + "Project", + "Telemetry", + "Documentation", + ]), ...BuildBreadcrumbLinksByTitles(PageMap.TELEMETRY_LOGS, [ "Project", "Telemetry", @@ -21,12 +26,6 @@ export function getTelemetryBreadcrumbs(path: string): Array | undefined { "Metrics", ]), - ...BuildBreadcrumbLinksByTitles(PageMap.TELEMETRY_EXCEPTIONS, [ - "Project", - "Telemetry", - "Exceptions", - ]), - ...BuildBreadcrumbLinksByTitles(PageMap.TELEMETRY_EXCEPTIONS_ARCHIVED, [ "Project", "Telemetry", diff --git a/Dashboard/src/Utils/PageMap.ts b/Dashboard/src/Utils/PageMap.ts index 8ac53e41d8a..0cb7c8b6dfb 100644 --- a/Dashboard/src/Utils/PageMap.ts +++ b/Dashboard/src/Utils/PageMap.ts @@ -19,6 +19,7 @@ enum PageMap { TELEMETRY_SERVICES_VIEW_ROOT = "TELEMETRY_SERVICES_VIEW_ROOT", TELEMETRY = "TELEMETRY", TELEMETRY_SERVICES = "TELEMETRY_SERVICES", + TELEMETRY_DOCUMENTATION = "TELEMETRY_DOCUMENTATION", TELEMETRY_DASHBOARDS = "TELEMETRY_DASHBOARDS", TELEMETRY_DASHBOARD_VIEW = "TELEMETRY_DASHBOARD_VIEW", diff --git a/Dashboard/src/Utils/RouteMap.ts b/Dashboard/src/Utils/RouteMap.ts index 49a0f5386ec..d690007fbbd 100644 --- a/Dashboard/src/Utils/RouteMap.ts +++ b/Dashboard/src/Utils/RouteMap.ts @@ -58,6 +58,7 @@ export const WorkflowRoutePath: Dictionary = { export const TelemetryRoutePath: Dictionary = { [PageMap.TELEMETRY_SERVICES]: "services", + [PageMap.TELEMETRY_DOCUMENTATION]: "documentation", [PageMap.TELEMETRY_LOGS]: "logs", [PageMap.TELEMETRY_TRACES]: "traces", [PageMap.TELEMETRY_METRICS]: "metrics", @@ -74,8 +75,8 @@ export const TelemetryRoutePath: Dictionary = { [PageMap.TELEMETRY_TRACE_ROOT]: `traces/view`, [PageMap.TELEMETRY_TRACE_VIEW]: `traces/view/${RouteParams.ModelID}`, // modelID is spanId - [PageMap.TELEMETRY_EXCEPTIONS_ROOT]: `exception`, - [PageMap.TELEMETRY_EXCEPTIONS_VIEW]: `exception/${RouteParams.ModelID}`, + [PageMap.TELEMETRY_EXCEPTIONS_ROOT]: `exceptions`, + [PageMap.TELEMETRY_EXCEPTIONS_VIEW]: `exceptions/${RouteParams.ModelID}`, [PageMap.TELEMETRY_LOG_ROOT]: `logs`, @@ -857,6 +858,12 @@ const RouteMap: Dictionary = { }`, ), + [PageMap.TELEMETRY_DOCUMENTATION]: new Route( + `/dashboard/${RouteParams.ProjectID}/telemetry/${ + TelemetryRoutePath[PageMap.TELEMETRY_DOCUMENTATION] + }`, + ), + [PageMap.TELEMETRY_LOGS]: new Route( `/dashboard/${RouteParams.ProjectID}/telemetry/${ TelemetryRoutePath[PageMap.TELEMETRY_LOGS]