Skip to content

Commit 3d1fcdb

Browse files
committed
fix: updates for PR review comments
1 parent 1eedda8 commit 3d1fcdb

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

site/src/pages/ManagementSettingsPage/IdpSyncPage/IdpSyncPageView.tsx

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,17 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({ oidcConfig }) => {
5454
<h4>Sync Field</h4>
5555
<p css={styles.secondary}>
5656
{groups_field || (
57-
<Stack
58-
style={{ color: theme.palette.text.secondary }}
59-
direction="row"
60-
spacing={1}
61-
alignItems="center"
57+
<div
58+
css={{
59+
display: "flex",
60+
alignItems: "center",
61+
gap: "8px",
62+
height: 0,
63+
}}
6264
>
6365
<StatusIndicator color="error" />
6466
<p>disabled</p>
65-
</Stack>
67+
</div>
6668
)}
6769
</p>
6870
<h4>Regex Filter</h4>
@@ -77,15 +79,17 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({ oidcConfig }) => {
7779
<h4>Sync Field</h4>
7880
<p css={styles.secondary}>
7981
{user_role_field || (
80-
<Stack
81-
style={{ color: theme.palette.text.secondary }}
82-
direction="row"
83-
spacing={1}
84-
alignItems="center"
82+
<div
83+
css={{
84+
display: "flex",
85+
alignItems: "center",
86+
gap: "8px",
87+
height: 0,
88+
}}
8589
>
8690
<StatusIndicator color="error" />
8791
<p>disabled</p>
88-
</Stack>
92+
</div>
8993
)}
9094
</p>
9195
</Stack>
@@ -96,45 +100,40 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({ oidcConfig }) => {
96100
type="Role"
97101
isEmpty={Boolean(
98102
!oidcConfig?.user_role_mapping ||
99-
(oidcConfig?.user_role_mapping &&
100-
Object.entries(oidcConfig?.user_role_mapping).length ===
101-
0) ||
102-
false,
103+
Object.entries(oidcConfig?.user_role_mapping).length === 0,
103104
)}
104105
>
105106
<>
106107
{oidcConfig?.user_role_mapping &&
107-
Object.entries(oidcConfig.user_role_mapping).map(
108-
([idpRole, roles]) => (
108+
Object.entries(oidcConfig.user_role_mapping)
109+
.sort()
110+
.map(([idpRole, roles]) => (
109111
<RoleRow
110112
key={idpRole}
111113
idpRole={idpRole}
112114
coderRoles={roles}
113115
/>
114-
),
115-
)}
116+
))}
116117
</>
117118
</IdpMappingTable>
118119
<IdpMappingTable
119120
type="Group"
120121
isEmpty={Boolean(
121122
!oidcConfig?.group_mapping ||
122-
(oidcConfig?.group_mapping &&
123-
Object.entries(oidcConfig?.group_mapping).length === 0) ||
124-
false,
123+
Object.entries(oidcConfig?.group_mapping).length === 0,
125124
)}
126125
>
127126
<>
128127
{oidcConfig?.user_role_mapping &&
129-
Object.entries(oidcConfig.group_mapping).map(
130-
([idpGroup, group]) => (
128+
Object.entries(oidcConfig.group_mapping)
129+
.sort()
130+
.map(([idpGroup, group]) => (
131131
<GroupRow
132132
key={idpGroup}
133133
idpGroup={idpGroup}
134134
coderGroup={group}
135135
/>
136-
),
137-
)}
136+
))}
138137
</>
139138
</IdpMappingTable>
140139
</Stack>

0 commit comments

Comments
 (0)