diff --git a/src/components/Main/index.tsx b/src/components/Main/index.tsx index 8a21e953e..ae6b30301 100644 --- a/src/components/Main/index.tsx +++ b/src/components/Main/index.tsx @@ -23,8 +23,8 @@ import { actions } from "./actions"; import * as s from "./styles"; import { isScopeWithCodeLensContext, - isScopeWithCustomProtocolLinkContext, - isScopeWithErrorDetailsIdContext + isScopeWithErrorDetailsIdContext, + isScopeWithRestApiCallContext } from "./typeGuards"; import { HistoryState } from "./types"; import { useBrowserLocationUpdater } from "./updateBrowserLocationUpdater"; @@ -52,10 +52,8 @@ const getURLToNavigateOnCodeLensClick = (scope: Scope): string | undefined => { } }; -const getUrlToNavigateFromCustomProtocolLink = ( - scope: Scope -): string | undefined => { - if (!isScopeWithCustomProtocolLinkContext(scope)) { +const getUrlToNavigateFromRestApiCall = (scope: Scope): string | undefined => { + if (!isScopeWithRestApiCallContext(scope)) { return; } @@ -267,8 +265,8 @@ export const Main = () => { goTo(`/${TAB_IDS.ERRORS}${errorId}`, { state }); break; } - case SCOPE_CHANGE_EVENTS.IDE_CUSTOM_PROTOCOL_LINK_CLICKED as string: { - const url = getUrlToNavigateFromCustomProtocolLink(scope); + case SCOPE_CHANGE_EVENTS.IDE_REST_API_CALL as string: { + const url = getUrlToNavigateFromRestApiCall(scope); if (url) { goTo(url, { state }); break; diff --git a/src/components/Main/typeGuards.ts b/src/components/Main/typeGuards.ts index 1f7f55ca5..475b79dd0 100644 --- a/src/components/Main/typeGuards.ts +++ b/src/components/Main/typeGuards.ts @@ -11,10 +11,10 @@ export const isScopeWithCodeLensContext = ( ): x is ScopeWithCodeLensContext => x.context?.event === SCOPE_CHANGE_EVENTS.IDE_CODE_LENS_CLICKED; -export const isScopeWithCustomProtocolLinkContext = ( +export const isScopeWithRestApiCallContext = ( x: Scope ): x is ScopeWithCustomProtocolLinkContext => - x.context?.event === SCOPE_CHANGE_EVENTS.IDE_CUSTOM_PROTOCOL_LINK_CLICKED; + x.context?.event === SCOPE_CHANGE_EVENTS.IDE_REST_API_CALL; export const isScopeWithErrorDetailsIdContext = ( x: Scope diff --git a/src/types.ts b/src/types.ts index 8c8fd36f2..2179100e1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -81,7 +81,7 @@ export enum SCOPE_CHANGE_EVENTS { RECENT_ACTIVITY_SPAN_LINK_CLICKED = "RECENT_ACTIVITY_SPAN_LINK_CLICKED", IDE_CODE_LENS_CLICKED = "IDE/CODE_LENS_CLICKED", IDE_NOTIFICATION_LINK_CLICKED = "IDE/NOTIFICATION_LINK_CLICKED", - IDE_CUSTOM_PROTOCOL_LINK_CLICKED = "IDE/CUSTOM_PROTOCOL_LINK_CLICKED", + IDE_REST_API_CALL = "IDE/REST_API_CALL", ASSETS_EMPTY_CATEGORY_PARENT_LINK_CLICKED = "ASSETS/EMPTY_CATEGORY_PARENT_LINK_CLICKED", METRICS_SERVICE_SELECTED = "METRICS/SERVICE_SELECTED", METRICS_ENDPOINT_SELECTED = "METRICS/ENDPOINT_SELECTED",