Skip to content

feat: use monospace font for idp fields #14672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
TableRowSkeleton,
} from "components/TableLoader/TableLoader";
import type { FC } from "react";
import { MONOSPACE_FONT_FAMILY } from "theme/constants";
import { docs } from "utils/docs";

export type IdpSyncPageViewProps = {
Expand Down Expand Up @@ -85,18 +86,16 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({ oidcConfig }) => {
Object.entries(oidcConfig?.user_role_mapping).length === 0,
)}
>
<>
{oidcConfig?.user_role_mapping &&
Object.entries(oidcConfig.user_role_mapping)
.sort()
.map(([idpRole, roles]) => (
<RoleRow
key={idpRole}
idpRole={idpRole}
coderRoles={roles}
/>
))}
</>
{oidcConfig?.user_role_mapping &&
Object.entries(oidcConfig.user_role_mapping)
.sort()
.map(([idpRole, roles]) => (
<RoleRow
key={idpRole}
idpRole={idpRole}
coderRoles={roles}
/>
))}
</IdpMappingTable>
<IdpMappingTable
type="Group"
Expand All @@ -105,18 +104,16 @@ export const IdpSyncPageView: FC<IdpSyncPageViewProps> = ({ oidcConfig }) => {
Object.entries(oidcConfig?.group_mapping).length === 0,
)}
>
<>
{oidcConfig?.user_role_mapping &&
Object.entries(oidcConfig.group_mapping)
.sort()
.map(([idpGroup, group]) => (
<GroupRow
key={idpGroup}
idpGroup={idpGroup}
coderGroup={group}
/>
))}
</>
{oidcConfig?.user_role_mapping &&
Object.entries(oidcConfig.group_mapping)
.sort()
.map(([idpGroup, group]) => (
<GroupRow
key={idpGroup}
idpGroup={idpGroup}
coderGroup={group}
/>
))}
</IdpMappingTable>
</Stack>
</Cond>
Expand All @@ -139,7 +136,7 @@ const IdpField: FC<IdpFieldProps> = ({
return (
<span css={{ display: "flex", alignItems: "center", gap: "16px" }}>
<h4>{name}</h4>
<p css={styles.secondary}>
<p css={styles.field}>
{fieldText ||
(showStatusIndicator && (
<div
Expand Down Expand Up @@ -225,7 +222,7 @@ const GroupRow: FC<GroupRowProps> = ({ idpGroup, coderGroup }) => {
return (
<TableRow data-testid={`group-${idpGroup}`}>
<TableCell>{idpGroup}</TableCell>
<TableCell css={styles.secondary}>{coderGroup}</TableCell>
<TableCell>{coderGroup}</TableCell>
</TableRow>
);
};
Expand All @@ -239,7 +236,7 @@ const RoleRow: FC<RoleRowProps> = ({ idpRole, coderRoles }) => {
return (
<TableRow data-testid={`role-${idpRole}`}>
<TableCell>{idpRole}</TableCell>
<TableCell css={styles.secondary}>coderRoles Placeholder</TableCell>
<TableCell>coderRoles Placeholder</TableCell>
</TableRow>
);
};
Expand All @@ -263,8 +260,9 @@ const TableLoader = () => {
};

const styles = {
secondary: (theme) => ({
field: (theme) => ({
color: theme.palette.text.secondary,
fontFamily: MONOSPACE_FONT_FAMILY,
}),
fields: () => ({
marginBottom: "60px",
Expand Down
Loading