From ca1b8bcdf1dcf88ed9a5260dc12e82bff84e3dcf Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Mon, 1 Sep 2025 14:25:32 +0200 Subject: [PATCH] Add link to Agentic --- .../NavSidebar/NavMenu/NavMenuItem/index.tsx | 2 +- .../NavSidebar/NavMenu/NavMenuItem/types.ts | 5 ++-- .../Admin/NavSidebar/NavMenu/index.tsx | 26 ++++++++++++++++--- .../IncidentDetails/AgentSummary/styles.ts | 2 +- .../CreateIncidentChatOverlay/index.tsx | 2 +- .../Agentic/common/PulsatingDot/styles.ts | 2 +- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/components/Admin/NavSidebar/NavMenu/NavMenuItem/index.tsx b/src/components/Admin/NavSidebar/NavMenu/NavMenuItem/index.tsx index 39508eba6..94595b11a 100644 --- a/src/components/Admin/NavSidebar/NavMenu/NavMenuItem/index.tsx +++ b/src/components/Admin/NavSidebar/NavMenu/NavMenuItem/index.tsx @@ -23,7 +23,7 @@ export const NavMenuItem = ({ item, onClick }: NavMenuItemProps) => { e.preventDefault(); setIsExpanded(!isExpanded); } else { - onClick?.(); + onClick?.(e); } }; diff --git a/src/components/Admin/NavSidebar/NavMenu/NavMenuItem/types.ts b/src/components/Admin/NavSidebar/NavMenu/NavMenuItem/types.ts index 086afefa7..780ce6df8 100644 --- a/src/components/Admin/NavSidebar/NavMenu/NavMenuItem/types.ts +++ b/src/components/Admin/NavSidebar/NavMenu/NavMenuItem/types.ts @@ -1,4 +1,4 @@ -import type { ReactNode } from "react"; +import type { MouseEvent, ReactNode } from "react"; export interface NavigationItem { id: string; @@ -6,6 +6,7 @@ export interface NavigationItem { route: string; icon?: ReactNode; items?: NavigationItem[]; + onClick?: (e: MouseEvent) => void; } export interface ContainerProps { @@ -14,5 +15,5 @@ export interface ContainerProps { export interface NavMenuItemProps { item: NavigationItem; - onClick?: () => void; + onClick?: (e: MouseEvent) => void; } diff --git a/src/components/Admin/NavSidebar/NavMenu/index.tsx b/src/components/Admin/NavSidebar/NavMenu/index.tsx index d72005fcb..a84111c95 100644 --- a/src/components/Admin/NavSidebar/NavMenu/index.tsx +++ b/src/components/Admin/NavSidebar/NavMenu/index.tsx @@ -1,6 +1,7 @@ -import { useMemo } from "react"; +import { useMemo, type MouseEvent } from "react"; import { getFeatureFlagValue } from "../../../../featureFlags"; import { useGetAboutQuery } from "../../../../redux/services/digma"; +import { useConfigSelector } from "../../../../store/config/useConfigSelector"; import { FeatureFlag } from "../../../../types"; import { GlobeIcon } from "../../../common/icons/16px/GlobeIcon"; import { HomeIcon } from "../../../common/icons/16px/HomeIcon"; @@ -17,6 +18,8 @@ export const NavMenu = () => { FeatureFlag.AreBlockedTracesEnabled ); + const { isAgenticEnabled } = useConfigSelector(); + const navigationItems: NavigationItem[] = useMemo( () => [ { @@ -63,16 +66,33 @@ export const NavMenu = () => { ] } ] + : []), + ...(isAgenticEnabled + ? [ + { + id: "aiSre", + name: "AI SRE", + route: `${window.location.origin}/agentic`, + onClick: (e: MouseEvent) => { + e.preventDefault(); + window.open( + `${window.location.origin}/agentic`, + "_blank", + "noopener noreferrer" + ); + } + } + ] : []) ], - [isTroubleshootingEnabled] + [isTroubleshootingEnabled, isAgenticEnabled] ); return ( diff --git a/src/components/Agentic/IncidentDetails/AgentSummary/styles.ts b/src/components/Agentic/IncidentDetails/AgentSummary/styles.ts index 76d904022..f1f656fab 100644 --- a/src/components/Agentic/IncidentDetails/AgentSummary/styles.ts +++ b/src/components/Agentic/IncidentDetails/AgentSummary/styles.ts @@ -23,7 +23,7 @@ export const ToolContainer = styled.details` `; export const ToolSummary = styled.summary` - background-color: ${({ theme }) => theme.colors.v3.surface.secondary}; + background: ${({ theme }) => theme.colors.v3.surface.secondary}; padding: 12px 16px; font-weight: 600; color: ${({ theme }) => theme.colors.v3.text.primary}; diff --git a/src/components/Agentic/IncidentsContainer/CreateIncidentChatOverlay/index.tsx b/src/components/Agentic/IncidentsContainer/CreateIncidentChatOverlay/index.tsx index 49f746562..4a66222b4 100644 --- a/src/components/Agentic/IncidentsContainer/CreateIncidentChatOverlay/index.tsx +++ b/src/components/Agentic/IncidentsContainer/CreateIncidentChatOverlay/index.tsx @@ -61,7 +61,7 @@ export const CreateIncidentChatOverlay = () => { { id: "__start_message", type: "human", - agent_name: "incident_entry", + agent_name: AGENT_ID, message: text, tool_name: null, mcp_name: null diff --git a/src/components/Agentic/common/PulsatingDot/styles.ts b/src/components/Agentic/common/PulsatingDot/styles.ts index b9914e01a..e54393811 100644 --- a/src/components/Agentic/common/PulsatingDot/styles.ts +++ b/src/components/Agentic/common/PulsatingDot/styles.ts @@ -15,6 +15,6 @@ export const Container = styled.div` width: 10px; height: 10px; border-radius: 50%; - background-color: ${({ theme }) => theme.colors.v3.text.white}; + background: ${({ theme }) => theme.colors.v3.text.white}; animation: ${pulsate} 1s infinite alternate; `;