1
- import type { AuthorizationResponse , Organization } from "api/typesGenerated" ;
2
1
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge" ;
3
2
import {
4
3
Sidebar as BaseSidebar ,
5
4
SettingsSidebarNavItem as SidebarNavItem ,
6
5
} from "components/Sidebar/Sidebar" ;
6
+ import { Stack } from "components/Stack/Stack" ;
7
7
import type { Permissions } from "contexts/auth/permissions" ;
8
- import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility " ;
8
+ import { ArrowUpRight } from "lucide-react " ;
9
9
import type { FC } from "react" ;
10
10
11
- export interface OrganizationWithPermissions extends Organization {
12
- permissions : AuthorizationResponse ;
13
- }
14
-
15
- interface DeploymentSidebarProps {
16
- /** Site-wide permissions. */
17
- permissions : Permissions ;
18
- }
19
-
20
- /**
21
- * A combined deployment settings and organization menu.
22
- */
23
- export const DeploymentSidebarView : FC < DeploymentSidebarProps > = ( {
24
- permissions,
25
- } ) => {
26
- const { multiple_organizations : hasPremiumLicense } = useFeatureVisibility ( ) ;
27
-
28
- return (
29
- < BaseSidebar >
30
- < DeploymentSettingsNavigation
31
- permissions = { permissions }
32
- isPremium = { hasPremiumLicense }
33
- />
34
- </ BaseSidebar >
35
- ) ;
36
- } ;
37
-
38
- interface DeploymentSettingsNavigationProps {
11
+ interface DeploymentSidebarViewProps {
39
12
/** Site-wide permissions. */
40
13
permissions : Permissions ;
41
- isPremium : boolean ;
14
+ showOrganizations : boolean ;
15
+ hasPremiumLicense : boolean ;
42
16
}
43
17
44
18
/**
@@ -48,12 +22,13 @@ interface DeploymentSettingsNavigationProps {
48
22
* Menu items are shown based on the permissions. If organizations can be
49
23
* viewed, groups are skipped since they will show under each org instead.
50
24
*/
51
- const DeploymentSettingsNavigation : FC < DeploymentSettingsNavigationProps > = ( {
25
+ export const DeploymentSidebarView : FC < DeploymentSidebarViewProps > = ( {
52
26
permissions,
53
- isPremium,
27
+ showOrganizations,
28
+ hasPremiumLicense,
54
29
} ) => {
55
30
return (
56
- < div >
31
+ < BaseSidebar >
57
32
< div className = "flex flex-col gap-1" >
58
33
{ permissions . viewDeploymentValues && (
59
34
< SidebarNavItem href = "/deployment/general" > General</ SidebarNavItem >
@@ -100,7 +75,11 @@ const DeploymentSettingsNavigation: FC<DeploymentSettingsNavigationProps> = ({
100
75
< SidebarNavItem href = "/deployment/users" > Users</ SidebarNavItem >
101
76
) }
102
77
{ permissions . viewAnyGroup && (
103
- < SidebarNavItem href = "/deployment/groups" > Groups</ SidebarNavItem >
78
+ < SidebarNavItem href = "/deployment/groups" >
79
+ < Stack direction = "row" alignItems = "center" spacing = { 0.5 } >
80
+ Groups { showOrganizations && < ArrowUpRight size = { 16 } /> }
81
+ </ Stack >
82
+ </ SidebarNavItem >
104
83
) }
105
84
{ permissions . viewNotificationTemplate && (
106
85
< SidebarNavItem href = "/deployment/notifications" >
@@ -115,10 +94,10 @@ const DeploymentSettingsNavigation: FC<DeploymentSettingsNavigationProps> = ({
115
94
IdP Organization Sync
116
95
</ SidebarNavItem >
117
96
) }
118
- { ! isPremium && (
97
+ { ! hasPremiumLicense && (
119
98
< SidebarNavItem href = "/deployment/premium" > Premium</ SidebarNavItem >
120
99
) }
121
100
</ div >
122
- </ div >
101
+ </ BaseSidebar >
123
102
) ;
124
103
} ;
0 commit comments