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,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const PlainText = ({ variant, label, name }) =>
3333

3434
PlainText.propTypes = {
3535
variant: PropTypes.oneOf(validTextFields),
36-
label: PropTypes.string.isRequired,
36+
label: PropTypes.node.isRequired,
3737
name: PropTypes.string.isRequired
3838
};
3939

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ const Radio = ({ name, isRequired, isDisabled, isReadOnly, validateOnMount, help
4444
Radio.propTypes = {
4545
name: PropTypes.string.isRequired,
4646
validateOnMount: PropTypes.bool,
47-
label: PropTypes.string,
47+
label: PropTypes.node,
4848
hideLabel: PropTypes.bool,
4949
isReadOnly: PropTypes.bool,
5050
isRequired: PropTypes.bool,
51-
helperText: PropTypes.string,
52-
description: PropTypes.string,
51+
helperText: PropTypes.node,
52+
description: PropTypes.node,
5353
isDisabled: PropTypes.bool,
54-
options: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string, value: PropTypes.any })),
54+
options: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.node, value: PropTypes.any })),
5555
inputAddon: PropTypes.shape({ fields: PropTypes.array })
5656
};
5757

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ const Select = (props) => {
2929
Select.propTypes = {
3030
meta: PropTypes.object,
3131
validateOnMount: PropTypes.bool,
32-
label: PropTypes.string,
32+
label: PropTypes.node,
3333
hideLabel: PropTypes.bool,
3434
isReadOnly: PropTypes.bool,
3535
isRequired: PropTypes.bool,
36-
helperText: PropTypes.string,
37-
description: PropTypes.string,
36+
helperText: PropTypes.node,
37+
description: PropTypes.node,
3838
input: PropTypes.object,
3939
placeholder: PropTypes.string,
4040
isDisabled: PropTypes.bool,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const SelectTitle = ({ title, classNamePrefix, isClearable, value, onClear, isFe
8080
);
8181

8282
SelectTitle.propTypes = {
83-
title: PropTypes.string.isRequired,
83+
title: PropTypes.node.isRequired,
8484
classNamePrefix: PropTypes.string,
8585
isClearable: PropTypes.bool,
8686
value: PropTypes.any,

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

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

1616
SubForm.propTypes = {
1717
fields: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,
18-
title: PropTypes.string,
19-
description: PropTypes.string,
18+
title: PropTypes.node,
19+
description: PropTypes.node,
2020
component: PropTypes.any
2121
};
2222

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ const Switch = (props) => {
4242
Switch.propTypes = {
4343
meta: PropTypes.object,
4444
validateOnMount: PropTypes.bool,
45-
label: PropTypes.string,
45+
label: PropTypes.node,
4646
hideLabel: PropTypes.bool,
4747
isReadOnly: PropTypes.bool,
4848
isRequired: PropTypes.bool,
49-
helperText: PropTypes.string,
50-
description: PropTypes.string,
49+
helperText: PropTypes.node,
50+
description: PropTypes.node,
5151
input: PropTypes.object,
5252
placeholder: PropTypes.string,
5353
isDisabled: PropTypes.bool,

packages/pf3-component-mapper/src/files/text-field.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ const TextField = (props) => {
4040
TextField.propTypes = {
4141
meta: PropTypes.object,
4242
validateOnMount: PropTypes.bool,
43-
label: PropTypes.string,
43+
label: PropTypes.node,
4444
hideLabel: PropTypes.bool,
4545
isReadOnly: PropTypes.bool,
4646
isRequired: PropTypes.bool,
47-
helperText: PropTypes.string,
48-
description: PropTypes.string,
47+
helperText: PropTypes.node,
48+
description: PropTypes.node,
4949
input: PropTypes.object,
5050
placeholder: PropTypes.string,
5151
isDisabled: PropTypes.bool,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ const Textarea = (props) => {
4040
Textarea.propTypes = {
4141
meta: PropTypes.object,
4242
validateOnMount: PropTypes.bool,
43-
label: PropTypes.string,
43+
label: PropTypes.node,
4444
hideLabel: PropTypes.bool,
4545
isReadOnly: PropTypes.bool,
4646
isRequired: PropTypes.bool,
47-
helperText: PropTypes.string,
48-
description: PropTypes.string,
47+
helperText: PropTypes.node,
48+
description: PropTypes.node,
4949
input: PropTypes.object,
5050
placeholder: PropTypes.string,
5151
isDisabled: PropTypes.bool,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const WizardInternal = ({ title, buttonLabels, stepsInfo, inModal, onKeyDown, fo
5555
};
5656

5757
WizardInternal.propTypes = {
58-
title: PropTypes.string,
58+
title: PropTypes.node,
5959
buttonLabels: PropTypes.object,
6060
stepsInfo: PropTypes.array,
6161
inModal: PropTypes.bool,

packages/pf3-component-mapper/src/form-fields/date-time-picker/date-time-picker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ DateTimePicker.propTypes = {
151151
placeholder: PropTypes.string,
152152
variant: PropTypes.string,
153153
locale: PropTypes.string,
154-
todayButtonLabel: PropTypes.string,
154+
todayButtonLabel: PropTypes.node,
155155
showTodayButton: PropTypes.bool,
156156
isDisabled: PropTypes.bool,
157157
disabledDays: PropTypes.array,

packages/pf3-component-mapper/src/form-fields/date-time-picker/popover-root.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ PopoverRoot.propTypes = {
9696
variant: PropTypes.string,
9797
onHourChange: PropTypes.func.isRequired,
9898
onMinuteChange: PropTypes.func.isRequired,
99-
todayButtonLabel: PropTypes.string,
99+
todayButtonLabel: PropTypes.node,
100100
showTodayButton: PropTypes.bool,
101101
disabledDays: PropTypes.array
102102
};

packages/pf3-component-mapper/src/form-fields/required-label.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const RequiredLabel = ({ label }) => (
88
);
99

1010
RequiredLabel.propTypes = {
11-
label: PropTypes.string.isRequired
11+
label: PropTypes.node.isRequired
1212
};
1313

1414
export default RequiredLabel;

packages/pf4-component-mapper/src/common/form-group.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ const FormGroup = ({ label, isRequired, helperText, meta, description, hideLabel
2525
};
2626

2727
FormGroup.propTypes = {
28-
label: PropTypes.string,
28+
label: PropTypes.node,
2929
isRequired: PropTypes.bool,
30-
helperText: PropTypes.string,
30+
helperText: PropTypes.node,
3131
meta: PropTypes.object.isRequired,
32-
description: PropTypes.string,
32+
description: PropTypes.node,
3333
hideLabel: PropTypes.bool,
3434
id: PropTypes.string.isRequired,
3535
children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).isRequired

packages/pf4-component-mapper/src/common/select/multi-value-container.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const MultiValueContainer = (props) => (
1010

1111
MultiValueContainer.propTypes = {
1212
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
13-
data: PropTypes.shape({ label: PropTypes.string.isRequired }).isRequired,
13+
data: PropTypes.shape({ label: PropTypes.node.isRequired }).isRequired,
1414
className: PropTypes.string
1515
};
1616

packages/pf4-component-mapper/src/common/select/select.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ const Select = ({ selectVariant, menuIsPortal, ...props }) => {
5353
Select.propTypes = {
5454
selectVariant: PropTypes.oneOf(['default', 'createable']),
5555
isSearchable: PropTypes.bool,
56-
showMoreLabel: PropTypes.string,
57-
showLessLabel: PropTypes.string,
56+
showMoreLabel: PropTypes.node,
57+
showLessLabel: PropTypes.node,
5858
simpleValue: PropTypes.bool,
5959
value: PropTypes.any,
6060
options: PropTypes.arrayOf(

packages/pf4-component-mapper/src/common/select/value-container.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ ValueContainer.propTypes = {
3737
getStyles: PropTypes.func.isRequired,
3838
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
3939
selectProps: PropTypes.shape({
40-
showLessLabel: PropTypes.string,
41-
showMoreLabel: PropTypes.string
40+
showLessLabel: PropTypes.node,
41+
showMoreLabel: PropTypes.node
4242
})
4343
};
4444

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

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

2626
SingleCheckbox.propTypes = {
27-
label: PropTypes.string,
27+
label: PropTypes.node,
2828
isReadOnly: PropTypes.bool,
2929
isRequired: PropTypes.bool,
30-
helperText: PropTypes.string,
31-
description: PropTypes.string,
30+
helperText: PropTypes.node,
31+
description: PropTypes.node,
3232
isDisabled: PropTypes.bool,
3333
id: PropTypes.string
3434
};
3535

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

3838
Checkbox.propTypes = {
39-
options: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string, value: PropTypes.any }))
39+
options: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.node, value: PropTypes.any }))
4040
};
4141

4242
export default Checkbox;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ const DatePicker = (props) => {
2222
};
2323

2424
DatePicker.propTypes = {
25-
label: PropTypes.string,
25+
label: PropTypes.node,
2626
isReadOnly: PropTypes.bool,
2727
isRequired: PropTypes.bool,
28-
helperText: PropTypes.string,
29-
description: PropTypes.string,
30-
hideLabel: PropTypes.string,
28+
helperText: PropTypes.node,
29+
description: PropTypes.node,
30+
hideLabel: PropTypes.bool,
3131
isDisabled: PropTypes.bool,
3232
id: PropTypes.string
3333
};

0 commit comments

Comments
 (0)