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
7 changes: 7 additions & 0 deletions src/components/Dashboard/NewReport/ReportHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ import { Environment } from "../../../common/App/types";

import { isEnvironment } from "../../../../typeGuards/isEnvironment";
import { isNumber } from "../../../../typeGuards/isNumber";
import { sendUserActionTrackingEvent } from "../../../../utils/actions/sendUserActionTrackingEvent";
import { CodeIcon } from "../../../common/icons/12px/CodeIcon";
import { DurationBreakdownIcon } from "../../../common/icons/12px/DurationBreakdownIcon";
import { InfinityIcon } from "../../../common/icons/16px/InfinityIcon";
import { TableIcon } from "../../../common/icons/16px/TableIcon";
import { TreemapIcon } from "../../../common/icons/16px/TreemapIcon";
import { trackingEvents } from "../tracking";
import { GetServicesPayload } from "../types";
import * as s from "./styles";
import { ReportHeaderProps, ReportTimeMode, ReportViewMode } from "./types";
Expand Down Expand Up @@ -138,6 +140,7 @@ export const ReportHeader = ({
]);

const handleSelectedEnvironmentChanged = (option: string | string[]) => {
sendUserActionTrackingEvent(trackingEvents.ENVIRONMENT_FILTER_SELECTED);
const newItem =
option === selectedEnvironment?.id
? [""]
Expand All @@ -152,11 +155,13 @@ export const ReportHeader = ({
};

const handleSelectedServicesChanged = (option: string | string[]) => {
sendUserActionTrackingEvent(trackingEvents.SERVICES_FILTER_SELECTED);
const newItem = Array.isArray(option) ? option : [option];
setSelectedServices(newItem);
};

const handlePeriodChanged = (option: string | string[]) => {
sendUserActionTrackingEvent(trackingEvents.PERIOD_FILTER_CHANGED);
const newItem = Array.isArray(option) ? option : [option];
if (newItem.length === 0) {
setPeriodInDays(DEFAULT_PERIOD);
Expand All @@ -169,12 +174,14 @@ export const ReportHeader = ({
};

const handleViewModeChanged = (value: string) => {
sendUserActionTrackingEvent(trackingEvents.VIEW_MODE_CHANGED, { value });
const newMode = value as ReportViewMode;
setVieMode(newMode);
onViewModeChanged(newMode);
};

const handleTimeModeChanged = (value: string) => {
sendUserActionTrackingEvent(trackingEvents.TIME_MODE_CHANGED, { value });
const newMode = value as ReportTimeMode;
setTimeMode(newMode);
};
Expand Down
5 changes: 4 additions & 1 deletion src/components/Dashboard/NewReport/tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ export const trackingEvents = addPrefix(
ENVIRONMENT_FILTER_SELECTED: "environment filter selected",
SERVICES_FILTER_SELECTED: "service filter selected",
TABLE_SEE_ISSUES_LINK_CLICKED: "table see issues link clicked",
HEATMAP_SEE_ISSUES_LINK_CLICKED: "heatmap see issues link clicked"
HEATMAP_SEE_ISSUES_LINK_CLICKED: "heatmap see issues link clicked",
PERIOD_FILTER_CHANGED: "period filter changed",
VIEW_MODE_CHANGED: "view mode changed",
TIME_MODE_CHANGED: "time mode changed"
},
" "
);
1 change: 1 addition & 0 deletions src/components/Navigation/KebabMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const KebabMenu = ({ onClose }: KebabMenuProps) => {
};

const handleReportClick = () => {
sendUserActionTrackingEvent(trackingEvents.OPEN_DIGMA_METRICS_CLICKED);
window.sendMessageToDigma({
action: globalActions.OPEN_REPORT
});
Expand Down
3 changes: 2 additions & 1 deletion src/components/Navigation/tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export const trackingEvents = addPrefix(
DASHBOARD_LINK_CLICKED: "dashboard link clicked",
OPEN_DOCS_CLICKED: "open docs clicked",
TAB_CLICKED: "tab clicked",
LOGOUT_CLICKED: "logout clicked"
LOGOUT_CLICKED: "logout clicked",
OPEN_DIGMA_METRICS_CLICKED: "open digma metrics clicked"
},
" "
);