Skip to content

Commit 460611d

Browse files
committed
bump core for class name, remove warning
1 parent e96381a commit 460611d

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

packages/react-table/src/components/Table/Table.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export interface TableProps extends React.HTMLProps<HTMLTableElement>, OUIAProps
5050
role?: string;
5151
/** @beta Flag indicating if the table should have plain styling with a transparent background */
5252
isPlain?: boolean;
53-
/** @beta Flag indicating if the table should not have plain styling when in the glass theme. If isPlain is also set, this property will be ignored. */
53+
/** @beta Flag indicating if the table should not have plain styling when in the glass theme */
5454
isNoPlainOnGlass?: boolean;
5555
/** If set to true, the table header sticks to the top of its container */
5656
isStickyHeader?: boolean;
@@ -124,13 +124,6 @@ const TableBase: React.FunctionComponent<TableProps> = ({
124124
const [hasSelectableRows, setHasSelectableRows] = useState(false);
125125
const [tableCaption, setTableCaption] = useState<React.JSX.Element | undefined>();
126126

127-
if (isPlain && isNoPlainOnGlass) {
128-
// eslint-disable-next-line no-console
129-
console.warn(
130-
"Table: When both isPlain and isNoPlainOnGlass are true, isPlain will take precedence and isNoPlainOnGlass will have no effect. It's recommended to pass only one prop according to the current theme."
131-
);
132-
}
133-
134127
useEffect(() => {
135128
document.addEventListener('keydown', handleKeys);
136129

@@ -236,7 +229,7 @@ const TableBase: React.FunctionComponent<TableProps> = ({
236229
isStriped && styles.modifiers.striped,
237230
isExpandable && styles.modifiers.expandable,
238231
isPlain && styles.modifiers.plain,
239-
isNoPlainOnGlass && styles.modifiers.noPlain,
232+
isNoPlainOnGlass && styles.modifiers.noPlainOnGlass,
240233
hasNoInset && stylesTreeView.modifiers.noInset,
241234
isNested && 'pf-m-nested',
242235
hasAnimations && styles.modifiers.animateExpand

packages/react-table/src/components/Table/__tests__/Table.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,20 @@ test(`Does not render with class ${styles.modifiers.plain} when isPlain is false
169169
expect(screen.getByRole('grid', { name: 'Test table' })).not.toHaveClass(styles.modifiers.plain);
170170
});
171171

172-
test(`Renders with class ${styles.modifiers.noPlain} when isNoPlainOnGlass is true`, () => {
172+
test(`Renders with class ${styles.modifiers.noPlainOnGlass} when isNoPlainOnGlass is true`, () => {
173173
render(<Table isNoPlainOnGlass aria-label="Test table" />);
174174

175-
expect(screen.getByRole('grid', { name: 'Test table' })).toHaveClass(styles.modifiers.noPlain);
175+
expect(screen.getByRole('grid', { name: 'Test table' })).toHaveClass(styles.modifiers.noPlainOnGlass);
176176
});
177177

178-
test(`Does not render with class ${styles.modifiers.noPlain} when isNoPlainOnGlass is undefined`, () => {
178+
test(`Does not render with class ${styles.modifiers.noPlainOnGlass} when isNoPlainOnGlass is undefined`, () => {
179179
render(<Table aria-label="Test table" />);
180180

181-
expect(screen.getByRole('grid', { name: 'Test table' })).not.toHaveClass(styles.modifiers.noPlain);
181+
expect(screen.getByRole('grid', { name: 'Test table' })).not.toHaveClass(styles.modifiers.noPlainOnGlass);
182182
});
183183

184-
test(`Does not render with class ${styles.modifiers.noPlain} when isNoPlainOnGlass is false`, () => {
184+
test(`Does not render with class ${styles.modifiers.noPlainOnGlass} when isNoPlainOnGlass is false`, () => {
185185
render(<Table isNoPlainOnGlass={false} aria-label="Test table" />);
186186

187-
expect(screen.getByRole('grid', { name: 'Test table' })).not.toHaveClass(styles.modifiers.noPlain);
187+
expect(screen.getByRole('grid', { name: 'Test table' })).not.toHaveClass(styles.modifiers.noPlainOnGlass);
188188
});

0 commit comments

Comments
 (0)