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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from "styled-components";

export const Container = styled.div`
display: flex;
gap: 8px;
gap: 24px;
justify-content: space-between;
flex-grow: 1;

Expand Down
21 changes: 18 additions & 3 deletions src/components/Insights/common/InsightCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { HistogramIcon } from "../../../common/icons/16px/HistogramIcon";
import { LiveIcon } from "../../../common/icons/16px/LiveIcon";
import { PinIcon } from "../../../common/icons/16px/PinIcon";
import { RecalculateIcon } from "../../../common/icons/16px/RecalculateIcon";
import { CrossIcon } from "../../../common/icons/CrossIcon";
import { Button } from "../../../common/v3/Button";
import { Card } from "../../../common/v3/Card";
import { JiraButton } from "../../../common/v3/JiraButton";
import { Tooltip } from "../../../common/v3/Tooltip";
import { isSpanInsight } from "../../typeGuards";
import { IconButton } from "./IconButton";
import { InsightHeader } from "./InsightHeader";
import * as s from "./styles";
Expand All @@ -35,6 +35,18 @@ export const InsightCard = (props: InsightCardProps) => {
setIsRecalculatingStarted(true);
};

const handleHistogramButtonClick = () => {
isSpanInsight(props.insight) &&
props.insight.spanInfo &&
props.onOpenHistogram &&
props.onOpenHistogram(
props.insight.spanInfo.instrumentationLibrary,
props.insight.spanInfo.name,
props.insight.type,
props.insight.spanInfo.displayName
);
};

const renderRecalculationBlock = (
actualStartTime: string,
customStartTime: string | null,
Expand Down Expand Up @@ -107,10 +119,13 @@ export const InsightCard = (props: InsightCardProps) => {
}
footer={
<s.InsightFooter>
<Button icon={CrossIcon} label="Dismiss" buttonType="tertiary" />
{/* <Button icon={CrossIcon} label={"Dismiss"} buttonType={"tertiary"} /> */}
<s.Actions>
{props.onOpenHistogram && (
<IconButton icon={{ component: HistogramIcon }} />
<IconButton
icon={{ component: HistogramIcon }}
onClick={handleHistogramButtonClick}
/>
)}
{props.onRecalculate && (
<IconButton
Expand Down
1 change: 1 addition & 0 deletions src/components/Insights/common/InsightCard/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const RefreshContainer = styled.div`
`;

export const Actions = styled.div`
margin-left: auto;
display: flex;
`;

Expand Down
4 changes: 3 additions & 1 deletion src/components/Insights/common/InsightCard/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ export interface InsightCardProps {
isActive?: boolean;
onDismiss?: (insightId: string) => void;
onOpenHistogram?: (
instrumentationLibrary: string,
name: string,
insightType: InsightType,
spanCodeObjectId: string
displayName: string
) => void;
onRecalculate?: (
prefixedCodeObjectId: string,
Expand Down
Loading