-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web-analytics): Add a DB field cookieless_server_hash_mode to a …
…team, and setting to change it behind a flag (#27059) Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f55dca1
commit f203ab5
Showing
30 changed files
with
414 additions
and
7 deletions.
There are no files selected for viewing
Binary file modified
BIN
-1.6 KB
(99%)
...snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
frontend/src/scenes/settings/environment/CookielessServerHashMode.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { useActions, useValues } from 'kea' | ||
import { LemonButton } from 'lib/lemon-ui/LemonButton' | ||
import { LemonRadio, LemonRadioOption } from 'lib/lemon-ui/LemonRadio' | ||
import { useState } from 'react' | ||
import { teamLogic } from 'scenes/teamLogic' | ||
|
||
import { CookielessServerHashMode } from '~/types' | ||
|
||
const options: LemonRadioOption<CookielessServerHashMode>[] = [ | ||
{ | ||
value: CookielessServerHashMode.Stateful, | ||
label: ( | ||
<> | ||
<div>Stateful</div> | ||
</> | ||
), | ||
}, | ||
{ | ||
value: CookielessServerHashMode.Stateless, | ||
label: ( | ||
<> | ||
<div>Stateless</div> | ||
</> | ||
), | ||
}, | ||
{ | ||
value: CookielessServerHashMode.Disabled, | ||
label: ( | ||
<> | ||
<div>Disabled</div> | ||
</> | ||
), | ||
}, | ||
] | ||
|
||
export function CookielessServerHashModeSetting(): JSX.Element { | ||
const { updateCurrentTeam } = useActions(teamLogic) | ||
const { currentTeam } = useValues(teamLogic) | ||
|
||
const savedSetting = currentTeam?.cookieless_server_hash_mode ?? CookielessServerHashMode.Disabled | ||
const [setting, setSetting] = useState<CookielessServerHashMode>(savedSetting) | ||
|
||
const handleChange = (newSetting: CookielessServerHashMode): void => { | ||
updateCurrentTeam({ cookieless_server_hash_mode: newSetting }) | ||
} | ||
|
||
return ( | ||
<> | ||
<p> | ||
Use a cookieless server-side hash mode to hash user data. This is an experimental feature preview and | ||
may result in dropped events. | ||
</p> | ||
<LemonRadio value={setting} onChange={setSetting} options={options} /> | ||
<div className="mt-4"> | ||
<LemonButton | ||
type="primary" | ||
onClick={() => handleChange(setting)} | ||
disabledReason={setting === savedSetting ? 'No changes to save' : undefined} | ||
> | ||
Save | ||
</LemonButton> | ||
</div> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.