diff --git a/src/components/Assets/AssetList/AssetEntry/index.tsx b/src/components/Assets/AssetList/AssetEntry/index.tsx index 45627ee45..7ff42d5b4 100644 --- a/src/components/Assets/AssetList/AssetEntry/index.tsx +++ b/src/components/Assets/AssetList/AssetEntry/index.tsx @@ -85,6 +85,7 @@ export const AssetEntry = (props: AssetEntryProps) => { handleLinkClick()}>{name} + {isNew && } {sortedInsights.map((insight) => { diff --git a/src/components/Assets/AssetList/AssetEntry/styles.ts b/src/components/Assets/AssetList/AssetEntry/styles.ts index 3e22cb9df..c20de31d3 100644 --- a/src/components/Assets/AssetList/AssetEntry/styles.ts +++ b/src/components/Assets/AssetList/AssetEntry/styles.ts @@ -1,6 +1,7 @@ import styled from "styled-components"; import { caption2RegularTypography } from "../../../common/App/typographies"; import { grayScale } from "../../../common/App/v2colors"; +import { CopyButton } from "../../../common/v3/CopyButton"; import { ImpactScoreIndicatorProps } from "./types"; export const Container = styled.div` @@ -35,11 +36,22 @@ export const Header = styled.div` gap: 4px; `; +export const StyledCopyButton = styled(CopyButton)` + padding: 0; + display: none; +`; + export const TitleRow = styled.div` display: flex; gap: 2px; height: 20px; align-items: center; + + &:hover { + ${StyledCopyButton} { + display: flex; + } + } `; export const AssetTypeIconContainer = styled.div` diff --git a/src/components/Assets/AssetList/AssetList.stories.tsx b/src/components/Assets/AssetList/AssetList.stories.tsx index 395e550be..83ee48327 100644 --- a/src/components/Assets/AssetList/AssetList.stories.tsx +++ b/src/components/Assets/AssetList/AssetList.stories.tsx @@ -21,7 +21,7 @@ export const Default: Story = { args: { searchQuery: "", setRefresher: () => { - // empty + return undefined; }, assetTypeId: "Endpoint", data: { diff --git a/src/components/Assets/AssetList/index.tsx b/src/components/Assets/AssetList/index.tsx index 4ddac259f..5719ca027 100644 --- a/src/components/Assets/AssetList/index.tsx +++ b/src/components/Assets/AssetList/index.tsx @@ -354,8 +354,8 @@ export const AssetList = (props: AssetListProps) => { props.scopeViewOptions ]); - const handleBackButtonClick = () => { - props.onBackButtonClick(); + const handleAllAssetsLinkClick = () => { + props.onGoToAllAssets(); }; const handleSortingMenuToggle = () => { @@ -459,7 +459,7 @@ export const AssetList = (props: AssetListProps) => { )} {assetTypeInfo?.label || props.assetTypeId} - All Assets + All Assets diff --git a/src/components/Assets/AssetList/types.ts b/src/components/Assets/AssetList/types.ts index 708d78d0d..9f812dcb8 100644 --- a/src/components/Assets/AssetList/types.ts +++ b/src/components/Assets/AssetList/types.ts @@ -4,7 +4,7 @@ import { AssetScopeOption } from "../AssetsViewScopeConfiguration/types"; export interface AssetListProps { data?: AssetsData; - onBackButtonClick: () => void; + onGoToAllAssets: () => void; assetTypeId: string; filters?: AssetFilterQuery; searchQuery: string; diff --git a/src/components/Assets/AssetTypeList/AssetTypeList.stories.tsx b/src/components/Assets/AssetTypeList/AssetTypeList.stories.tsx index a3d68c14a..3c8ef9b5c 100644 --- a/src/components/Assets/AssetTypeList/AssetTypeList.stories.tsx +++ b/src/components/Assets/AssetTypeList/AssetTypeList.stories.tsx @@ -19,6 +19,9 @@ type Story = StoryObj; // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args export const Default: Story = { args: { + setRefresher: () => { + return undefined; + }, searchQuery: "", data: { assetCategories: [ @@ -54,6 +57,9 @@ export const Default: Story = { export const Empty: Story = { args: { searchQuery: "", + setRefresher: () => { + return undefined; + }, data: { assetCategories: [] } diff --git a/src/components/Assets/index.tsx b/src/components/Assets/index.tsx index a1bd12580..fd519a440 100644 --- a/src/components/Assets/index.tsx +++ b/src/components/Assets/index.tsx @@ -1,4 +1,5 @@ import { useCallback, useContext, useEffect, useState } from "react"; +import { actions as globalActions } from "../../actions"; import { useDebounce } from "../../hooks/useDebounce"; import { usePrevious } from "../../hooks/usePrevious"; import { ChangeViewPayload } from "../../types"; @@ -8,7 +9,6 @@ import { EmptyState } from "../common/EmptyState"; import { SearchInput } from "../common/SearchInput"; import { RefreshIcon } from "../common/icons/16px/RefreshIcon"; import { Tooltip } from "../common/v3/Tooltip"; -import { actions as globalActions } from "./../../actions"; import { AssetList } from "./AssetList"; import { AssetTypeList } from "./AssetTypeList"; import { AssetsFilter } from "./AssetsFilter"; @@ -61,7 +61,7 @@ export const Assets = ({ selectedTypeId }: AssetsProps) => { } }, [config.scope, previousScope, selectedTypeId]); - const handleAllAssetsClick = () => { + const handleGoToAllAssets = () => { setSelectedAssetTypeId(null); changeView("/assets"); }; @@ -153,7 +153,7 @@ export const Assets = ({ selectedTypeId }: AssetsProps) => { return ( + + {durationString && {durationString}} ); diff --git a/src/components/Dashboard/widgets/SlowQueries/styles.ts b/src/components/Dashboard/widgets/SlowQueries/styles.ts index 16c3cea2e..619f83260 100644 --- a/src/components/Dashboard/widgets/SlowQueries/styles.ts +++ b/src/components/Dashboard/widgets/SlowQueries/styles.ts @@ -1,10 +1,21 @@ import styled from "styled-components"; import { Link } from "../../../common/Link"; +import { CopyButton } from "../../../common/v3/CopyButton"; + +export const StyledCopyButton = styled(CopyButton)` + display: none; + padding: 0; +`; export const Entry = styled.div` display: flex; - justify-content: space-between; gap: 4px; + + &:hover { + ${StyledCopyButton} { + display: flex; + } + } `; export const SpanLink = styled(Link)` @@ -14,6 +25,7 @@ export const SpanLink = styled(Link)` `; export const Duration = styled.span` + margin-left: auto; flex-shrink: 0; font-size: 14px; font-weight: 500; diff --git a/src/components/Highlights/Highlights.stories.tsx b/src/components/Highlights/Highlights.stories.tsx index 9055c58af..4b2191bcd 100644 --- a/src/components/Highlights/Highlights.stories.tsx +++ b/src/components/Highlights/Highlights.stories.tsx @@ -22,38 +22,34 @@ type Story = StoryObj; // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args export const Default: Story = { play: () => { - setTimeout(() => { - window.setTimeout(() => { - window.postMessage({ - type: "digma", - action: mainActions.SET_HIGHLIGHTS_TOP_ISSUES_DATA, - payload: mockedTopIssuesData - }); - window.postMessage({ - type: "digma", - action: mainActions.SET_HIGHLIGHTS_PERFORMANCE_DATA, - payload: mockedPerformanceData - }); - }, 1000); - }); + window.setTimeout(() => { + window.postMessage({ + type: "digma", + action: mainActions.SET_HIGHLIGHTS_TOP_ISSUES_DATA, + payload: mockedTopIssuesData + }); + window.postMessage({ + type: "digma", + action: mainActions.SET_HIGHLIGHTS_PERFORMANCE_DATA, + payload: mockedPerformanceData + }); + }, 1000); } }; export const Empty: Story = { play: () => { - setTimeout(() => { - window.setTimeout(() => { - window.postMessage({ - type: "digma", - action: mainActions.SET_HIGHLIGHTS_TOP_ISSUES_DATA, - payload: { topInsights: [] } - }); - window.postMessage({ - type: "digma", - action: mainActions.SET_HIGHLIGHTS_PERFORMANCE_DATA, - payload: { performance: [] } - }); - }, 1000); - }); + window.setTimeout(() => { + window.postMessage({ + type: "digma", + action: mainActions.SET_HIGHLIGHTS_TOP_ISSUES_DATA, + payload: { topInsights: [] } + }); + window.postMessage({ + type: "digma", + action: mainActions.SET_HIGHLIGHTS_PERFORMANCE_DATA, + payload: { performance: [] } + }); + }, 1000); } }; diff --git a/src/components/Highlights/TopIssues/common/AssetLink/index.tsx b/src/components/Highlights/TopIssues/common/AssetLink/index.tsx index b5f15f770..6468cbb90 100644 --- a/src/components/Highlights/TopIssues/common/AssetLink/index.tsx +++ b/src/components/Highlights/TopIssues/common/AssetLink/index.tsx @@ -1,6 +1,7 @@ import { actions as globalActions } from "../../../../../actions"; import { ChangeScopePayload } from "../../../../../types"; import { sendUserActionTrackingEvent } from "../../../../../utils/actions/sendUserActionTrackingEvent"; +import { Link } from "../../../../common/v3/Link"; import { Tooltip } from "../../../../common/v3/Tooltip"; import { trackingEvents } from "../../../tracking"; import * as s from "./styles"; @@ -26,7 +27,10 @@ export const AssetLink = ({ asset }: AssetLinkProps) => { return ( - {assetName} + + {assetName} + + ); }; diff --git a/src/components/Highlights/TopIssues/common/AssetLink/styles.ts b/src/components/Highlights/TopIssues/common/AssetLink/styles.ts index b634933bc..12678fc16 100644 --- a/src/components/Highlights/TopIssues/common/AssetLink/styles.ts +++ b/src/components/Highlights/TopIssues/common/AssetLink/styles.ts @@ -1,7 +1,22 @@ import styled from "styled-components"; -import { Link as CommonLink } from "../../../../common/v3/Link"; +import { CopyButton } from "../../../../common/v3/CopyButton"; -export const Link = styled(CommonLink)` +export const StyledCopyButton = styled(CopyButton)` + display: none; + padding: 0; +`; + +export const Container = styled.div` + display: flex; + gap: 4px; padding: 6px 0; + width: fit-content; max-width: 100%; + align-items: center; + + &:hover { + ${StyledCopyButton} { + display: flex; + } + } `; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/index.tsx index 6244ee0ec..c4a2a044e 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/index.tsx @@ -2,8 +2,7 @@ import { getDurationString } from "../../../../../../utils/getDurationString"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; import { KeyValue } from "../common/InsightCard/KeyValue"; -import { ContentContainer, Description, Details } from "../styles"; -import * as s from "./styles"; +import { AssetLink, ContentContainer, Description, Details } from "../styles"; import { EndpointBottleneckInsightCardProps } from "./types"; export const EndpointBottleneckInsightCard = ({ @@ -54,7 +53,7 @@ export const EndpointBottleneckInsightCard = ({
Asset - handleSpanLinkClick(spanCodeObjectId)} /> diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/styles.ts b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/styles.ts deleted file mode 100644 index 03fd84d20..000000000 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/styles.ts +++ /dev/null @@ -1,8 +0,0 @@ -import styled from "styled-components"; -import { ListItem } from "../common/InsightCard/ListItem"; - -export const SpanListItem = styled(ListItem)` - height: 28px; - padding: 4px 0; - background: none; -`; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/index.tsx index ab8a29b39..89aff4689 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/index.tsx @@ -1,6 +1,6 @@ import { InsightType, Trace } from "../../../../types"; import { InsightCard } from "../common/InsightCard"; -import { Description } from "../styles"; +import { AssetLink, Description } from "../styles"; import * as s from "./styles"; import { EndpointChattyApiV2InsightCardProps } from "./types"; @@ -37,7 +37,7 @@ export const EndpointChattyApiV2InsightCard = ({ Excessive API calls to specific endpoint found - handleSpanLinkClick(spanCodeObjectId)} /> diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/styles.ts b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/styles.ts index 491e70dda..1a47b2866 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/styles.ts +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/styles.ts @@ -1,13 +1,6 @@ import styled from "styled-components"; -import { ListItem } from "../common/InsightCard/ListItem"; import { ContentContainer } from "../styles"; export const Container = styled(ContentContainer)` gap: 4px; `; - -export const SpanListItem = styled(ListItem)` - height: 28px; - padding: 4px 0; - background: none; -`; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/index.tsx index 55d571a0f..7dcd7d631 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/index.tsx @@ -3,8 +3,7 @@ import { InsightType, Trace } from "../../../../types"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; import { KeyValue } from "../common/InsightCard/KeyValue"; -import { ContentContainer, Details } from "../styles"; -import * as s from "./styles"; +import { AssetLink, ContentContainer, Details } from "../styles"; import { EndpointQueryOptimizationV2InsightCardProps } from "./types"; export const EndpointQueryOptimizationV2InsightCard = ({ @@ -46,7 +45,7 @@ export const EndpointQueryOptimizationV2InsightCard = ({ content={
- handleSpanLinkClick(spanCodeObjectId)} /> diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/styles.ts b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/styles.ts deleted file mode 100644 index 03fd84d20..000000000 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/styles.ts +++ /dev/null @@ -1,8 +0,0 @@ -import styled from "styled-components"; -import { ListItem } from "../common/InsightCard/ListItem"; - -export const SpanListItem = styled(ListItem)` - height: 28px; - padding: 4px 0; - background: none; -`; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSessionInViewInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSessionInViewInsightCard/index.tsx index f67436a1d..82681174b 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSessionInViewInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSessionInViewInsightCard/index.tsx @@ -82,7 +82,7 @@ export const EndpointSessionInViewInsightCard = ({ key={spanCodeObjectId} onClick={() => handleLinkClick(spanCodeObjectId)} name={spanName} - buttons={buttons} + endContent={buttons} /> ); })} diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSlowdownSourceInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSlowdownSourceInsightCard/index.tsx index 665f00120..d980ab7cf 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSlowdownSourceInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSlowdownSourceInsightCard/index.tsx @@ -37,14 +37,14 @@ export const EndpointSlowdownSourceInsightCard = ({ key={spanCodeObjectId} onClick={() => handleSpanLinkClick(spanCodeObjectId)} name={spanName} - buttons={[ + endContent={ - ]} + } /> ); })} diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/index.tsx index c42b29a9e..efa1ff997 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/index.tsx @@ -3,8 +3,7 @@ import { InsightType, Trace } from "../../../../types"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; import { KeyValue } from "../common/InsightCard/KeyValue"; -import { ContentContainer, Description, Details } from "../styles"; -import * as s from "./styles"; +import { AssetLink, ContentContainer, Description, Details } from "../styles"; import { EndpointSpanNPlusOneInsightCardProps } from "./types"; export const EndpointSpanNPlusOneInsightCard = ({ @@ -64,9 +63,8 @@ export const EndpointSpanNPlusOneInsightCard = ({
Asset - handleSpanLinkClick(spanInfo.spanCodeObjectId)} />
diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/styles.ts b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/styles.ts index ca5a34021..7ba3943ef 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/styles.ts +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/styles.ts @@ -1,14 +1,7 @@ import styled from "styled-components"; -import { ListItem } from "../common/InsightCard/ListItem"; export const InfoContainer = styled.div` display: flex; gap: 4px; align-items: center; `; - -export const SpanListItem = styled(ListItem)` - height: 28px; - padding: 4px 0; - background: none; -`; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpaNPlusOneInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpaNPlusOneInsightCard/index.tsx index e146e4fdc..1dfb4174c 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpaNPlusOneInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpaNPlusOneInsightCard/index.tsx @@ -4,11 +4,11 @@ import { trimEndpointScheme } from "../../../../../../utils/trimEndpointScheme"; import { ConfigContext } from "../../../../../common/App/ConfigContext"; import { TraceIcon } from "../../../../../common/icons/12px/TraceIcon"; import { Button } from "../../../../../common/v3/Button"; -import { Link } from "../../../../../common/v3/Link"; import { Tooltip } from "../../../../../common/v3/Tooltip"; import { InsightType, NPlusOneEndpointInfo, Trace } from "../../../../types"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; +import { EndpointSelectedOption } from "../common/InsightCard/EndpointSelectedOption"; import { KeyValue } from "../common/InsightCard/KeyValue"; import { Select } from "../common/InsightCard/Select"; import { ContentContainer, Description, Details } from "../styles"; @@ -25,14 +25,12 @@ const renderOptions = ( return { label: route, customContent: ( - - {x.endpointInfo.serviceName} - - handleLinkClick(spanCodeObjectId)}> - {route} - - - + ), value: spanCodeObjectId }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationBreakdownInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationBreakdownInsightCard/index.tsx index 61a48d833..86c2c6df9 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationBreakdownInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationBreakdownInsightCard/index.tsx @@ -112,14 +112,14 @@ export const SpanDurationBreakdownInsightCard = ({ key={spanCodeObjectId} name={name} onClick={() => handleSpanLinkClick(spanCodeObjectId)} - buttons={[ + endContent={ - ]} + } /> ) : null; })} diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/index.tsx index c84d31ab7..2948f7c7b 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/index.tsx @@ -5,11 +5,11 @@ import { trimEndpointScheme } from "../../../../../../utils/trimEndpointScheme"; import { ConfigContext } from "../../../../../common/App/ConfigContext"; import { TraceIcon } from "../../../../../common/icons/12px/TraceIcon"; import { Button } from "../../../../../common/v3/Button"; -import { Link } from "../../../../../common/v3/Link"; import { Tooltip } from "../../../../../common/v3/Tooltip"; import { BottleneckEndpointInfo, InsightType, Trace } from "../../../../types"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; +import { EndpointSelectedOption } from "../common/InsightCard/EndpointSelectedOption"; import { KeyValue } from "../common/InsightCard/KeyValue"; import { Select } from "../common/InsightCard/Select"; import { ContentContainer, Description, Details } from "../styles"; @@ -26,14 +26,12 @@ const renderOptions = ( return { label: route, customContent: ( - - {x.endpointInfo.serviceName} - - handleLinkClick(spanCodeObjectId)}> - {route} - - - + ), value: spanCodeObjectId }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/styles.ts b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/styles.ts index 13722a693..681cf45ae 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/styles.ts +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/styles.ts @@ -1,13 +1,4 @@ import styled from "styled-components"; -import { footnoteRegularTypography } from "../../../../../common/App/typographies"; - -export const SelectedItem = styled.div` - ${footnoteRegularTypography} - - display: flex; - gap: 4px; - align-items: center; -`; export const SelectContainer = styled.div` display: flex; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanQueryOptimizationInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanQueryOptimizationInsightCard/index.tsx index dc455e97e..6a06c7955 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanQueryOptimizationInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanQueryOptimizationInsightCard/index.tsx @@ -7,7 +7,7 @@ import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; import { KeyValue } from "../common/InsightCard/KeyValue"; import { ListItem } from "../common/InsightCard/ListItem"; -import { ContentContainer, Description, Details } from "../styles"; +import { AssetLink, ContentContainer, Description, Details } from "../styles"; import * as s from "./styles"; import { SpanQueryOptimizationInsightCardProps } from "./types"; @@ -31,7 +31,7 @@ export const SpanQueryOptimizationInsightCard = ({ insight.id ); - const handleSpanLinkClick = (spanCodeObjectId?: string) => { + const handleAssetLinkClick = (spanCodeObjectId?: string) => { spanCodeObjectId && onAssetLinkClick(spanCodeObjectId, insight.type); }; @@ -65,9 +65,9 @@ export const SpanQueryOptimizationInsightCard = ({ Query is slow compared to other{" "} {insight.dbStatement.toUpperCase()} requests - handleSpanLinkClick(spanCodeObjectId)} + onClick={() => handleAssetLinkClick(spanCodeObjectId)} />
)} @@ -91,7 +91,7 @@ export const SpanQueryOptimizationInsightCard = ({ handleSpanLinkClick(spanCodeObjectId)} + onClick={() => handleAssetLinkClick(spanCodeObjectId)} /> ); })} diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/index.tsx index e13d84cae..cf07ca07a 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/index.tsx @@ -96,11 +96,11 @@ export const SpanScalingInsightCard = ({ ); } return ( - handleLinkClick(spanCodeObjectId)} - buttons={buttons} + endContent={buttons} /> ); })} @@ -133,7 +133,7 @@ export const SpanScalingInsightCard = ({ {pageItems.map((endpoint) => { const endpointRoute = trimEndpointScheme(endpoint.route); return ( - handleLinkClick(endpoint.spanCodeObjectId)} name={endpointRoute} diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/styles.ts b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/styles.ts index b6a182d11..b66ee4234 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/styles.ts +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/styles.ts @@ -18,10 +18,6 @@ export const RootCause = styled.div` gap: 4px; `; -export const RootCauseListItem = styled(ListItem)` - height: 32px; -`; - -export const EndpointListItem = styled(ListItem)` +export const StyledListItem = styled(ListItem)` height: 32px; `; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/index.tsx index 65e3ce0ff..ebcd13457 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/index.tsx @@ -104,38 +104,42 @@ export const SpanUsagesInsightCard = ({ }, cell: (info) => { const flow = info.getValue(); + const firstServiceSpanName = `${flow.firstService.service} ${flow.firstService.span}`; + const lastServiceSpanName = flow.lastService + ? `${flow.lastService.service} ${flow.lastService.span}` + : ""; return ( - - - {flow.firstService.service} - - handleServiceLinkClick(flow.firstService.spanCodeObjectId) - } - > - {flow.firstService.span} - - - + + + + {flow.firstService.service} + + handleServiceLinkClick(flow.firstService.spanCodeObjectId) + } + > + {flow.firstService.span} + + + + + {flow.intermediateSpan && ( - + {FlowArrow} {flow.intermediateSpan} - + + )} {flow.lastService && ( - + {FlowArrow} - + {flow.lastService.service} - + + )} {flow.lastServiceSpan && ( - + {FlowArrow} {flow.lastServiceSpan} - + + )} ); diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/styles.ts b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/styles.ts index f7a62cdfb..2338ade5b 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/styles.ts +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/styles.ts @@ -4,6 +4,7 @@ import { footnoteRegularTypography } from "../../../../../common/App/typographies"; import { Link as CommonLink } from "../../../../../common/Link"; +import { CopyButton } from "../../../../../common/v3/CopyButton"; export const Container = styled.div` display: flex; @@ -21,10 +22,21 @@ export const FlowData = styled.div` overflow: hidden; `; -export const SubsequentSpan = styled.div` +export const StyledCopyButton = styled(CopyButton)` + padding: 0; + display: none; +`; + +export const Span = styled.div` display: flex; gap: 8px; align-items: center; + + &:hover { + ${StyledCopyButton} { + display: flex; + } + } `; export const ArrowIconContainer = styled.div` diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/EndpointSelectedOption/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/EndpointSelectedOption/index.tsx new file mode 100644 index 000000000..4c83927ed --- /dev/null +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/EndpointSelectedOption/index.tsx @@ -0,0 +1,25 @@ +import { Link } from "../../../../../../../common/v3/Link"; +import { Tooltip } from "../../../../../../../common/v3/Tooltip"; +import * as s from "./styles"; +import { EndpointSelectedOptionProps } from "./types"; + +export const EndpointSelectedOption = ({ + serviceName, + route, + spanCodeObjectId, + onClick +}: EndpointSelectedOptionProps) => { + const title = `${serviceName} ${route}`; + + return ( + + + + {serviceName} + onClick(spanCodeObjectId)}>{route} + + + + + ); +}; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/EndpointSelectedOption/styles.ts b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/EndpointSelectedOption/styles.ts new file mode 100644 index 000000000..0ec5362d7 --- /dev/null +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/EndpointSelectedOption/styles.ts @@ -0,0 +1,36 @@ +import styled from "styled-components"; +import { footnoteRegularTypography } from "../../../../../../../common/App/typographies"; +import { CopyButton } from "../../../../../../../common/v3/CopyButton"; + +export const StyledCopyButton = styled(CopyButton)` + display: none; + padding: 0; +`; + +export const Container = styled.div` + ${footnoteRegularTypography} + + display: flex; + gap: 4px; + align-items: center; + width: 100%; + + &:hover { + ${StyledCopyButton} { + display: flex; + } + } +`; + +export const EndpointName = styled.div` + display: flex; + gap: 4px; + overflow: hidden; +`; + +export const ServiceName = styled.span` + max-width: 50%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +`; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/EndpointSelectedOption/types.ts b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/EndpointSelectedOption/types.ts new file mode 100644 index 000000000..51c9fb512 --- /dev/null +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/EndpointSelectedOption/types.ts @@ -0,0 +1,6 @@ +export interface EndpointSelectedOptionProps { + serviceName: string; + route: string; + spanCodeObjectId: string; + onClick: (spanCodeObjectId: string) => void; +} diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/InsightHeader/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/InsightHeader/index.tsx index 1bed06bad..a2fe66904 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/InsightHeader/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/InsightHeader/index.tsx @@ -7,7 +7,6 @@ import { } from "../../../../../../../../utils/getInsightTypeInfo"; import { roundTo } from "../../../../../../../../utils/roundTo"; import { ConfigContext } from "../../../../../../../common/App/ConfigContext"; -import { Info } from "../../../../../../../common/v3/Info"; import { Link } from "../../../../../../../common/v3/Link"; import { NewTag } from "../../../../../../../common/v3/NewTag"; import { Tag } from "../../../../../../../common/v3/Tag"; @@ -105,7 +104,7 @@ export const InsightHeader = ({ {insightTypeInfo?.label} {insightTypeInfo?.description && ( - } /> + } /> )} {lastUpdateTimer && ( @@ -136,6 +135,7 @@ export const InsightHeader = ({ {spanInfo.displayName} + )} diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/InsightHeader/styles.ts b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/InsightHeader/styles.ts index c9ac3bcb5..adaf40caf 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/InsightHeader/styles.ts +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/InsightHeader/styles.ts @@ -3,6 +3,8 @@ import { bodySemiboldTypography, footnoteRegularTypography } from "../../../../../../../common/App/typographies"; +import { CopyButton } from "../../../../../../../common/v3/CopyButton"; +import { Info } from "../../../../../../../common/v3/Info"; export const Container = styled.div` display: flex; @@ -16,9 +18,22 @@ export const TitleRow = styled.div` gap: 8px; `; +export const StyledCopyButton = styled(CopyButton)` + padding: 0 6px; + display: none; +`; + export const SpanInfoRow = styled.div` display: flex; padding: 0 32px; + gap: 4px; + align-items: center; + + &:hover { + ${StyledCopyButton} { + display: flex; + } + } `; export const TagTitle = styled.span` @@ -37,6 +52,10 @@ export const Title = styled.div` align-items: center; `; +export const TitleInfo = styled(Info)` + color: ${({ theme }) => theme.colors.v3.icon.tertiary}; +`; + export const BadgeContainer = styled.div` margin-left: auto; display: flex; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/ListItem/ListItem.stories.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/ListItem/ListItem.stories.tsx index fca0f216e..5077dde9d 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/ListItem/ListItem.stories.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/ListItem/ListItem.stories.tsx @@ -28,9 +28,11 @@ export const Default: Story = { export const WithButtons: Story = { args: { name: "Very very very very very very very very long text", - buttons: [ -