Skip to content

Commit f473a14

Browse files
authored
Merge pull request #666 from rvsia/clearTests
Clear tests
2 parents bf7728a + c0eb2eb commit f473a14

30 files changed

+2135
-932
lines changed

packages/common/src/multiple-choice-list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ export default MultipleChoiceList;
5656

5757
export const wrapperProps = {
5858
...formGroup,
59-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
59+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
6060
};

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ const Slider = (props) => {
4848
</Grid>
4949
)}
5050
<Grid item xs {...SliderGridProps}>
51-
<MUISlider {...input} {...rest} disabled={isDisabled || isReadOnly} onChange={(_e, value) => input.onChange(value)} />
51+
<MUISlider
52+
{...input}
53+
value={input.value || (rest.max + rest.min) / 2 || 50}
54+
{...rest}
55+
disabled={isDisabled || isReadOnly}
56+
onChange={(_e, value) => input.onChange(value)}
57+
/>
5258
</Grid>
5359
{after && (
5460
<Grid item {...AfterGridProps}>

packages/pf3-component-mapper/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"html-webpack-plugin": "^3.2.0",
4646
"mini-css-extract-plugin": "^0.4.4",
4747
"node-sass": "^4.12.0",
48-
"patternfly-react": "^2.28.2",
48+
"patternfly-react": "^2.39.16",
4949
"react": "^16.13.1",
5050
"react-dom": "^16.13.1",
5151
"regenerator-runtime": "^0.12.1",
@@ -72,13 +72,13 @@
7272
"webpack-merge": "^4.1.4"
7373
},
7474
"peerDependencies": {
75-
"@data-driven-forms/react-form-renderer": "^1.9.6",
76-
"patternfly-react": "^2.25.4"
75+
"@data-driven-forms/react-form-renderer": "^2.8.0",
76+
"patternfly-react": "^2.39.16"
7777
},
7878
"dependencies": {
7979
"clsx": "^1.0.4",
8080
"prop-types": "^15.7.2",
81-
"react-day-picker": "^7.3.2",
81+
"react-day-picker": "^7.4.8",
8282
"react-select": "^3.0.8"
8383
},
8484
"resolutions": {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const Pf3FormGroup = ({ meta, validateOnMount, label, hideLabel, noCheckboxLabel
2424
};
2525

2626
Pf3FormGroup.propTypes = {
27-
meta: PropTypes.shape({ error: PropTypes.string }).isRequired,
27+
meta: PropTypes.shape({ error: PropTypes.any }).isRequired,
2828
validateOnMount: PropTypes.bool,
2929
hideLabel: PropTypes.bool,
3030
label: PropTypes.node,

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.node.isRequired,
12+
label: PropTypes.node,
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/select.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ const Select = (props) => {
2727
};
2828

2929
Select.propTypes = {
30-
meta: PropTypes.object,
3130
validateOnMount: PropTypes.bool,
3231
label: PropTypes.node,
3332
hideLabel: PropTypes.bool,
3433
isReadOnly: PropTypes.bool,
3534
isRequired: PropTypes.bool,
3635
helperText: PropTypes.node,
3736
description: PropTypes.node,
38-
input: PropTypes.object,
3937
placeholder: PropTypes.string,
4038
isDisabled: PropTypes.bool,
4139
inputAddon: PropTypes.shape({ fields: PropTypes.array })

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const renderTabHeader = (items, formOptions) =>
1212
const hasError = validateFields.find((name) => !!get(errors, name));
1313
return (
1414
<NavItem key={name} eventKey={index}>
15-
{hasError && <Icon classnName="ddorg__pf3-layout-components__tabs__error" type="fa" name="exclamation-circle" />}
15+
{hasError && <Icon className="ddorg__pf3-layout-components__tabs__error" type="fa" name="exclamation-circle" />}
1616
{title}
1717
</NavItem>
1818
);

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,12 @@ const renderNextButton = ({ nextStep, handleSubmit, buttonLabels, ...rest }) =>
6060
const WizardStepButtons = ({ disableBack, handlePrev, nextStep, formOptions, handleNext, buttonLabels }) => (
6161
<Wizard.Footer>
6262
{formOptions.onCancel && (
63-
<Button
64-
className="ddorg__pf3-component-mapper__wizard__buttons"
65-
type="button"
66-
variant="contained"
67-
color="secondary"
68-
onClick={formOptions.onCancel}
69-
>
63+
<Button className="ddorg__pf3-component-mapper__wizard__buttons" type="button" color="secondary" onClick={formOptions.onCancel}>
7064
{buttonLabels.cancel}
7165
</Button>
7266
)}
7367

74-
<Button type="button" variant="contained" disabled={disableBack} onClick={handlePrev} className="margin-left-3">
68+
<Button type="button" disabled={disableBack} onClick={handlePrev} className="margin-left-3">
7569
<Icon type="fa" name="angle-left" />
7670
{buttonLabels.back}
7771
</Button>

packages/pf3-component-mapper/src/tests/__snapshots__/form-fields.test.js.snap

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,6 @@ exports[`FormFields <Switch /> should render Switch correctly 1`] = `
623623
onSubmit={[Function]}
624624
>
625625
<Switch
626-
FieldProvider={[Function]}
627626
id="someIdKey"
628627
input={
629628
Object {
@@ -670,7 +669,6 @@ exports[`FormFields <Switch /> should render Switch correctly 1`] = `
670669
className="form-group"
671670
>
672671
<Switch
673-
FieldProvider={[Function]}
674672
checked={true}
675673
id="someIdKey"
676674
offText="OFF"
@@ -692,7 +690,6 @@ exports[`FormFields <Switch /> should render Switch correctly 1`] = `
692690
tabIndex={0}
693691
>
694692
<input
695-
FieldProvider={[Function]}
696693
checked={true}
697694
id="someIdKey"
698695
onBlur={[Function]}
@@ -767,7 +764,6 @@ exports[`FormFields <Switch /> should render Switch with label correctly 1`] = `
767764
onSubmit={[Function]}
768765
>
769766
<Switch
770-
FieldProvider={[Function]}
771767
id="someIdKey"
772768
input={
773769
Object {
@@ -826,7 +822,6 @@ exports[`FormFields <Switch /> should render Switch with label correctly 1`] = `
826822
</label>
827823
</ControlLabel>
828824
<Switch
829-
FieldProvider={[Function]}
830825
checked={true}
831826
id="someIdKey"
832827
offText="OFF"
@@ -848,7 +843,6 @@ exports[`FormFields <Switch /> should render Switch with label correctly 1`] = `
848843
tabIndex={0}
849844
>
850845
<input
851-
FieldProvider={[Function]}
852846
checked={true}
853847
id="someIdKey"
854848
onBlur={[Function]}
@@ -923,7 +917,6 @@ exports[`FormFields <Switch /> should render Switch with onText (custom prop) co
923917
onSubmit={[Function]}
924918
>
925919
<Switch
926-
FieldProvider={[Function]}
927920
id="someIdKey"
928921
input={
929922
Object {
@@ -971,7 +964,6 @@ exports[`FormFields <Switch /> should render Switch with onText (custom prop) co
971964
className="form-group"
972965
>
973966
<Switch
974-
FieldProvider={[Function]}
975967
checked={true}
976968
id="someIdKey"
977969
offText="OFF"
@@ -993,7 +985,6 @@ exports[`FormFields <Switch /> should render Switch with onText (custom prop) co
993985
tabIndex={0}
994986
>
995987
<input
996-
FieldProvider={[Function]}
997988
checked={true}
998989
id="someIdKey"
999990
onBlur={[Function]}
@@ -1068,7 +1059,6 @@ exports[`FormFields <Switch /> should render Switch with placeholder correctly 1
10681059
onSubmit={[Function]}
10691060
>
10701061
<Switch
1071-
FieldProvider={[Function]}
10721062
id="someIdKey"
10731063
input={
10741064
Object {
@@ -1116,7 +1106,6 @@ exports[`FormFields <Switch /> should render Switch with placeholder correctly 1
11161106
className="form-group"
11171107
>
11181108
<Switch
1119-
FieldProvider={[Function]}
11201109
checked={true}
11211110
id="someIdKey"
11221111
offText="OFF"
@@ -1138,7 +1127,6 @@ exports[`FormFields <Switch /> should render Switch with placeholder correctly 1
11381127
tabIndex={0}
11391128
>
11401129
<input
1141-
FieldProvider={[Function]}
11421130
checked={true}
11431131
id="someIdKey"
11441132
onBlur={[Function]}
@@ -1213,7 +1201,6 @@ exports[`FormFields <Switch /> should render disabled Switch correctly 1`] = `
12131201
onSubmit={[Function]}
12141202
>
12151203
<Switch
1216-
FieldProvider={[Function]}
12171204
id="someIdKey"
12181205
input={
12191206
Object {
@@ -1261,7 +1248,6 @@ exports[`FormFields <Switch /> should render disabled Switch correctly 1`] = `
12611248
className="form-group"
12621249
>
12631250
<Switch
1264-
FieldProvider={[Function]}
12651251
checked={true}
12661252
disabled={true}
12671253
id="someIdKey"
@@ -1284,7 +1270,6 @@ exports[`FormFields <Switch /> should render disabled Switch correctly 1`] = `
12841270
tabIndex={-1}
12851271
>
12861272
<input
1287-
FieldProvider={[Function]}
12881273
checked={true}
12891274
disabled={true}
12901275
id="someIdKey"
@@ -1360,7 +1345,6 @@ exports[`FormFields <Switch /> should render mini Switch correctly 1`] = `
13601345
onSubmit={[Function]}
13611346
>
13621347
<Switch
1363-
FieldProvider={[Function]}
13641348
bsSize="mini"
13651349
id="someIdKey"
13661350
input={
@@ -1408,7 +1392,6 @@ exports[`FormFields <Switch /> should render mini Switch correctly 1`] = `
14081392
className="form-group"
14091393
>
14101394
<Switch
1411-
FieldProvider={[Function]}
14121395
bsSize="mini"
14131396
checked={true}
14141397
id="someIdKey"
@@ -1431,7 +1414,6 @@ exports[`FormFields <Switch /> should render mini Switch correctly 1`] = `
14311414
tabIndex={0}
14321415
>
14331416
<input
1434-
FieldProvider={[Function]}
14351417
checked={true}
14361418
id="someIdKey"
14371419
onBlur={[Function]}
@@ -1506,7 +1488,6 @@ exports[`FormFields <Switch /> should render readOnly Switch correctly 1`] = `
15061488
onSubmit={[Function]}
15071489
>
15081490
<Switch
1509-
FieldProvider={[Function]}
15101491
id="someIdKey"
15111492
input={
15121493
Object {
@@ -1554,7 +1535,6 @@ exports[`FormFields <Switch /> should render readOnly Switch correctly 1`] = `
15541535
className="form-group"
15551536
>
15561537
<Switch
1557-
FieldProvider={[Function]}
15581538
checked={true}
15591539
id="someIdKey"
15601540
isReadOnly={true}
@@ -1577,7 +1557,6 @@ exports[`FormFields <Switch /> should render readOnly Switch correctly 1`] = `
15771557
tabIndex={-1}
15781558
>
15791559
<input
1580-
FieldProvider={[Function]}
15811560
checked={true}
15821561
disabled={true}
15831562
id="someIdKey"
@@ -1653,7 +1632,6 @@ exports[`FormFields <Switch /> should render sm Switch correctly 1`] = `
16531632
onSubmit={[Function]}
16541633
>
16551634
<Switch
1656-
FieldProvider={[Function]}
16571635
bsSize="mn"
16581636
id="someIdKey"
16591637
input={
@@ -1701,7 +1679,6 @@ exports[`FormFields <Switch /> should render sm Switch correctly 1`] = `
17011679
className="form-group"
17021680
>
17031681
<Switch
1704-
FieldProvider={[Function]}
17051682
bsSize="mn"
17061683
checked={true}
17071684
id="someIdKey"
@@ -1724,7 +1701,6 @@ exports[`FormFields <Switch /> should render sm Switch correctly 1`] = `
17241701
tabIndex={0}
17251702
>
17261703
<input
1727-
FieldProvider={[Function]}
17281704
checked={true}
17291705
id="someIdKey"
17301706
onBlur={[Function]}

0 commit comments

Comments
 (0)