diff --git a/redisinsight/ui/src/components/navigation-menu/components/help-menu/HelpMenu.tsx b/redisinsight/ui/src/components/navigation-menu/components/help-menu/HelpMenu.tsx index d1bcea5777..28b049ab05 100644 --- a/redisinsight/ui/src/components/navigation-menu/components/help-menu/HelpMenu.tsx +++ b/redisinsight/ui/src/components/navigation-menu/components/help-menu/HelpMenu.tsx @@ -15,6 +15,7 @@ import React, { useState } from 'react' import { useDispatch, useSelector } from 'react-redux' import { EXTERNAL_LINKS } from 'uiSrc/constants/links' +import { ReleaseNotesSource } from 'uiSrc/constants/telemetry' import { appElectronInfoSelector, setReleaseNotesViewed, setShortcutsFlyoutState } from 'uiSrc/slices/app/info' import { ONBOARDING_FEATURES } from 'uiSrc/components/onboarding-features' import { setOnboarding } from 'uiSrc/slices/app/features' @@ -24,6 +25,8 @@ import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances' import { ReactComponent as GithubHelpCenterSVG } from 'uiSrc/assets/img/github.svg' import { ReactComponent as BulbSVG } from 'uiSrc/assets/img/bulb.svg' +import { addMessageNotification } from 'uiSrc/slices/app/notifications' +import successMessages from 'uiSrc/components/notifications/success-messages' import navStyles from '../../styles.module.scss' import styles from './styles.module.scss' @@ -40,6 +43,15 @@ const HelpMenu = () => { } const onClickReleaseNotes = async () => { + dispatch(addMessageNotification( + successMessages.INSTALLED_NEW_UPDATE('2.2.1', () => dispatch(setReleaseNotesViewed(true))) + )) + sendEventTelemetry({ + event: TelemetryEvent.RELEASE_NOTES_LINK_CLICKED, + eventData: { + source: ReleaseNotesSource.helpCenter + } + }) if (isReleaseNotesViewed === false) { dispatch(setReleaseNotesViewed(true)) } diff --git a/redisinsight/ui/src/constants/telemetry.ts b/redisinsight/ui/src/constants/telemetry.ts new file mode 100644 index 0000000000..f43d74679c --- /dev/null +++ b/redisinsight/ui/src/constants/telemetry.ts @@ -0,0 +1,4 @@ +export enum ReleaseNotesSource { + helpCenter = 'Help Center', + updateNotification = 'Update notification' +} diff --git a/redisinsight/ui/src/electron/utils/ipcCheckUpdates.ts b/redisinsight/ui/src/electron/utils/ipcCheckUpdates.ts index dd33ce438a..bdd77d5b33 100644 --- a/redisinsight/ui/src/electron/utils/ipcCheckUpdates.ts +++ b/redisinsight/ui/src/electron/utils/ipcCheckUpdates.ts @@ -2,6 +2,7 @@ import { ipcRenderer } from 'electron' import { Dispatch } from 'react' import { omit } from 'lodash' import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry' +import { ReleaseNotesSource } from 'uiSrc/constants/telemetry' import { setElectronInfo, setReleaseNotesViewed } from 'uiSrc/slices/app/info' import { addMessageNotification } from 'uiSrc/slices/app/notifications' import successMessages from 'uiSrc/components/notifications/success-messages' @@ -23,7 +24,15 @@ export const ipcCheckUpdates = async (serverInfo: GetServerInfoResponse, dispatc if (isUpdateDownloaded && !isUpdateAvailable) { if (serverInfo.appVersion === updateDownloadedVersion) { dispatch(addMessageNotification( - successMessages.INSTALLED_NEW_UPDATE(updateDownloadedVersion, () => dispatch(setReleaseNotesViewed(true))) + successMessages.INSTALLED_NEW_UPDATE(updateDownloadedVersion, () => { + dispatch(setReleaseNotesViewed(true)) + sendEventTelemetry({ + event: TelemetryEvent.RELEASE_NOTES_LINK_CLICKED, + eventData: { + source: ReleaseNotesSource.updateNotification + } + }) + }) )) } diff --git a/redisinsight/ui/src/telemetry/events.ts b/redisinsight/ui/src/telemetry/events.ts index fba2513221..d6510cddef 100644 --- a/redisinsight/ui/src/telemetry/events.ts +++ b/redisinsight/ui/src/telemetry/events.ts @@ -223,4 +223,6 @@ export enum TelemetryEvent { ONBOARDING_TOUR_ACTION_MADE = 'ONBOARDING_TOUR_ACTION_MADE', ONBOARDING_TOUR_TRIGGERED = 'ONBOARDING_TOUR_TRIGGERED', ONBOARDING_TOUR_FINISHED = 'ONBOARDING_TOUR_FINISHED', + + RELEASE_NOTES_LINK_CLICKED = 'RELEASE_NOTES_LINK_CLICKED', }