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
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// https://github.com/patternfly/patternfly-react/pull/8629
module.exports = {
create: function (context) {
return {
ImportDeclaration(node) {
const TableImport = node.specifiers.find(
(specifier) =>
(specifier.imported.name === "Table" || specifier.imported.name === "TableComposable") &&
node.source.value === "@patternfly/react-table"
);

if (TableImport) {
context.report({
node,
message: "The ActionsColumn now uses the Next version of Dropdown. The action toggle should now pass a MenuToggle rather than a DropdownToggle, and direction and position properties are now passed under the new popperProps property.",
});
}
},
};
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const ruleTester = require('../../ruletester');
const rule = require('../../../lib/rules/v5/table-warn-actionsColumn');

ruleTester.run("table-warn-actionsColumn", rule, {
valid: [
{
code: `<Table />`,
},
{
code: `<TableComposable />`,
}
],
invalid: [
{
code: `import { Table } from '@patternfly/react-table';`,
output: `import { Table } from '@patternfly/react-table';`,
errors: [{
message: `The ActionsColumn now uses the Next version of Dropdown. The action toggle should now pass a MenuToggle rather than a DropdownToggle, and direction and position properties are now passed under the new popperProps property.`,
type: "ImportDeclaration",
}]
},
{
code: `import { TableComposable } from '@patternfly/react-table';`,
output: `import { TableComposable } from '@patternfly/react-table';`,
errors: [{
message: `The ActionsColumn now uses the Next version of Dropdown. The action toggle should now pass a MenuToggle rather than a DropdownToggle, and direction and position properties are now passed under the new popperProps property.`,
type: "ImportDeclaration",
}]
},
]
});
5 changes: 4 additions & 1 deletion packages/pf-codemods/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,14 @@ Out:
<Spinner />
```

### table-warn-actionsColumn [(#8629)](https://github.com/patternfly/patternfly-react/pull/8629)

Table and TableComposable's `ActionsColumn` has been updated to use the newer 'next' version of Dropdown. The toggle passed to the actions column should now be a `MenuToggle` instead of a `DropdownToggle`. The `dropdownPosition`, `dropdownDirection` and `menuAppendTo` properties are removed and `Popper` properties can be passed in using `popperProps` instead (via `direction`, `position`, `appendTo`, etc.).

### table-warn-thExpandType [(#8634)](https://github.com/patternfly/patternfly-react/pull/8634)

`collapseAllAriaLabel` on `ThExpandType` has been updated to a `string` from `''`. Workarounds casting this property to an empty string are no longer required.


### tableComposable-remove-hasSelectableRowCaption [(#8352)](https://github.com/patternfly/patternfly-react/pull/8352)

We've removed the deprecated `hasSelectableRowCaption` prop.
Expand Down