Skip to content
Merged
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
2 changes: 1 addition & 1 deletion packages/module/src/ErrorBoundary/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ErrorState from '../ErrorState';
import ErrorStack from '../ErrorStack';

export interface ErrorPageProps {
/** The title to display on the error page */
/** Title to display on the error page */
headerTitle: string;
/** Indicates if this is a silent error */
silent?: boolean;
Expand Down
11 changes: 8 additions & 3 deletions packages/module/src/ErrorStack/ErrorStack.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import * as React from 'react';
import clsx from 'clsx';
import { Text } from '@patternfly/react-core';
import { createUseStyles } from 'react-jss';

export interface ErrorStackProps {
/** Error object to be displayed in the stack */
error: Error;
/** Custom className */
className?: string;
}

const useStyles = createUseStyles({
Expand All @@ -19,11 +23,12 @@ const useStyles = createUseStyles({
},
})

export const ErrorStack: React.FunctionComponent<ErrorStackProps> = ({ error }) => {
export const ErrorStack: React.FunctionComponent<ErrorStackProps> = ({ error, className, ...props }) => {
const classes = useStyles();

if (error.stack) {
return (
<Text className={classes.errorStack}>
<Text className={clsx(classes.errorStack, className)} {...props} >
{error.stack.split('\n').map((line) => (
<div key={line}>{line}</div>
))}
Expand All @@ -35,7 +40,7 @@ export const ErrorStack: React.FunctionComponent<ErrorStackProps> = ({ error })
return (
<>
<Text component="h6">{error.name}</Text>
<Text className={classes.errorStack} component="blockquote">
<Text className={clsx(classes.errorStack, className)} component="blockquote" {...props}>
{error.message}
</Text>
</>
Expand Down
2 changes: 1 addition & 1 deletion packages/module/src/NotAuthorized/NotAuthorized.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface NotAuthorizedProps extends Omit<EmptyStateProps, 'children' | '
className?: string;
/** Custom title */
title?: React.ReactNode;
/** Custom primary action there should only be one primary action*/
/** Custom primary action - there should only be one defined */
primaryAction?: React.ReactNode;
/** Custom secondary actions */
secondaryActions?: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion packages/module/src/SkeletonTable/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default } from './SkeletonTable';
export { default as SkeletonTable } from './SkeletonTable';
export * from './SkeletonTable';
5 changes: 4 additions & 1 deletion packages/module/src/TagCount/TagCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ export interface TagCountProps extends ButtonProps {
count?: number;
/** Additional classes added to the tag count component */
className?: string;
/** Icon size */
iconSize?: 'sm' | 'md' | 'lg' | 'xl';
}

const TagCount: React.FunctionComponent<TagCountProps> = (
{ count,
className,
iconSize= 'md',
...props }: TagCountProps) => {
const classes = useStyles();
const tagClasses = clsx(classes.buttonTagCount, className);
return (
<Button aria-label="Tag count" {...props} variant="plain" isDisabled={!count} className={tagClasses}>
<Icon size="md">
<Icon iconSize={iconSize} >
<TagIcon/>
</Icon>
<span className={classes.tagText}>{count}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ exports[`TagCount component should render a disabled tag count with no value 1`]
type="button"
>
<span
class="pf-v5-c-icon pf-m-md"
class="pf-v5-c-icon"
>
<span
class="pf-v5-c-icon__content"
class="pf-v5-c-icon__content pf-m-md"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -54,10 +54,10 @@ exports[`TagCount component should render a disabled tag count with no value 1`]
type="button"
>
<span
class="pf-v5-c-icon pf-m-md"
class="pf-v5-c-icon"
>
<span
class="pf-v5-c-icon__content"
class="pf-v5-c-icon__content pf-m-md"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -148,10 +148,10 @@ exports[`TagCount component should render a tag count of 11 1`] = `
type="button"
>
<span
class="pf-v5-c-icon pf-m-md"
class="pf-v5-c-icon"
>
<span
class="pf-v5-c-icon__content"
class="pf-v5-c-icon__content pf-m-md"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -187,10 +187,10 @@ exports[`TagCount component should render a tag count of 11 1`] = `
type="button"
>
<span
class="pf-v5-c-icon pf-m-md"
class="pf-v5-c-icon"
>
<span
class="pf-v5-c-icon__content"
class="pf-v5-c-icon__content pf-m-md"
>
<svg
aria-hidden="true"
Expand Down