Skip to content

Commit bfb52d5

Browse files
authored
Merge pull request #457 from rvsia/fixPropTypes
fix(all): fix proptypes accross all packages
2 parents c2d3f79 + b7910ed commit bfb52d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+115
-115
lines changed

packages/common/src/form-template.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ export const FormControls = ({
6363
FormControls.propTypes = {
6464
onCancel: PropTypes.func,
6565
onReset: PropTypes.func,
66-
submitLabel: PropTypes.string,
67-
cancelLabel: PropTypes.string,
68-
resetLabel: PropTypes.string,
66+
submitLabel: PropTypes.node,
67+
cancelLabel: PropTypes.node,
68+
resetLabel: PropTypes.node,
6969
canReset: PropTypes.bool,
7070
disableSubmit: PropTypes.bool,
7171
buttonOrder: PropTypes.arrayOf(PropTypes.string),

packages/common/src/prop-types-templates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PropTypes from 'prop-types';
22

3-
export const optionsPropType = PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string.isRequired, value: PropTypes.any }));
3+
export const optionsPropType = PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.node.isRequired, value: PropTypes.any }));
44

55
export const meta = PropTypes.shape({
66
active: PropTypes.bool,

packages/mui-component-mapper/src/files/plain-text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const PlainText = ({ label, name, component, ...props }) =>
1010
));
1111

1212
PlainText.propTypes = {
13-
label: PropTypes.string.isRequired,
13+
label: PropTypes.node.isRequired,
1414
name: PropTypes.string.isRequired,
1515
component: PropTypes.any
1616
};

packages/mui-component-mapper/src/files/radio.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const RadioOption = ({ name, option, isDisabled, isReadOnly, FormControlLabelPro
4343

4444
RadioOption.propTypes = {
4545
name: PropTypes.string.isRequired,
46-
option: PropTypes.shape({ label: PropTypes.string.isRequired, value: PropTypes.any.isRequired }).isRequired,
46+
option: PropTypes.shape({ label: PropTypes.node.isRequired, value: PropTypes.any.isRequired }).isRequired,
4747
isReadOnly: PropTypes.bool,
4848
isDisabled: PropTypes.bool,
4949
FormControlLabelProps: PropTypes.object,

packages/mui-component-mapper/src/files/sub-form.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const SubForm = ({ fields, title, description, component, ...rest }) => {
3737

3838
SubForm.propTypes = {
3939
fields: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,
40-
title: PropTypes.string,
41-
description: PropTypes.string,
40+
title: PropTypes.node,
41+
description: PropTypes.node,
4242
component: PropTypes.any
4343
};
4444

packages/mui-component-mapper/src/files/wizard/wizard-step.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const WizardStep = ({ title, description, fields, formOptions, ...rest }) => (
1313
);
1414

1515
WizardStep.propTypes = {
16-
title: PropTypes.string,
17-
description: PropTypes.string,
16+
title: PropTypes.node,
17+
description: PropTypes.node,
1818
fields: PropTypes.array.isRequired,
1919
formOptions: PropTypes.shape({
2020
renderForm: PropTypes.func.isRequired

packages/pf3-component-mapper/src/common/form-wrapper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ Pf3FormGroup.propTypes = {
2727
meta: PropTypes.shape({ error: PropTypes.string }).isRequired,
2828
validateOnMount: PropTypes.bool,
2929
hideLabel: PropTypes.bool,
30-
label: PropTypes.string,
30+
label: PropTypes.node,
3131
noCheckboxLabel: PropTypes.bool,
3232
isRequired: PropTypes.bool,
33-
helperText: PropTypes.string,
34-
description: PropTypes.string,
33+
helperText: PropTypes.node,
34+
description: PropTypes.node,
3535
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
3636
inputAddon: PropTypes.shape({ fields: PropTypes.array })
3737
};

packages/pf3-component-mapper/src/files/button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const Button = ({ label, variant, dataType, validate, children, component
99
);
1010

1111
Button.propTypes = {
12-
label: PropTypes.string.isRequired,
12+
label: PropTypes.node.isRequired,
1313
variant: PropTypes.string,
1414
className: PropTypes.string,
1515
dataType: PropTypes.any, // should be inside inner props or something

packages/pf3-component-mapper/src/files/checkbox.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ const SingleCheckbox = (props) => {
1919
};
2020

2121
SingleCheckbox.propTypes = {
22-
label: PropTypes.string,
22+
label: PropTypes.node,
2323
isReadOnly: PropTypes.bool,
2424
isRequired: PropTypes.bool,
25-
helperText: PropTypes.string,
25+
helperText: PropTypes.node,
2626
isDisabled: PropTypes.bool,
27-
description: PropTypes.string
27+
description: PropTypes.node
2828
};
2929

3030
const Checkbox = ({ options, ...props }) => (options ? <MultipleChoiceList options={options} {...props} /> : <SingleCheckbox {...props} />);
3131

3232
Checkbox.propTypes = {
33-
options: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string, value: PropTypes.any }))
33+
options: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.node, value: PropTypes.any }))
3434
};
3535

3636
export default Checkbox;

packages/pf3-component-mapper/src/files/date-picker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ const DatePicker = (props) => {
2626
DatePicker.propTypes = {
2727
meta: PropTypes.object,
2828
validateOnMount: PropTypes.bool,
29-
label: PropTypes.string,
29+
label: PropTypes.node,
3030
hideLabel: PropTypes.bool,
3131
isReadOnly: PropTypes.bool,
3232
isRequired: PropTypes.bool,
33-
helperText: PropTypes.string,
34-
description: PropTypes.string,
33+
helperText: PropTypes.node,
34+
description: PropTypes.node,
3535
input: PropTypes.object,
3636
placeholder: PropTypes.string,
3737
isDisabled: PropTypes.bool,

0 commit comments

Comments
 (0)