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,11 @@
const { renameProp } = require('../../helpers');

// https://github.com/patternfly/patternfly-react/pull/8518
module.exports = {
meta: { fixable: 'code' },
create: renameProp(
'Alert',
{'titleHeadingLevel': 'component'},
node => `titleHeadingLevel prop has been removed for ${node.name.name} and replaced with the component prop.`
),
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const ruleTester = require('../../ruletester');
const rule = require('../../../lib/rules/v5/alert-remove-titleHeadingLevel');

ruleTester.run("alert-remove-titleHeadingLevel", rule, {
valid: [
{
code: `import { Alert } from '@patternfly/react-core'; <Alert component />`,
},
{
// No @patternfly/react-core import
code: `<Alert titleHeadingLevel />`,
}
],
invalid: [
{
code: `import { Alert } from '@patternfly/react-core'; <Alert titleHeadingLevel />`,
output: `import { Alert } from '@patternfly/react-core'; <Alert component />`,
errors: [{
message: `titleHeadingLevel prop has been removed for Alert and replaced with the component prop.`,
type: "JSXOpeningElement",
}]
}
]
});
16 changes: 16 additions & 0 deletions packages/pf-codemods/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ Out:
<Alert />
```

### alert-replace-titleHeadingLevel [(#8518)](https://github.com/patternfly/patternfly-react/pull/8518)

We've removed the `titleHeadlingLevel` prop and replaced it with the `component` prop.

In:

```jsx
<Alert titleHeadingLevel="h4" />
```

Out:

```jsx
<Alert component="h4" />
```

### applicationLauncher-warn-input [(#8293)](https://github.com/patternfly/patternfly-react/pull/8293)

We've updated the internal input in ApplicationLauncher to the PatternFly SearchInput. Any relative selectors, such as in unit tests, may need to be updated.
Expand Down
1 change: 1 addition & 0 deletions test/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const isRead = true;
const newTheme = getCustomTheme("1", "2", "3");
<>
<Alert aria-label='tester' />
<Alert titleHeadingLevel={"h4"}/>
<Button isLarge />
<Button isSmall />
<Chart themeVariant />
Expand Down