feat: enable telemetry toggle button

This commit is contained in:
liyasthomas
2021-07-07 06:30:49 +05:30
parent 7b3dd697bb
commit 20d38e247b
5 changed files with 22 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ type SettingsCustomDimensions = {
syncHistory: boolean
usesBg: HoppBgColor
usesAccent: HoppAccentColor
usesTelemetry: boolean
}
type HoppRequestEvent =
@@ -54,6 +55,7 @@ function initSettingsListeners() {
syncHistory: settings.syncHistory,
usesAccent: settings.THEME_COLOR,
usesBg: settings.BG_COLOR,
usesTelemetry: settings.TELEMETRY_ENABLED,
}
analytics.setUserProperties(conf)

View File

@@ -339,5 +339,6 @@
"hide_sidebar": "Hide sidebar",
"show_sidebar": "Show sidebar",
"protocols": "Protocols",
"protocol_count": "protocol {count}"
"protocol_count": "protocol {count}",
"telemetry": "Telemetry"
}

View File

@@ -41,6 +41,7 @@ export type SettingsType = {
}
THEME_COLOR: HoppAccentColor
BG_COLOR: HoppBgColor
TELEMETRY_ENABLED: boolean
}
export const defaultSettings: SettingsType = {
@@ -62,6 +63,7 @@ export const defaultSettings: SettingsType = {
},
THEME_COLOR: "green",
BG_COLOR: "system",
TELEMETRY_ENABLED: true,
}
const validKeys = Object.keys(defaultSettings)

View File

@@ -199,6 +199,15 @@
{{ $t("use_experimental_url_bar") }}
</SmartToggle>
</div>
<span>
<SmartToggle
:on="TELEMETRY_ENABLED"
@change="toggleSetting('TELEMETRY_ENABLED')"
>
{{ $t("telemetry") }}
{{ TELEMETRY_ENABLED ? $t("enabled") : $t("disabled") }}
</SmartToggle>
</span>
</div>
</AppSection>
<FirebaseEmail :show="showEmail" @hide-modal="showEmail = false" />
@@ -263,6 +272,8 @@ export default Vue.extend({
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments"),
SYNC_HISTORY: getSettingSubject("syncHistory"),
TELEMETRY_ENABLED: getSettingSubject("TELEMETRY_ENABLED"),
// Teams feature flag
currentBackendUser: currentUserInfo$,
currentUser: currentUser$,

View File

@@ -34,6 +34,11 @@ export const SETTINGS_KEYS = [
*/
"EXTENSIONS_ENABLED",
/**
* A boolean value indicating whether Telemetry is enabled.
*/
"TELEMETRY_ENABLED",
/**
* A boolean value indicating whether to use the URL bar experiments
*/