Skip to content

Commit 2c3167b

Browse files
authored
Move flow-typed definition files to correct directories (#86)
* Move flow-typed definition files to correct directories * Update flow-typed tests
1 parent e3accb9 commit 2c3167b

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ declare module '@ginkgo-bioworks/react-json-schema-form-builder' {
2020
| 'boolean'
2121
| 'integer'
2222
| 'array'
23-
| '*'
24-
| null;
23+
| 'object'
2524

2625
declare type MatchType = {|
2726
types: Array<DataType>,
@@ -89,13 +88,13 @@ declare module '@ginkgo-bioworks/react-json-schema-form-builder' {
8988
showFormHead?: boolean,
9089
deactivatedFormInputs?: Array<string>,
9190
newElementDefaultDataOptions?: DataOptions,
92-
newElementDefaultUiSchema?: { [string]: any },
91+
newElementDefaultUiSchema?: { [string]: any, ... },
9392
|};
9493

9594
declare type FormBuilderProps = {|
9695
schema: string,
9796
uischema: string,
98-
onChange: (string, string) => any,
97+
onChange: (schema: string, uiSchema: string) => any,
9998
mods?: Mods,
10099
className?: string,
101100
|};
Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,28 @@ describe('@ginkgo-bioworks/react-json-schema-form-builder', () => {
6666
cardDisplayName: 'card display name text',
6767
cardDescription: 'card description text',
6868
cardInputType: 'card input type text',
69+
cardSectionObjectName: 'card section object name text',
70+
cardSectionDisplayName: 'card section display name text',
71+
cardSectionDescription: 'card section description text',
6972
},
73+
labels: {
74+
formNameLabel: 'alternative form name label',
75+
formDescriptionLabel: 'alternative form description label',
76+
objectNameLabel: 'alternative object name label',
77+
displayNameLabel: 'alternative display name label',
78+
descriptionLabel: 'alternative description label',
79+
inputTypeLabel: 'alternative input type lablel',
80+
},
81+
showFormHead: false,
82+
deactivatedFormInputs: ['shortAnswer'],
83+
newElementDefaultDataOptions: {
84+
title: 'new title',
85+
type: 'string',
86+
description: 'new description',
87+
$ref: '#/definitions/newDefinition',
88+
default: 'new default value',
89+
},
90+
newElementDefaultUiSchema: { 'ui:widget': 'foobiz' },
7091
},
7192
};
7293
const extraneousProps = {
@@ -99,12 +120,12 @@ describe('@ginkgo-bioworks/react-json-schema-form-builder', () => {
99120
});
100121

101122
it('form builder errors on extraneous properties passed in', () => {
102-
// $FlowExpectedError
123+
// $FlowExpectedError[prop-missing]
103124
<FormBuilder {...extraneousProps} />
104125
});
105126

106127
it('form builder errors on improper mods passed in', () => {
107-
// $FlowExpectedError
128+
// $FlowExpectedError[prop-missing]
108129
<FormBuilder {...malformedMods} />
109130
});
110131

@@ -121,12 +142,12 @@ describe('@ginkgo-bioworks/react-json-schema-form-builder', () => {
121142
})
122143

123144
it('predefined gallery errors on extraneous properties passed in', () => {
124-
// $FlowExpectedError
145+
// $FlowExpectedError[prop-missing]
125146
<PredefinedGallery {...extraneousProps} />
126147
});
127148

128149
it('predefined gallery errors on improper mods passed in', () => {
129-
// $FlowExpectedError
150+
// $FlowExpectedError[prop-missing]
130151
<PredefinedGallery {...malformedMods} />
131152
});
132153
});

0 commit comments

Comments
 (0)