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
11 changes: 10 additions & 1 deletion src/components/Insights/common/InsightCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useContext, useEffect, useState } from "react";
import { actions as globalActions } from "../../../../actions";
import { getFeatureFlagValue } from "../../../../featureFlags";
import { usePrevious } from "../../../../hooks/usePrevious";
import { trackingEvents as globalTrackingEvents } from "../../../../trackingEvents";
import { isString } from "../../../../typeGuards/isString";
import { FeatureFlag, GetInsightStatsPayload } from "../../../../types";
import { sendTrackingEvent } from "../../../../utils/sendTrackingEvent";
Expand Down Expand Up @@ -151,6 +152,14 @@ export const InsightCard = (props: InsightCardProps) => {
show();
};

const handleMarkAsReadButtonClick = () => {
sendTrackingEvent(globalTrackingEvents.USER_ACTION, {
action: trackingEvents.INSIGHT_CARD_MARK_AS_READ_BUTTON_CLICKED,
insightType: props.insight.type
});
markAsRead();
};

const openTicketInfo = (
spanCodeObjectId: string | undefined,
event: string
Expand Down Expand Up @@ -197,7 +206,7 @@ export const InsightCard = (props: InsightCardProps) => {
<Button
icon={CheckmarkCircleIcon}
label={"Mark as read"}
onClick={markAsRead}
onClick={handleMarkAsReadButtonClick}
isDisabled={isMarkingAsReadInProgress}
{...btnProps}
/>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Insights/tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export const trackingEvents = addPrefix(
INSIGHT_CARD_SHOW_BUTTON_CLICKED: "insight card show button clicked",
INSIGHT_CARD_CREATE_TICKET_LINK_CLICKED:
"insight card create ticket link clicked",
INSIGHT_CARD_MARK_AS_READ_BUTTON_CLICKED:
"insight card mark as read button clicked",
REFRESH_BUTTON_CLICKED: "refresh button clicked"
},
" "
Expand Down