diff --git a/redisinsight/api/src/constants/agreements-spec.json b/redisinsight/api/src/constants/agreements-spec.json index 9b76c69331..3aef32661c 100644 --- a/redisinsight/api/src/constants/agreements-spec.json +++ b/redisinsight/api/src/constants/agreements-spec.json @@ -9,9 +9,9 @@ "disabled": false, "category": "privacy", "since": "1.0.1", - "title": "Analytics", - "label": "Enable Analytics", - "description": "Select to help us make Redis Insight better. We aggregate anonymized user experience data and use it to fix bugs and improve experience for all users." + "title": "Telemetry", + "label": "Enable Telemetry", + "description": "Select to help us make Redis Insight better. Telemetry helps us better understand how Redis Insight features are being used, improve experience for all users, and prioritize new features." }, "notifications": { "defaultValue": false, diff --git a/redisinsight/ui/src/components/config/Config.tsx b/redisinsight/ui/src/components/config/Config.tsx index 4b71cb5cee..b8ac32b2d7 100644 --- a/redisinsight/ui/src/components/config/Config.tsx +++ b/redisinsight/ui/src/components/config/Config.tsx @@ -80,7 +80,7 @@ const Config = () => { if (cloudSsoFeature?.flag) { dispatch(fetchProfile()) } - }, [cloudSsoFeature]) + }, [cloudSsoFeature?.flag]) useEffect(() => { featuresHighlight() diff --git a/redisinsight/ui/src/components/consents-settings/ConsentsPrivacy/ConsentsPrivacy.spec.tsx b/redisinsight/ui/src/components/consents-settings/ConsentsPrivacy/ConsentsPrivacy.spec.tsx index 338c332e8a..9039d0c0ef 100644 --- a/redisinsight/ui/src/components/consents-settings/ConsentsPrivacy/ConsentsPrivacy.spec.tsx +++ b/redisinsight/ui/src/components/consents-settings/ConsentsPrivacy/ConsentsPrivacy.spec.tsx @@ -91,7 +91,7 @@ describe('ConsentsPrivacy', () => { }) }) - const expectedActions = [{}].fill(updateUserConfigSettings(), 0) + const expectedActions = [updateUserConfigSettings()] expect(clearStoreActions(store.getActions().slice(0, expectedActions.length))).toEqual( clearStoreActions(expectedActions) ) diff --git a/redisinsight/ui/src/components/consents-settings/ConsentsPrivacy/ConsentsPrivacy.tsx b/redisinsight/ui/src/components/consents-settings/ConsentsPrivacy/ConsentsPrivacy.tsx index 478fad8100..0cac9147e3 100644 --- a/redisinsight/ui/src/components/consents-settings/ConsentsPrivacy/ConsentsPrivacy.tsx +++ b/redisinsight/ui/src/components/consents-settings/ConsentsPrivacy/ConsentsPrivacy.tsx @@ -74,13 +74,8 @@ const ConsentsPrivacy = () => { return (
- - To optimize your experience, Redis Insight uses third-party tools. - All data collected is anonymized and will not be used for any purpose without your consent. - - -

Analytics

+

Telemetry

{ privacyConsents diff --git a/redisinsight/ui/src/components/oauth/shared/oauth-agreement/OAuthAgreement.tsx b/redisinsight/ui/src/components/oauth/shared/oauth-agreement/OAuthAgreement.tsx index b3ab83a692..f9bb2de1c9 100644 --- a/redisinsight/ui/src/components/oauth/shared/oauth-agreement/OAuthAgreement.tsx +++ b/redisinsight/ui/src/components/oauth/shared/oauth-agreement/OAuthAgreement.tsx @@ -7,6 +7,7 @@ import { localStorageService } from 'uiSrc/services' import { BrowserStorageItem } from 'uiSrc/constants' import { setAgreement, oauthCloudPAgreementSelector } from 'uiSrc/slices/oauth/cloud' +import { enableUserAnalyticsAction } from 'uiSrc/slices/user/user-settings' import styles from './styles.module.scss' export interface Props { @@ -20,6 +21,9 @@ const OAuthAgreement = (props: Props) => { const dispatch = useDispatch() const handleCheck = (e: ChangeEvent) => { + if (e.target.checked) { + dispatch(enableUserAnalyticsAction()) + } dispatch(setAgreement(e.target.checked)) localStorageService.set(BrowserStorageItem.OAuthAgreement, e.target.checked) } @@ -63,6 +67,9 @@ const OAuthAgreement = (props: Props) => {
  • that Redis Insight will generate Redis Cloud API account and user keys, and store them locally on your machine
  • +
  • + Analytics will be enabled to aggregate anonymized user data to improve user experience. You can disable it anytime on the Settings page. +
  • ) diff --git a/redisinsight/ui/src/components/oauth/shared/oauth-form/OAuthForm.tsx b/redisinsight/ui/src/components/oauth/shared/oauth-form/OAuthForm.tsx index 56e4ced603..d2ad50d5dc 100644 --- a/redisinsight/ui/src/components/oauth/shared/oauth-form/OAuthForm.tsx +++ b/redisinsight/ui/src/components/oauth/shared/oauth-form/OAuthForm.tsx @@ -4,6 +4,7 @@ import { signIn } from 'uiSrc/slices/oauth/cloud' import { OAuthSocialAction, OAuthStrategy } from 'uiSrc/slices/interfaces' import { ipcAuth } from 'uiSrc/electron/utils' import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry' +import { enableUserAnalyticsAction } from 'uiSrc/slices/user/user-settings' import OAuthSsoForm from './components/oauth-sso-form' import OAuthSocialButtons from '../oauth-social-buttons' import { Props as OAuthSocialButtonsProps } from '../oauth-social-buttons/OAuthSocialButtons' @@ -31,6 +32,7 @@ const OAuthForm = ({ } const onSocialButtonClick = (authStrategy: OAuthStrategy) => { + dispatch(enableUserAnalyticsAction()) setAuthStrategy(authStrategy) onClick?.(authStrategy) diff --git a/redisinsight/ui/src/slices/user/user-settings.ts b/redisinsight/ui/src/slices/user/user-settings.ts index f514c9784a..a58ef8257a 100644 --- a/redisinsight/ui/src/slices/user/user-settings.ts +++ b/redisinsight/ui/src/slices/user/user-settings.ts @@ -182,3 +182,14 @@ export function updateUserConfigSettingsAction( } } } + +export function enableUserAnalyticsAction() { + return async (dispatch: AppDispatch, stateInit: () => RootState) => { + const state = stateInit() + const agreements = state?.user?.settings?.config?.agreements + + if (agreements && !agreements.analytics) { + dispatch(updateUserConfigSettingsAction({ agreements: { ...agreements, analytics: true } })) + } + } +}