Skip to content

Commit 7d45799

Browse files
authored
Merge pull request #77 from fhlavac/reexport
Minor fixes and enhancements for FEC compatibility
2 parents 109ad24 + a5f6872 commit 7d45799

6 files changed

Lines changed: 23 additions & 15 deletions

File tree

packages/module/src/ErrorBoundary/ErrorBoundary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import ErrorState from '../ErrorState';
44
import ErrorStack from '../ErrorStack';
55

66
export interface ErrorPageProps {
7-
/** The title to display on the error page */
7+
/** Title to display on the error page */
88
headerTitle: string;
99
/** Indicates if this is a silent error */
1010
silent?: boolean;

packages/module/src/ErrorStack/ErrorStack.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import * as React from 'react';
2+
import clsx from 'clsx';
23
import { Text } from '@patternfly/react-core';
34
import { createUseStyles } from 'react-jss';
45

56
export interface ErrorStackProps {
7+
/** Error object to be displayed in the stack */
68
error: Error;
9+
/** Custom className */
10+
className?: string;
711
}
812

913
const useStyles = createUseStyles({
@@ -19,11 +23,12 @@ const useStyles = createUseStyles({
1923
},
2024
})
2125

22-
export const ErrorStack: React.FunctionComponent<ErrorStackProps> = ({ error }) => {
26+
export const ErrorStack: React.FunctionComponent<ErrorStackProps> = ({ error, className, ...props }) => {
2327
const classes = useStyles();
28+
2429
if (error.stack) {
2530
return (
26-
<Text className={classes.errorStack}>
31+
<Text className={clsx(classes.errorStack, className)} {...props} >
2732
{error.stack.split('\n').map((line) => (
2833
<div key={line}>{line}</div>
2934
))}
@@ -35,7 +40,7 @@ export const ErrorStack: React.FunctionComponent<ErrorStackProps> = ({ error })
3540
return (
3641
<>
3742
<Text component="h6">{error.name}</Text>
38-
<Text className={classes.errorStack} component="blockquote">
43+
<Text className={clsx(classes.errorStack, className)} component="blockquote" {...props}>
3944
{error.message}
4045
</Text>
4146
</>

packages/module/src/NotAuthorized/NotAuthorized.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface NotAuthorizedProps extends Omit<EmptyStateProps, 'children' | '
1717
className?: string;
1818
/** Custom title */
1919
title?: React.ReactNode;
20-
/** Custom primary action there should only be one primary action*/
20+
/** Custom primary action - there should only be one defined */
2121
primaryAction?: React.ReactNode;
2222
/** Custom secondary actions */
2323
secondaryActions?: React.ReactNode;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export { default } from './SkeletonTable';
2-
export { default as SkeletonTable } from './SkeletonTable';
2+
export * from './SkeletonTable';

packages/module/src/TagCount/TagCount.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,20 @@ export interface TagCountProps extends ButtonProps {
2121
count?: number;
2222
/** Additional classes added to the tag count component */
2323
className?: string;
24+
/** Icon size */
25+
iconSize?: 'sm' | 'md' | 'lg' | 'xl';
2426
}
2527

2628
const TagCount: React.FunctionComponent<TagCountProps> = (
2729
{ count,
2830
className,
31+
iconSize= 'md',
2932
...props }: TagCountProps) => {
3033
const classes = useStyles();
3134
const tagClasses = clsx(classes.buttonTagCount, className);
3235
return (
3336
<Button aria-label="Tag count" {...props} variant="plain" isDisabled={!count} className={tagClasses}>
34-
<Icon size="md">
37+
<Icon iconSize={iconSize} >
3538
<TagIcon/>
3639
</Icon>
3740
<span className={classes.tagText}>{count}</span>

packages/module/src/TagCount/__snapshots__/TagCount.test.tsx.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ exports[`TagCount component should render a disabled tag count with no value 1`]
1616
type="button"
1717
>
1818
<span
19-
class="pf-v5-c-icon pf-m-md"
19+
class="pf-v5-c-icon"
2020
>
2121
<span
22-
class="pf-v5-c-icon__content"
22+
class="pf-v5-c-icon__content pf-m-md"
2323
>
2424
<svg
2525
aria-hidden="true"
@@ -54,10 +54,10 @@ exports[`TagCount component should render a disabled tag count with no value 1`]
5454
type="button"
5555
>
5656
<span
57-
class="pf-v5-c-icon pf-m-md"
57+
class="pf-v5-c-icon"
5858
>
5959
<span
60-
class="pf-v5-c-icon__content"
60+
class="pf-v5-c-icon__content pf-m-md"
6161
>
6262
<svg
6363
aria-hidden="true"
@@ -148,10 +148,10 @@ exports[`TagCount component should render a tag count of 11 1`] = `
148148
type="button"
149149
>
150150
<span
151-
class="pf-v5-c-icon pf-m-md"
151+
class="pf-v5-c-icon"
152152
>
153153
<span
154-
class="pf-v5-c-icon__content"
154+
class="pf-v5-c-icon__content pf-m-md"
155155
>
156156
<svg
157157
aria-hidden="true"
@@ -187,10 +187,10 @@ exports[`TagCount component should render a tag count of 11 1`] = `
187187
type="button"
188188
>
189189
<span
190-
class="pf-v5-c-icon pf-m-md"
190+
class="pf-v5-c-icon"
191191
>
192192
<span
193-
class="pf-v5-c-icon__content"
193+
class="pf-v5-c-icon__content pf-m-md"
194194
>
195195
<svg
196196
aria-hidden="true"

0 commit comments

Comments
 (0)