Skip to content

Commit 4f25ff7

Browse files
committed
Fix extra parsing in object dependency
1 parent 86e1980 commit 4f25ff7

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/formBuilder/dependencies/DependencyField.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type DependencyParams = {
6565
type?: string,
6666
enum?: Array<string | number>,
6767
neighborNames?: Array<string>,
68-
schema?: string,
68+
schema?: any,
6969
};
7070

7171
export default function DependencyField({

src/formBuilder/dependencies/DependencyPossibility.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function DependencyPossibility({
3333
parentEnums?: Array<string | number>,
3434
parentType?: string,
3535
parentName?: string,
36-
parentSchema?: string,
36+
parentSchema?: any,
3737
}) {
3838
return (
3939
<div className='form-dependency-condition'>

src/formBuilder/dependencies/ValueSelector.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { faTimes, faPlus } from '@fortawesome/free-solid-svg-icons';
66
import CardEnumOptions from '../CardEnumOptions';
77
import CardSelector from './CardSelector';
88
import FBCheckbox from '../checkbox/FBCheckbox';
9-
import { parse } from '../utils';
109
import FontAwesomeIcon from '../FontAwesomeIcon';
1110

1211
// handle value options for different card types
@@ -30,7 +29,7 @@ export default function ValueSelector({
3029
parentEnums?: Array<string | number>,
3130
parentType?: string,
3231
parentName?: string,
33-
parentSchema?: string,
32+
parentSchema?: any,
3433
path: string,
3534
}) {
3635
if (possibility.value) {
@@ -229,9 +228,7 @@ export default function ValueSelector({
229228
icon={faPlus}
230229
onClick={() => {
231230
const newCase = {};
232-
const propArr = parentSchema
233-
? (parse(parentSchema): any).properties
234-
: {};
231+
const propArr = parentSchema ? parentSchema.properties : {};
235232
Object.keys(propArr).forEach((key) => {
236233
if (
237234
propArr[key].type === 'number' ||

0 commit comments

Comments
 (0)