From ee2a734c5558e1f3f989beb306a5f0a683c09285 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Fri, 30 May 2025 08:15:25 +0200 Subject: [PATCH] Support navigation to error details screen --- src/components/Main/index.tsx | 8 ++++++-- src/components/common/App/types.ts | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Main/index.tsx b/src/components/Main/index.tsx index cad8ce3e0..ec99d4a01 100644 --- a/src/components/Main/index.tsx +++ b/src/components/Main/index.tsx @@ -11,6 +11,7 @@ import { PLUGIN_EVENTS } from "../../pluginEvents"; import { useConfigSelector } from "../../store/config/useConfigSelector"; import { useStore } from "../../store/useStore"; import { trackingEvents as globalTrackingEvents } from "../../trackingEvents"; +import { isString } from "../../typeGuards/isString"; import { isUndefined } from "../../typeGuards/isUndefined"; import type { SendPluginEventPayload } from "../../types"; import { ScopeChangeEvent } from "../../types"; @@ -69,10 +70,13 @@ const getUrlToNavigateFromRestApiCall = (scope: Scope): string | undefined => { } if (!Object.values(TAB_IDS).includes(scope.context.payload.targetTab)) { - return `/${scope.context.payload.targetTab}`; + return; } - return `/${scope.context.payload.targetTab}`; + const tab = scope.context.payload.targetTab; + const path = scope.context.payload.targetTabPath; + + return `/${[tab, path].filter(isString).join("/")}`; }; export const Main = () => { diff --git a/src/components/common/App/types.ts b/src/components/common/App/types.ts index 764fcb66a..89354eb85 100644 --- a/src/components/common/App/types.ts +++ b/src/components/common/App/types.ts @@ -97,6 +97,7 @@ export interface ScopeWithCustomProtocolLinkContext event: ScopeChangeEvent; payload: { targetTab?: string; + targetTabPath?: string; }; }; }