FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(Wizard): adds default function to onClose prop by Venefilyn · Pull Request #2863 · patternfly/patternfly-react · GitHub

fix(Wizard): adds default function to onClose prop - #2863

Merged
tlabaj merged 4 commits into
patternfly:masterfrom
Venefilyn:fix/wizard-onclose
Sep 18, 2019
Merged

fix(Wizard): adds default function to onClose prop#2863
tlabaj merged 4 commits into
patternfly:masterfrom
Venefilyn:fix/wizard-onclose

Conversation

Copy link
Copy Markdown
Contributor

What: This adds a default function to onClose so that it no longer crashes the component if left out

Additional issues: fixes #2831

cc @suomiy

Copy link
Copy Markdown
Collaborator

PatternFly-React preview: https://patternfly-react-pr-2863.surge.sh

Copy link
Copy Markdown

+1, but snapshots need to be updated

Copy link
Copy Markdown
Contributor Author

Right, thank you! - Snapshots updated

redallen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fixed the nitpick for you, so approved!

height: null as string,
footer: null as React.ReactNode
footer: null as React.ReactNode,
onClose: () => undefined as any

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can we do this instead for consistency?

Suggested change
onClose: () => undefined as any
onClose: (): any => undefined

Venefilyn Sep 10, 2019
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Right now there's 11 results for ): any => undefined and 22 for ) => undefined as any. Are we preferring the former when updating/writing new code?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We should fix these consistency issues and decide on which format we would like to use. Could add some tslint rules for things when possible. I would recommend leaving this for now and fixing some of these consistency issues in a separate issue.

height: null as string,
footer: null as React.ReactNode
footer: null as React.ReactNode,
onClose: () => undefined as any

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We should fix these consistency issues and decide on which format we would like to use. Could add some tslint rules for things when possible. I would recommend leaving this for now and fixing some of these consistency issues in a separate issue.

tlabaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

tlabaj merged commit 4773f18 into patternfly:master Sep 18, 2019

Copy link
Copy Markdown
Collaborator

Your changes have been released in:

  • @patternfly/react-core@3.104.6
  • @patternfly/react-docs@4.13.8
  • @patternfly/react-inline-edit-extension@2.11.42
  • demo-app-ts@3.0.5
  • @patternfly/react-table@2.20.22
  • @patternfly/react-topology@2.8.40
  • @patternfly/react-virtualized-extension@1.2.30

Thanks for your contribution! 🎉

Venefilyn deleted the fix/wizard-onclose branch November 13, 2024 12:41
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PF4: Wizard - missing onClose crashes the wizard

6 participants


Back | FazBrowse Home | New Git URL