Skip to content

Commit 090dcd5

Browse files
authored
fix: correct globalheader switch-account URL. (#5300)
1 parent cb24d9a commit 090dcd5

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

src/identity/components/GlobalHeader/AccountDropdown.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1+
// Libraries
12
import React, {FC} from 'react'
23
import {IconFont} from '@influxdata/clockface'
3-
import {OrganizationSummaries, UserAccount} from 'src/client/unityRoutes'
4-
import {
5-
GlobalHeaderDropdown,
6-
TypeAheadMenuItem,
7-
} from 'src/identity/components/GlobalHeader/GlobalHeaderDropdown'
84

5+
// Types
96
type OrgSummaryItem = OrganizationSummaries[number]
7+
import {OrganizationSummaries, UserAccount} from 'src/client/unityRoutes'
108

119
interface Props {
1210
activeOrg: OrgSummaryItem
1311
activeAccount: UserAccount
1412
accountsList: UserAccount[]
1513
}
1614

15+
// Styles
1716
const style = {width: 'auto'}
1817
const menuStyle = {width: '250px'}
1918

19+
// Components
20+
import {
21+
GlobalHeaderDropdown,
22+
TypeAheadMenuItem,
23+
} from 'src/identity/components/GlobalHeader/GlobalHeaderDropdown'
24+
25+
// Constants
26+
import {CLOUD_URL} from 'src/shared/constants'
27+
2028
export const AccountDropdown: FC<Props> = ({
2129
activeOrg,
2230
activeAccount,
@@ -42,7 +50,7 @@ export const AccountDropdown: FC<Props> = ({
4250

4351
// Quartz handles switching accounts by having the user hit this URL.
4452
const switchAccount = (account: TypeAheadMenuItem) => {
45-
window.location.href = `orgs/${activeOrg.id}/accounts/${account.id}`
53+
window.location.href = `${CLOUD_URL}/accounts/${account.id}`
4654
}
4755

4856
return (

src/identity/components/GlobalHeader/OrgDropdown.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1+
// Libraries
12
import React, {FC} from 'react'
2-
import {OrganizationSummaries} from 'src/client/unityRoutes'
3+
import {IconFont} from '@influxdata/clockface'
4+
5+
// Components
36
import {
47
TypeAheadMenuItem,
58
GlobalHeaderDropdown,
69
} from 'src/identity/components/GlobalHeader/GlobalHeaderDropdown'
7-
import {IconFont} from '@influxdata/clockface'
10+
11+
// Types
12+
import {OrganizationSummaries} from 'src/client/unityRoutes'
13+
14+
// Constants
15+
import {CLOUD_URL} from 'src/shared/constants'
816

917
const switchOrg = (org: TypeAheadMenuItem) => {
10-
window.location.href = `/orgs/${org.id}`
18+
window.location.href = `${CLOUD_URL}/orgs/${org.id}`
1119
}
1220

1321
type OrgSummaryItem = OrganizationSummaries[number]

0 commit comments

Comments
 (0)