Skip to content

Commit

Permalink
feat: Show the currently used region in the settings page (#19780)
Browse files Browse the repository at this point in the history
* show the currently used region in the settings page

* Update frontend/src/scenes/settings/project/ProjectSettings.tsx

Co-authored-by: Ben White <[email protected]>

* use region property instead of site_url

* simplify code

* Update frontend/src/scenes/settings/project/ProjectSettings.tsx

Co-authored-by: Ben White <[email protected]>

* adjust tag id

---------

Co-authored-by: Ben White <[email protected]>
  • Loading branch information
MarconLP and benjackwhite authored Jan 16, 2024
1 parent 9346ae9 commit f9d1ff0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions frontend/src/scenes/settings/project/ProjectSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { JSSnippet } from 'lib/components/JSSnippet'
import { IconRefresh } from 'lib/lemon-ui/icons'
import { Link } from 'lib/lemon-ui/Link'
import { useState } from 'react'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { isAuthenticatedTeam, teamLogic } from 'scenes/teamLogic'

import { TimezoneConfig } from './TimezoneConfig'
Expand Down Expand Up @@ -88,6 +89,8 @@ export function Bookmarklet(): JSX.Element {
export function ProjectVariables(): JSX.Element {
const { currentTeam, isTeamTokenResetAvailable } = useValues(teamLogic)
const { resetToken } = useActions(teamLogic)
const { preflight } = useValues(preflightLogic)
const region = preflight?.region

return (
<div className="flex items-start gap-4 flex-wrap">
Expand Down Expand Up @@ -141,6 +144,15 @@ export function ProjectVariables(): JSX.Element {
</p>
<CodeSnippet thing="project ID">{String(currentTeam?.id || '')}</CodeSnippet>
</div>
{region ? (
<div className="flex-1">
<h3 id="project-region" className="min-w-[25rem]">
Project Region
</h3>
<p>This is the region where your PostHog data is hosted.</p>
<CodeSnippet thing="project region">{`${region} Cloud`}</CodeSnippet>
</div>
) : null}
</div>
)
}
Expand Down

0 comments on commit f9d1ff0

Please sign in to comment.