-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Page) rename isTertiaryNavGrouped
- Loading branch information
1 parent
1832a08
commit 8a4243b
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...src/rules/v6/pageRenameIsTertiaryNavGrouped/page-rename-isTertiaryNavGrouped.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
### page-rename-isTertiaryNavGrouped [(#9948)](https://github.com/patternfly/patternfly-react/pull/9948) | ||
|
||
We've renamed the \`isTertiaryNavGrouped\` prop to \`isHorizontalSubnavGrouped\`. | ||
|
||
#### Examples | ||
|
||
In: | ||
|
||
```jsx | ||
%inputExample% | ||
``` | ||
|
||
Out: | ||
|
||
```jsx | ||
%outputExample% | ||
``` | ||
|
24 changes: 24 additions & 0 deletions
24
...mods/src/rules/v6/pageRenameIsTertiaryNavGrouped/page-rename-isTertiaryNavGrouped.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const ruleTester = require('../../ruletester'); | ||
import * as rule from './page-rename-isTertiaryNavGrouped'; | ||
|
||
ruleTester.run("page-rename-isTertiaryNavGrouped", rule, { | ||
valid: [ | ||
{ | ||
code: `<Page isTertiaryNavGrouped />` | ||
}, | ||
{ | ||
code: `import { Page } from '@patternfly/react-core'; <Page someOtherProp />` | ||
} | ||
], | ||
invalid: [ | ||
{ | ||
code: `import { Page } from '@patternfly/react-core'; <Page isTertiaryNavGrouped />`, | ||
output: `import { Page } from '@patternfly/react-core'; <Page isHorizontalSubnavGrouped />`, | ||
errors: [{ | ||
message: `We've renamed the \`isTertiaryNavGrouped\` prop to \`isHorizontalSubnavGrouped\`.`, | ||
type: "JSXOpeningElement", | ||
}] | ||
}, | ||
] | ||
}); | ||
|
16 changes: 16 additions & 0 deletions
16
...-codemods/src/rules/v6/pageRenameIsTertiaryNavGrouped/page-rename-isTertiaryNavGrouped.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { renameProps } from '../../helpers'; | ||
|
||
// https://github.com/patternfly/patternfly-react/pull/9948 | ||
module.exports = { | ||
meta: { fixable: 'code' }, | ||
create: renameProps({ | ||
Page:{ | ||
"isTertiaryNavGrouped":{ | ||
newName:"isHorizontalSubnavGrouped", | ||
message:() => | ||
`We've renamed the \`isTertiaryNavGrouped\` prop to \`isHorizontalSubnavGrouped\`.`, | ||
} | ||
} | ||
}) | ||
}; | ||
|
3 changes: 3 additions & 0 deletions
3
...emods/src/rules/v6/pageRenameIsTertiaryNavGrouped/pageRenameIsTertiaryNavGroupedInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Page } from "@patternfly/react-core"; | ||
|
||
export const PageRenameIsTertiaryNavGroupedInput = () => <Page isTertiaryNavGrouped /> |
3 changes: 3 additions & 0 deletions
3
...mods/src/rules/v6/pageRenameIsTertiaryNavGrouped/pageRenameIsTertiaryNavGroupedOutput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Page } from "@patternfly/react-core"; | ||
|
||
export const PageRenameIsTertiaryNavGroupedInput = () => <Page isHorizontalSubnavGrouped /> |