Skip to content

Commit 7d83b45

Browse files
committed
Misc. cleanup
1 parent fbc4725 commit 7d83b45

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In this repository, the source code for the component library is in the `src` di
1414

1515
The example app being run on the [GitHub Pages site](https://ginkgobioworks.github.io/react-json-schema-form-builder/), meanwhile, has its code stored in the `example` directory. It relies on an additional set of dependencies, which are stored in the `devDependencies` within the `package.json` file.
1616

17-
Library definitions for [Flow type annotations](https://flow.org/en/docs/types/) are stored in `src/flowlibdefs`, where the file structure under the `flow-typed` [best practices](https://github.com/flow-typed/flow-typed/blob/master/CONTRIBUTING.md) are followed. If any of the types in `src/formBuilder/types.js` are changed, or if the properties of the `FormBuilder` or `PredefinedGallery` are altered, then these flow typed library definitions should also be changed. This library definition is altered manually, and is currently set for major version 1 of the Form Builder. To update to library definition a PR must be made on the [flow-typed repository](https://github.com/flow-typed/flow-typed).
17+
Library definitions for [Flow type annotations](https://flow.org/en/docs/types/) are stored in `flow-libdef`, where the file structure under the `flow-typed` [best practices](https://github.com/flow-typed/flow-typed/blob/master/CONTRIBUTING.md) are followed. If any of the types in `src/formBuilder/types.js` are changed, or if the properties of the `FormBuilder` or `PredefinedGallery` are altered, then these `flow-typed` library definitions as well as the definitions in the actual `flow-typed` [repository](https://github.com/flow-typed/flow-typed) should also be changed. These library definitions are updated manually, and are currently set for major version 1 of the Form Builder. To update to library definition in the `flow-typed` repository a PR must be made on the [flow-typed repository](https://github.com/flow-typed/flow-typed).
1818

1919
## Testing
2020

@@ -32,4 +32,4 @@ GitHub Pages runs off the `gh-pages` branch, which can only be pushed to by the
3232

3333
## Release
3434

35-
The maintainers will release new versions to NPM as appropriate. The procedure that the maintainers will use to release is to update the changelog with the newest version, update the package.json version, and tag the main branch with the version number, upon which the travis-CI will run tests again before deploying to NPM automatically.
35+
The maintainers will release new versions to NPM as appropriate. The procedure that the maintainers will use to release is to update the changelog with the newest version, update the package.json version, and tag the main branch with the version number, upon which the travis-CI will run tests again before deploying to NPM automatically.

src/formBuilder/Section.test.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const props = {
2020
onRequireToggle: () => mockEvent('toggledRequire'),
2121
onDelete: () => mockEvent('delete'),
2222
path: 'section',
23-
definitionData: '',
24-
definitionUi: '',
23+
definitionData: {},
24+
definitionUi: {},
2525
allFormInputs: DEFAULT_FORM_INPUTS,
2626
};
2727

@@ -72,10 +72,7 @@ describe('Section', () => {
7272
it('adds components to the internal schema', () => {
7373
const div = document.createElement('div');
7474
document.body.appendChild(div);
75-
const wrapper = mount(
76-
<Section {...{ ...props, schema: '', uischema: '' }} />,
77-
{ attachTo: div },
78-
);
75+
const wrapper = mount(<Section {...props} />, { attachTo: div });
7976
const plusButton = wrapper.find('.fa-plus-square').first();
8077
plusButton.simulate('click');
8178
const createButton = wrapper.find('button').at(1);

src/formBuilder/defaults/arrayInputs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function CardArrayParameterInputs({
5757
);
5858
}
5959

60-
function InnerCardWrapper({
60+
function getInnerCardComponent({
6161
defaultFormInputs,
6262
}: {
6363
defaultFormInputs: { [string]: FormInput },
@@ -170,7 +170,7 @@ defaultFormInputs.array = {
170170
},
171171
defaultUiSchema: {},
172172
type: 'array',
173-
cardBody: InnerCardWrapper({ defaultFormInputs }),
173+
cardBody: getInnerCardComponent({ defaultFormInputs }),
174174
modalBody: CardArrayParameterInputs,
175175
};
176176

@@ -187,7 +187,7 @@ const ArrayInputs = {
187187
},
188188
defaultUiSchema: {},
189189
type: 'array',
190-
cardBody: InnerCardWrapper({ defaultFormInputs }),
190+
cardBody: getInnerCardComponent({ defaultFormInputs }),
191191
modalBody: CardArrayParameterInputs,
192192
},
193193
};

0 commit comments

Comments
 (0)