1
- import LaunchOutlined from "@mui/icons-material/LaunchOutlined" ;
2
- import Button from "@mui/material/Button" ;
3
1
import { groupsByOrganization } from "api/queries/groups" ;
4
- import { organizationRoles } from "api/queries/roles" ;
5
2
import {
6
3
groupIdpSyncSettings ,
7
4
roleIdpSyncSettings ,
8
5
} from "api/queries/organizations" ;
6
+ import { organizationRoles } from "api/queries/roles" ;
9
7
import { ChooseOne , Cond } from "components/Conditionals/ChooseOne" ;
10
8
import { EmptyState } from "components/EmptyState/EmptyState" ;
11
9
import { Paywall } from "components/Paywall/Paywall" ;
12
- import { SettingsHeader } from "components/SettingsHeader/SettingsHeader " ;
10
+ import { SquareArrowOutUpRight } from "lucide-react " ;
13
11
import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility" ;
14
12
import { useOrganizationSettings } from "modules/management/OrganizationSettingsLayout" ;
15
13
import type { FC } from "react" ;
@@ -18,7 +16,6 @@ import { useQueries } from "react-query";
18
16
import { useParams } from "react-router-dom" ;
19
17
import { docs } from "utils/docs" ;
20
18
import { pageTitle } from "utils/page" ;
21
- import { IdpSyncHelpTooltip } from "./IdpSyncHelpTooltip" ;
22
19
import IdpSyncPageView from "./IdpSyncPageView" ;
23
20
24
21
export const IdpSyncPage : FC = ( ) => {
@@ -30,15 +27,19 @@ export const IdpSyncPage: FC = () => {
30
27
const { organizations } = useOrganizationSettings ( ) ;
31
28
const organization = organizations ?. find ( ( o ) => o . name === organizationName ) ;
32
29
33
- const [ groupIdpSyncSettingsQuery , roleIdpSyncSettingsQuery , groupsQuery , rolesQuery ] =
34
- useQueries ( {
35
- queries : [
36
- groupIdpSyncSettings ( organizationName ) ,
37
- roleIdpSyncSettings ( organizationName ) ,
38
- groupsByOrganization ( organizationName ) ,
39
- organizationRoles ( organizationName ) ,
40
- ] ,
41
- } ) ;
30
+ const [
31
+ groupIdpSyncSettingsQuery ,
32
+ roleIdpSyncSettingsQuery ,
33
+ groupsQuery ,
34
+ rolesQuery ,
35
+ ] = useQueries ( {
36
+ queries : [
37
+ groupIdpSyncSettings ( organizationName ) ,
38
+ roleIdpSyncSettings ( organizationName ) ,
39
+ groupsByOrganization ( organizationName ) ,
40
+ organizationRoles ( organizationName ) ,
41
+ ] ,
42
+ } ) ;
42
43
43
44
if ( ! organization ) {
44
45
return < EmptyState message = "Organization not found" /> ;
@@ -62,42 +63,45 @@ export const IdpSyncPage: FC = () => {
62
63
< title > { pageTitle ( "IdP Sync" ) } </ title >
63
64
</ Helmet >
64
65
65
- < div className = "flex items-baseline justify-between"
66
- >
67
- < SettingsHeader
68
- title = "IdP Sync"
69
- description = "Group and role sync mappings (configured using Coder CLI)."
70
- tooltip = { < IdpSyncHelpTooltip /> }
71
- />
72
- < Button
73
- startIcon = { < LaunchOutlined /> }
74
- component = "a"
75
- href = { docs ( "/admin/users/idp-sync" ) }
76
- target = "_blank"
77
- >
78
- Setup IdP Sync
79
- </ Button >
66
+ < div className = "flex flex-col gap-12" >
67
+ < header className = "flex flex-row items-baseline justify-between" >
68
+ < div className = "flex flex-col gap-2" >
69
+ < h1 className = "text-3xl m-0" > IdP Sync</ h1 >
70
+ < p className = "flex flex-row gap-1 text-sm text-content-secondary font-medium m-0" >
71
+ Automatically assign groups or roles to a user based on their IdP
72
+ claims.
73
+ < a
74
+ href = { docs ( "/admin/users/idp-sync" ) }
75
+ className = "flex flex-row text-content-link items-center gap-1 no-underline hover:underline visited:text-content-link"
76
+ >
77
+ View docs
78
+ < SquareArrowOutUpRight size = { 14 } />
79
+ </ a >
80
+ </ p >
81
+ </ div >
82
+ { /* <ExportPolicyButton syncSettings={orgSyncSettingsData} /> */ }
83
+ </ header >
84
+ < ChooseOne >
85
+ < Cond condition = { ! isIdpSyncEnabled } >
86
+ < Paywall
87
+ message = "IdP Sync"
88
+ description = "Configure group and role mappings to manage permissions outside of Coder. You need an Premium license to use this feature."
89
+ documentationLink = { docs ( "/admin/users/idp-sync" ) }
90
+ />
91
+ </ Cond >
92
+ < Cond >
93
+ < IdpSyncPageView
94
+ groupSyncSettings = { groupIdpSyncSettingsQuery . data }
95
+ roleSyncSettings = { roleIdpSyncSettingsQuery . data }
96
+ groups = { groupsQuery . data }
97
+ groupsMap = { groupsMap }
98
+ roles = { rolesQuery . data }
99
+ organization = { organization }
100
+ error = { error }
101
+ />
102
+ </ Cond >
103
+ </ ChooseOne >
80
104
</ div >
81
- < ChooseOne >
82
- < Cond condition = { ! isIdpSyncEnabled } >
83
- < Paywall
84
- message = "IdP Sync"
85
- description = "Configure group and role mappings to manage permissions outside of Coder. You need an Premium license to use this feature."
86
- documentationLink = { docs ( "/admin/users/idp-sync" ) }
87
- />
88
- </ Cond >
89
- < Cond >
90
- < IdpSyncPageView
91
- groupSyncSettings = { groupIdpSyncSettingsQuery . data }
92
- roleSyncSettings = { roleIdpSyncSettingsQuery . data }
93
- groups = { groupsQuery . data }
94
- groupsMap = { groupsMap }
95
- roles = { rolesQuery . data }
96
- organization = { organization }
97
- error = { error }
98
- />
99
- </ Cond >
100
- </ ChooseOne >
101
105
</ >
102
106
) ;
103
107
} ;
0 commit comments