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
@@ -1,5 +1,5 @@
import { useTheme } from "styled-components";
import { getInsightStatusInfo } from "../../../Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/InsightHeader/InsightStatusBadge/getInsightStatusInfo";
import { getInsightStatusInfo } from "../../../Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightStatusBadge/getInsightStatusInfo";
import { Tooltip } from "../../../common/v3/Tooltip";
import * as s from "./styles";
import { TableInsightStatusBadgeProps } from "./types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from "styled-components";
import { InsightStatusBadge } from "../../../Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/InsightHeader/InsightStatusBadge";
import { InsightStatusBadge } from "../../../Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightStatusBadge";

export const Badge = styled(InsightStatusBadge)`
font-size: inherit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
GenericCodeObjectInsight,
InsightStatus
} from "../../../../../../types";
import { InsightStatusBadge } from "../../InsightStatusBadge";
import { AsyncTag } from "./AsyncTag";
import { InsightIcon } from "./InsightIcon";
import { InsightStatusBadge } from "./InsightStatusBadge";
import { InsightStatusTooltipContent } from "./InsightStatusTooltipContent";
import * as s from "./styles";
import { InsightHeaderProps } from "./types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, StoryObj } from "@storybook/react";
import { InsightStatusBadge } from ".";
import { InsightStatus } from "../../../../../../../types";
import { InsightStatus } from "../../../../../types";

// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
const meta: Meta<typeof InsightStatusBadge> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DefaultTheme } from "styled-components/dist/types";
import { InsightStatus } from "../../../../../../../types";
import { InsightStatus } from "../../../../../types";

interface InsightStatusInfo {
label: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as s from "./styles";
import { InsightStatusBadgeProps } from "./types";

export const InsightStatusBadgeComponent = (
{ status, className }: InsightStatusBadgeProps,
{ status, className, withLabel = true }: InsightStatusBadgeProps,
ref: ForwardedRef<HTMLDivElement>
) => {
const theme = useTheme();
Expand All @@ -19,7 +19,7 @@ export const InsightStatusBadgeComponent = (
return (
<s.Container className={className} ref={ref}>
<s.Indicator $status={status} />
<s.Status>{statusInfo.label}</s.Status>
{withLabel && <s.Status>{statusInfo.label}</s.Status>}
</s.Container>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled, { css } from "styled-components";
import { footnoteRegularTypography } from "../../../../../../../../common/App/typographies";
import { footnoteRegularTypography } from "../../../../../../common/App/typographies";
import { getInsightStatusInfo } from "./getInsightStatusInfo";
import { IndicatorProps } from "./types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { InsightStatus } from "../../../../../../../types";
import { InsightStatus } from "../../../../../types";

export interface InsightStatusBadgeProps {
status: InsightStatus;
className?: string;
withLabel?: boolean;
}

export interface IndicatorProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ import { ThreeDotsIcon } from "../../../../../../common/icons/ThreeDotsIcon";
import { NewPopover } from "../../../../../../common/NewPopover";
import { Link } from "../../../../../../common/v3/Link";
import { NewIconButton } from "../../../../../../common/v3/NewIconButton";
import { Tag } from "../../../../../../common/v3/Tag";
import { Tooltip } from "../../../../../../common/v3/Tooltip";
import { MenuList } from "../../../../../../Navigation/common/MenuList";
import { MenuItem } from "../../../../../../Navigation/common/MenuList/types";
import { trackingEvents } from "../../../../../tracking";
import { isEndpointInsight, isSpanInsight } from "../../../../../typeGuards";
import { InsightIcon } from "../InsightCard/InsightHeader/InsightIcon";
import { KeyValue } from "../InsightCard/InsightHeader/InsightStatusTooltipContent/KeyValue";
import { getInsightStatusInfo } from "../InsightStatusBadge/getInsightStatusInfo";
import * as s from "./styles";
import { IssueCompactCardProps } from "./types";

Expand All @@ -34,14 +37,17 @@ export const IssueCompactCard = ({
onTicketOpen,
isCritical
}: IssueCompactCardProps) => {
const theme = useTheme();
const isJaegerEnabled = useGlobalStore.use.isJaegerEnabled();
const [isKebabMenuOpen, setIsKebabMenuOpen] = useState(false);
const insightTypeInfo = getInsightTypeInfo(insight.type, insight.subType);
const statusInfo = insight.status
? getInsightStatusInfo(insight.status, theme)
: undefined;
const spanInfo =
isSpanInsight(insight) || isEndpointInsight(insight)
? insight.spanInfo
: undefined;
const theme = useTheme();
const isTicketLinkAttached = Boolean(insight.ticketLink);
const handleContainerClick = () => {
sendUserActionTrackingEvent(trackingEvents.ISSUE_CARD_CLICKED, {
Expand Down Expand Up @@ -162,7 +168,19 @@ export const IssueCompactCard = ({
/>
)}
<s.Title>{insightTypeInfo?.label}</s.Title>
{metric && <s.MetricTag content={metric} type={"highlight"} />}
{insight.status && statusInfo && (
<Tooltip
title={<KeyValue label="Status">{statusInfo.label}</KeyValue>}
placement={"top"}
fullWidth={true}
>
<s.StyledInsightStatusBadge
status={insight.status}
withLabel={false}
/>
</Tooltip>
)}
{metric && <Tag content={metric} type={"highlight"} />}
<NewPopover
isOpen={isKebabMenuOpen}
onOpenChange={setIsKebabMenuOpen}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import styled, { css } from "styled-components";
import { bodyBoldTypography } from "../../../../../../common/App/typographies";
import { CopyButton } from "../../../../../../common/v3/CopyButton";
import { Tag } from "../../../../../../common/v3/Tag";
import { Popup } from "../../../../../../Navigation/common/Popup";
import { InsightStatusBadge } from "../InsightStatusBadge";
import { ContainerProps } from "./types";

export const Container = styled.div<ContainerProps>`
Expand Down Expand Up @@ -59,8 +59,8 @@ export const Title = styled.span`
color: ${({ theme }) => theme.colors.v3.text.primary};
`;

export const MetricTag = styled(Tag)`
margin-left: 4px;
export const StyledInsightStatusBadge = styled(InsightStatusBadge)`
padding: 10px;
`;

export const StyledCopyButton = styled(CopyButton)`
Expand Down