From 9142ebf82c9b9c21ce219f40022746f5a7cccabe Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Tue, 28 Oct 2025 09:28:33 +0100 Subject: [PATCH] feat: track change progression (#10874) --- .../ReleasePlanMilestoneItem.tsx | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/ReleasePlanMilestoneItem.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/ReleasePlanMilestoneItem.tsx index cdfc7401c4..5580f3d872 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/ReleasePlanMilestoneItem.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneItem/ReleasePlanMilestoneItem.tsx @@ -10,6 +10,7 @@ import { formatUnknownError } from 'utils/formatUnknownError'; import { calculateMilestoneStatus } from './milestoneStatusUtils.js'; import { getPendingProgressionData } from './pendingProgressionChanges.js'; import { MilestoneAutomation } from './MilestoneAutomation.tsx'; +import { usePlausibleTracker } from 'hooks/usePlausibleTracker.ts'; const StyledConnection = styled('div', { shouldForwardProp: (prop) => prop !== 'isCompleted', @@ -54,6 +55,16 @@ export interface IReleasePlanMilestoneItemProps { onUpdate: () => void | Promise; } +const getTimeUnit = (intervalMinutes: number): 'minutes' | 'hours' | 'days' => { + if (intervalMinutes < 60) { + return 'minutes'; + } else if (intervalMinutes < 1440) { + return 'hours'; + } else { + return 'days'; + } +}; + export const ReleasePlanMilestoneItem = ({ milestone, index, @@ -77,6 +88,7 @@ export const ReleasePlanMilestoneItem = ({ const { changeMilestoneProgression } = useMilestoneProgressionsApi(); const { isChangeRequestConfigured } = useChangeRequestsEnabled(projectId); const { setToastData, setToastApiError } = useToast(); + const { trackEvent } = usePlausibleTracker(); const isNotLastMilestone = index < milestones.length - 1; const isProgressionFormOpen = progressionFormOpenIndex === index; @@ -89,6 +101,14 @@ export const ReleasePlanMilestoneItem = ({ const handleChangeProgression = async ( payload: ChangeMilestoneProgressionSchema, ): Promise<{ shouldReset?: boolean }> => { + trackEvent('release-management', { + props: { + eventType: 'change-progression', + transitionUnit: getTimeUnit( + payload.transitionCondition.intervalMinutes, + ), + }, + }); if (isChangeRequestConfigured(environment)) { onAddToChangeRequest({ type: 'changeMilestoneProgression',