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
6 changes: 3 additions & 3 deletions redisinsight/api/src/constants/agreements-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion redisinsight/ui/src/components/config/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const Config = () => {
if (cloudSsoFeature?.flag) {
dispatch(fetchProfile())
}
}, [cloudSsoFeature])
}, [cloudSsoFeature?.flag])

useEffect(() => {
featuresHighlight()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,8 @@ const ConsentsPrivacy = () => {
return (
<EuiForm component="form" onSubmit={formik.handleSubmit} data-testid="consents-settings-form">
<div className={styles.consentsWrapper}>
<EuiText size="s" className={styles.smallText} color="subdued">
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.
</EuiText>
<EuiSpacer size="l" />
<EuiTitle size="xs">
<h4>Analytics</h4>
<h4>Telemetry</h4>
</EuiTitle>
{
privacyConsents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -20,6 +21,9 @@ const OAuthAgreement = (props: Props) => {
const dispatch = useDispatch()

const handleCheck = (e: ChangeEvent<HTMLInputElement>) => {
if (e.target.checked) {
dispatch(enableUserAnalyticsAction())
}
dispatch(setAgreement(e.target.checked))
localStorageService.set(BrowserStorageItem.OAuthAgreement, e.target.checked)
}
Expand Down Expand Up @@ -63,6 +67,9 @@ const OAuthAgreement = (props: Props) => {
<li className={styles.listItem}>
that Redis Insight will generate Redis Cloud API account and user keys, and store them locally on your machine
</li>
<li className={styles.listItem}>
Analytics will be enabled to aggregate anonymized user data to improve user experience. You can disable it anytime on the Settings page.
</li>
</ul>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -31,6 +32,7 @@ const OAuthForm = ({
}

const onSocialButtonClick = (authStrategy: OAuthStrategy) => {
dispatch(enableUserAnalyticsAction())
setAuthStrategy(authStrategy)
onClick?.(authStrategy)

Expand Down
11 changes: 11 additions & 0 deletions redisinsight/ui/src/slices/user/user-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }))
}
}
}
Loading