Skip to content

Commit

Permalink
feat(DataListAction): Remove isPlainButtonAction prop (#775)
Browse files Browse the repository at this point in the history
* feat(DataListAction): Remove isPlainButtonAction prop

* fixes from core review comments

* remove .history and add it to gitignore
  • Loading branch information
tlabaj authored Sep 25, 2024
1 parent 597b3f9 commit 35bb6b4
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ lerna-output.txt
.idea
test/packages/*
.DS_Store
dist
dist

# IDE - VSCode
.history
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### dataListAction-remove-isPlainButtonAction-prop [(#10939)](https://github.com/patternfly/patternfly-react/pull/10939)

The `isPlainButtonAction` prop has been removed from DataListAction as a wrapper is no longer needed.

#### Examples

In:

```jsx
%inputExample%
```

Out:

```jsx
%outputExample%
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const ruleTester = require("../../ruletester");
import * as rule from "./dataListAction-remove-isPlainButtonAction-prop";

ruleTester.run("dataListAction-remove-isPlainButtonAction-prop", rule, {
valid: [
{
code: `<DataListAction isPlainButtonAction />`,
},
{
code: `import { DataListAction } from '@patternfly/react-core'; <DataListAction someOtherProp />`,
},
],
invalid: [
{
code: `import { DataListAction } from '@patternfly/react-core'; <DataListAction isPlainButtonAction />`,
output: `import { DataListAction } from '@patternfly/react-core'; <DataListAction />`,
errors: [
{
message: `The \`isPlainButtonAction\` prop has been removed from DataListAction as a wrapper is no longer needed.`,
type: "JSXOpeningElement",
},
],
},
],
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { renameProps } from "../../helpers";

// https://github.com/patternfly/patternfly-react/pull/10939
module.exports = {
meta: { fixable: "code" },
create: renameProps({
DataListAction: {
isPlainButtonAction: {
newName: "",
message:
"The `isPlainButtonAction` prop has been removed from DataListAction as a wrapper is no longer needed.",
},
},
}),
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { DataListAction } from "@patternfly/react-core";

export const DataListActionRemoveIsPlainButtonActionPropInput = () => (
<DataListAction isPlainButtonAction/>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { DataListAction } from "@patternfly/react-core";

export const DataListActionRemoveIsPlainButtonActionPropInput = () => (
<DataListAction />
);

0 comments on commit 35bb6b4

Please sign in to comment.