Skip to content

Commit

Permalink
Merge pull request #1399 from IBM/fix-proptypes-errors
Browse files Browse the repository at this point in the history
fix(proptypes): relax proptypes errors on pagewizard
  • Loading branch information
davidicus committed Jul 14, 2020
2 parents 76efd2d + 88a75bb commit 438ad28
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/List/ListItem/ListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const ListItemWrapperProps = {
isSelectable: PropTypes.bool.isRequired,
onSelect: PropTypes.func.isRequired,
selected: PropTypes.bool.isRequired,
children: React.Children.isRequired,
children: PropTypes.node.isRequired,
};

const ListItemPropTypes = {
Expand Down
6 changes: 4 additions & 2 deletions src/components/PageWizard/PageWizardStep/PageWizardStep.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const PageWizardStepPropTypes = {
/** Optional sticky footer */
hasStickyFooter: PropTypes.bool,
/** Callback function to close the wizard */
onClose: PropTypes.func.isRequired,
onClose: PropTypes.func,
/** Determines if Cancel or Previous button is rendered */
hasPrev: PropTypes.bool,
/** Determines if Next or Submit button is rendered */
Expand All @@ -38,7 +38,7 @@ const PageWizardStepPropTypes = {
/** Renders a loading icon in the Next button */
sendingData: PropTypes.bool,
/** Callback function when Submit button is clicked */
onSubmit: PropTypes.func.isRequired,
onSubmit: PropTypes.func,
/** Content to render before footer buttons (on left side, in LTR) */
beforeFooterContent: PropTypes.node,
};
Expand All @@ -63,6 +63,8 @@ const PageWizardStepDefaultProps = {
onNext: null,
onBack: null,
beforeFooterContent: null,
onSubmit: null,
onClose: null,
};

const PageWizardStep = ({
Expand Down
3 changes: 2 additions & 1 deletion src/components/PageWizard/StatefulPageWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const StatefulPageWizardPropTypes = {
close: PropTypes.string,
}),
/** function to go to step when click ProgressIndicator step. */
setStep: PropTypes.func.isRequired,
setStep: PropTypes.func,
/** next button disabled */
nextDisabled: PropTypes.bool,
/** show progress indicator on finish button */
Expand Down Expand Up @@ -63,6 +63,7 @@ const defaultProps = {
onNext: null,
onBack: null,
beforeFooterContent: null,
setStep: null,
};

const StatefulPageWizard = ({
Expand Down
6 changes: 3 additions & 3 deletions src/utils/__tests__/__snapshots__/publicAPI.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12764,7 +12764,9 @@ Map {
"nextDisabled": false,
"onBack": null,
"onClearError": null,
"onClose": null,
"onNext": null,
"onSubmit": null,
"onValidate": [Function],
"sendingData": false,
},
Expand Down Expand Up @@ -12824,14 +12826,12 @@ Map {
"type": "func",
},
"onClose": Object {
"isRequired": true,
"type": "func",
},
"onNext": Object {
"type": "func",
},
"onSubmit": Object {
"isRequired": true,
"type": "func",
},
"onValidate": Object {
Expand Down Expand Up @@ -12961,6 +12961,7 @@ Map {
"onBack": null,
"onNext": null,
"sendingData": false,
"setStep": null,
},
"propTypes": Object {
"beforeFooterContent": Object {
Expand Down Expand Up @@ -13043,7 +13044,6 @@ Map {
"type": "bool",
},
"setStep": Object {
"isRequired": true,
"type": "func",
},
},
Expand Down

0 comments on commit 438ad28

Please sign in to comment.