Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Assets/AssetList/AssetEntry/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const AssetEntry = (props: AssetEntryProps) => {
<Tooltip title={name}>
<s.Link onClick={() => handleLinkClick()}>{name}</s.Link>
</Tooltip>
<s.StyledCopyButton text={name} />
<s.IndicatorsContainer>
{isNew && <Tag type={"success"} value={"New"} />}
{sortedInsights.map((insight) => {
Expand Down
12 changes: 12 additions & 0 deletions src/components/Assets/AssetList/AssetEntry/styles.ts
Original file line number Diff line number Diff line change
@@ -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`
Expand Down Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion src/components/Assets/AssetList/AssetList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Default: Story = {
args: {
searchQuery: "",
setRefresher: () => {
// empty
return undefined;
},
assetTypeId: "Endpoint",
data: {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Assets/AssetList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ export const AssetList = (props: AssetListProps) => {
props.scopeViewOptions
]);

const handleBackButtonClick = () => {
props.onBackButtonClick();
const handleAllAssetsLinkClick = () => {
props.onGoToAllAssets();
};

const handleSortingMenuToggle = () => {
Expand Down Expand Up @@ -459,7 +459,7 @@ export const AssetList = (props: AssetListProps) => {
)}
{assetTypeInfo?.label || props.assetTypeId}
</s.TypeHeader>
<Link onClick={handleBackButtonClick}>All Assets</Link>
<Link onClick={handleAllAssetsLinkClick}>All Assets</Link>
</s.Header>
<s.Toolbar>
<s.PopoverContainer>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Assets/AssetList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AssetScopeOption } from "../AssetsViewScopeConfiguration/types";

export interface AssetListProps {
data?: AssetsData;
onBackButtonClick: () => void;
onGoToAllAssets: () => void;
assetTypeId: string;
filters?: AssetFilterQuery;
searchQuery: string;
Expand Down
6 changes: 6 additions & 0 deletions src/components/Assets/AssetTypeList/AssetTypeList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ type Story = StoryObj<typeof meta>;
// 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: [
Expand Down Expand Up @@ -54,6 +57,9 @@ export const Default: Story = {
export const Empty: Story = {
args: {
searchQuery: "",
setRefresher: () => {
return undefined;
},
data: {
assetCategories: []
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Assets/index.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -61,7 +61,7 @@ export const Assets = ({ selectedTypeId }: AssetsProps) => {
}
}, [config.scope, previousScope, selectedTypeId]);

const handleAllAssetsClick = () => {
const handleGoToAllAssets = () => {
setSelectedAssetTypeId(null);
changeView("/assets");
};
Expand Down Expand Up @@ -153,7 +153,7 @@ export const Assets = ({ selectedTypeId }: AssetsProps) => {

return (
<AssetList
onBackButtonClick={handleAllAssetsClick}
onGoToAllAssets={handleGoToAllAssets}
assetTypeId={selectedAssetTypeId}
filters={selectedFilters}
searchQuery={debouncedSearchInputValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const renderClientSpanOverallImpactEntry = (
{item.displayName}
</s.SpanLink>
</Tooltip>
<s.StyledCopyButton text={item.displayName} />
<s.ImpactScoreContainer>
<ImpactScore
score={item.overallImpact}
Expand Down
Original file line number Diff line number Diff line change
@@ -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)`
Expand All @@ -14,6 +25,7 @@ export const SpanLink = styled(Link)`
`;

export const ImpactScoreContainer = styled.div`
margin-left: auto;
display: flex;
width: 70px;
flex-shrink: 0;
Expand Down
1 change: 1 addition & 0 deletions src/components/Dashboard/widgets/SlowQueries/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const renderSlowQueryEntry = (
{item.displayName}
</s.SpanLink>
</Tooltip>
<s.StyledCopyButton text={item.displayName} />
{durationString && <s.Duration>{durationString}</s.Duration>}
</s.Entry>
);
Expand Down
14 changes: 13 additions & 1 deletion src/components/Dashboard/widgets/SlowQueries/styles.ts
Original file line number Diff line number Diff line change
@@ -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)`
Expand All @@ -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;
Expand Down
52 changes: 24 additions & 28 deletions src/components/Highlights/Highlights.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,34 @@ type Story = StoryObj<typeof meta>;
// 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);
}
};
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -26,7 +27,10 @@ export const AssetLink = ({ asset }: AssetLinkProps) => {

return (
<Tooltip title={assetName}>
<s.Link onClick={handleAssetLinkClick}>{assetName}</s.Link>
<s.Container>
<Link onClick={handleAssetLinkClick}>{assetName}</Link>
<s.StyledCopyButton text={assetName} />
</s.Container>
</Tooltip>
);
};
19 changes: 17 additions & 2 deletions src/components/Highlights/TopIssues/common/AssetLink/styles.ts
Original file line number Diff line number Diff line change
@@ -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;
}
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ({
Expand Down Expand Up @@ -54,7 +53,7 @@ export const EndpointBottleneckInsightCard = ({
<ContentContainer>
<Details>
<Description>Asset</Description>
<s.SpanListItem
<AssetLink
name={spanName}
onClick={() => handleSpanLinkClick(spanCodeObjectId)}
/>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -37,7 +37,7 @@ export const EndpointChattyApiV2InsightCard = ({
<Description>
Excessive API calls to specific endpoint found
</Description>
<s.SpanListItem
<AssetLink
name={spanName}
onClick={() => handleSpanLinkClick(spanCodeObjectId)}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ({
Expand Down Expand Up @@ -46,7 +45,7 @@ export const EndpointQueryOptimizationV2InsightCard = ({
content={
<ContentContainer>
<Details>
<s.SpanListItem
<AssetLink
name={spanName}
onClick={() => handleSpanLinkClick(spanCodeObjectId)}
/>
Expand Down
Loading