Skip to content

Commit 90845b7

Browse files
Merge pull request #2103 from RedisInsight/fe/feature/RI-4509
#RI-4509 - add telemetry to release notes link
2 parents 06e4a0a + 818afad commit 90845b7

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

redisinsight/ui/src/components/navigation-menu/components/help-menu/HelpMenu.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import React, { useState } from 'react'
1515
import { useDispatch, useSelector } from 'react-redux'
1616

1717
import { EXTERNAL_LINKS } from 'uiSrc/constants/links'
18+
import { ReleaseNotesSource } from 'uiSrc/constants/telemetry'
1819
import { appElectronInfoSelector, setReleaseNotesViewed, setShortcutsFlyoutState } from 'uiSrc/slices/app/info'
1920
import { ONBOARDING_FEATURES } from 'uiSrc/components/onboarding-features'
2021
import { setOnboarding } from 'uiSrc/slices/app/features'
@@ -24,6 +25,8 @@ import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
2425
import { ReactComponent as GithubHelpCenterSVG } from 'uiSrc/assets/img/github.svg'
2526
import { ReactComponent as BulbSVG } from 'uiSrc/assets/img/bulb.svg'
2627

28+
import { addMessageNotification } from 'uiSrc/slices/app/notifications'
29+
import successMessages from 'uiSrc/components/notifications/success-messages'
2730
import navStyles from '../../styles.module.scss'
2831
import styles from './styles.module.scss'
2932

@@ -40,6 +43,15 @@ const HelpMenu = () => {
4043
}
4144

4245
const onClickReleaseNotes = async () => {
46+
dispatch(addMessageNotification(
47+
successMessages.INSTALLED_NEW_UPDATE('2.2.1', () => dispatch(setReleaseNotesViewed(true)))
48+
))
49+
sendEventTelemetry({
50+
event: TelemetryEvent.RELEASE_NOTES_LINK_CLICKED,
51+
eventData: {
52+
source: ReleaseNotesSource.helpCenter
53+
}
54+
})
4355
if (isReleaseNotesViewed === false) {
4456
dispatch(setReleaseNotesViewed(true))
4557
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export enum ReleaseNotesSource {
2+
helpCenter = 'Help Center',
3+
updateNotification = 'Update notification'
4+
}

redisinsight/ui/src/electron/utils/ipcCheckUpdates.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ipcRenderer } from 'electron'
22
import { Dispatch } from 'react'
33
import { omit } from 'lodash'
44
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
5+
import { ReleaseNotesSource } from 'uiSrc/constants/telemetry'
56
import { setElectronInfo, setReleaseNotesViewed } from 'uiSrc/slices/app/info'
67
import { addMessageNotification } from 'uiSrc/slices/app/notifications'
78
import successMessages from 'uiSrc/components/notifications/success-messages'
@@ -23,7 +24,15 @@ export const ipcCheckUpdates = async (serverInfo: GetServerInfoResponse, dispatc
2324
if (isUpdateDownloaded && !isUpdateAvailable) {
2425
if (serverInfo.appVersion === updateDownloadedVersion) {
2526
dispatch(addMessageNotification(
26-
successMessages.INSTALLED_NEW_UPDATE(updateDownloadedVersion, () => dispatch(setReleaseNotesViewed(true)))
27+
successMessages.INSTALLED_NEW_UPDATE(updateDownloadedVersion, () => {
28+
dispatch(setReleaseNotesViewed(true))
29+
sendEventTelemetry({
30+
event: TelemetryEvent.RELEASE_NOTES_LINK_CLICKED,
31+
eventData: {
32+
source: ReleaseNotesSource.updateNotification
33+
}
34+
})
35+
})
2736
))
2837
}
2938

redisinsight/ui/src/telemetry/events.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,6 @@ export enum TelemetryEvent {
222222
ONBOARDING_TOUR_ACTION_MADE = 'ONBOARDING_TOUR_ACTION_MADE',
223223
ONBOARDING_TOUR_TRIGGERED = 'ONBOARDING_TOUR_TRIGGERED',
224224
ONBOARDING_TOUR_FINISHED = 'ONBOARDING_TOUR_FINISHED',
225+
226+
RELEASE_NOTES_LINK_CLICKED = 'RELEASE_NOTES_LINK_CLICKED',
225227
}

0 commit comments

Comments
 (0)