Skip to content

Commit 4afce19

Browse files
authored
feat: use monospace font for idp fields (coder#14672)
1 parent 705b9cc commit 4afce19

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

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

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
TableRowSkeleton,
2121
} from "components/TableLoader/TableLoader";
2222
import type { FC } from "react";
23+
import { MONOSPACE_FONT_FAMILY } from "theme/constants";
2324
import { docs } from "utils/docs";
2425

2526
export type IdpSyncPageViewProps = {
@@ -85,18 +86,16 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({ oidcConfig }) => {
8586
Object.entries(oidcConfig?.user_role_mapping).length === 0,
8687
)}
8788
>
88-
<>
89-
{oidcConfig?.user_role_mapping &&
90-
Object.entries(oidcConfig.user_role_mapping)
91-
.sort()
92-
.map(([idpRole, roles]) => (
93-
<RoleRow
94-
key={idpRole}
95-
idpRole={idpRole}
96-
coderRoles={roles}
97-
/>
98-
))}
99-
</>
89+
{oidcConfig?.user_role_mapping &&
90+
Object.entries(oidcConfig.user_role_mapping)
91+
.sort()
92+
.map(([idpRole, roles]) => (
93+
<RoleRow
94+
key={idpRole}
95+
idpRole={idpRole}
96+
coderRoles={roles}
97+
/>
98+
))}
10099
</IdpMappingTable>
101100
<IdpMappingTable
102101
type="Group"
@@ -105,18 +104,16 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({ oidcConfig }) => {
105104
Object.entries(oidcConfig?.group_mapping).length === 0,
106105
)}
107106
>
108-
<>
109-
{oidcConfig?.user_role_mapping &&
110-
Object.entries(oidcConfig.group_mapping)
111-
.sort()
112-
.map(([idpGroup, group]) => (
113-
<GroupRow
114-
key={idpGroup}
115-
idpGroup={idpGroup}
116-
coderGroup={group}
117-
/>
118-
))}
119-
</>
107+
{oidcConfig?.user_role_mapping &&
108+
Object.entries(oidcConfig.group_mapping)
109+
.sort()
110+
.map(([idpGroup, group]) => (
111+
<GroupRow
112+
key={idpGroup}
113+
idpGroup={idpGroup}
114+
coderGroup={group}
115+
/>
116+
))}
120117
</IdpMappingTable>
121118
</Stack>
122119
</Cond>
@@ -139,7 +136,7 @@ const IdpField: FC<IdpFieldProps> = ({
139136
return (
140137
<span css={{ display: "flex", alignItems: "center", gap: "16px" }}>
141138
<h4>{name}</h4>
142-
<p css={styles.secondary}>
139+
<p css={styles.field}>
143140
{fieldText ||
144141
(showStatusIndicator && (
145142
<div
@@ -225,7 +222,7 @@ const GroupRow: FC<GroupRowProps> = ({ idpGroup, coderGroup }) => {
225222
return (
226223
<TableRow data-testid={`group-${idpGroup}`}>
227224
<TableCell>{idpGroup}</TableCell>
228-
<TableCell css={styles.secondary}>{coderGroup}</TableCell>
225+
<TableCell>{coderGroup}</TableCell>
229226
</TableRow>
230227
);
231228
};
@@ -239,7 +236,7 @@ const RoleRow: FC<RoleRowProps> = ({ idpRole, coderRoles }) => {
239236
return (
240237
<TableRow data-testid={`role-${idpRole}`}>
241238
<TableCell>{idpRole}</TableCell>
242-
<TableCell css={styles.secondary}>coderRoles Placeholder</TableCell>
239+
<TableCell>coderRoles Placeholder</TableCell>
243240
</TableRow>
244241
);
245242
};
@@ -263,8 +260,9 @@ const TableLoader = () => {
263260
};
264261

265262
const styles = {
266-
secondary: (theme) => ({
263+
field: (theme) => ({
267264
color: theme.palette.text.secondary,
265+
fontFamily: MONOSPACE_FONT_FAMILY,
268266
}),
269267
fields: () => ({
270268
marginBottom: "60px",

0 commit comments

Comments
 (0)