Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion src/authz-module/audit-user/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,9 @@ const AuditUserPage = () => {
<AddRoleButton presetUsername={user?.username} key="add-role-button" />,
]
}
showDivider
>
<div className="page-band py-5">
<div className="page-band py-3">
<DataTable
Comment thread
jacobo-dominguez-wgu marked this conversation as resolved.
isPaginated
isFilterable
Expand Down
12 changes: 12 additions & 0 deletions src/authz-module/components/AuthZTitle.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,16 @@ describe('AuthZTitle', () => {
expect(screen.getByRole('button', { name: 'Save' })).toBeInTheDocument();
expect(screen.getByRole('region', { name: 'custom action area' })).toBeInTheDocument();
});

it('does not render the bottom border by default', () => {
render(<AuthZTitle {...defaultProps} />);
const band = screen.getByRole('heading', { level: 2 }).closest('.page-band');
expect(band).not.toHaveClass('title-border-bottom');
});

it('renders the bottom border when borderBottom is true', () => {
render(<AuthZTitle {...defaultProps} showDivider />);
const band = screen.getByRole('heading', { level: 2 }).closest('.page-band');
expect(band).toHaveClass('title-border-bottom');
});
});
5 changes: 3 additions & 2 deletions src/authz-module/components/AuthZTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface AuthZTitleProps {
pageSubtitle?: string | ReactNode;
navLinks?: BreadcrumbLink[];
actions?: (Action | ReactNode)[];
showDivider?: boolean;
}

export const ActionButton = ({ label, icon, onClick }: Action) => (
Expand All @@ -39,12 +40,12 @@ export const ActionButton = ({ label, icon, onClick }: Action) => (
);

const AuthZTitle = ({
activeLabel, navLinks = [], pageTitle, pageSubtitle, actions = [],
activeLabel, navLinks = [], pageTitle, pageSubtitle, actions = [], showDivider = false,
}: AuthZTitleProps) => {
const shouldRenderBreadcrumb = activeLabel || navLinks?.length > 0;
const isDesktop = useMediaQuery({ minWidth: breakpoints.large.minWidth });
return (
<div className="page-band py-4 bg-light-100">
<div className={`page-band py-4 bg-light-100${showDivider ? ' title-border-bottom' : ''}`}>
{ shouldRenderBreadcrumb
&& (
<Breadcrumb
Expand Down
16 changes: 16 additions & 0 deletions src/authz-module/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
.authz-module {
--height-action-divider: 30px;

// Paragon scrolls the layout wrapper ≤1400px, which clips the table's box-shadow;
// the inner .pgn__data-table-container already handles horizontal scroll.
.pgn__data-table-layout-wrapper {
overflow-x: visible;

// A flex item won't shrink below its content by default, so without this the main
// column grows to the table's width and the inner container never gets to scroll.
.pgn__data-table-layout-main {
min-width: 0;
}
}

.title-border-bottom {
border-bottom: var(--pgn-size-nav-tabs-border-width) solid var(--pgn-color-nav-tabs-base-border-base);
}

.filters .dropdown-toggle::after {
display: none !important;
}
Expand Down
Loading