From 3e2de1b626cda927367b3b76424f4ac93be68dd7 Mon Sep 17 00:00:00 2001 From: mydu Date: Tue, 25 Jun 2019 17:21:12 +0200 Subject: [PATCH] sort required field on top and default select to empty #58 --- importApp/src/components/FieldInput.js | 16 +++++----------- .../src/components/ReferenceResourceForm.js | 10 ++++------ importApp/src/utils/formUtils.js | 8 +------- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/importApp/src/components/FieldInput.js b/importApp/src/components/FieldInput.js index 9306f2e8..b51ceb2d 100644 --- a/importApp/src/components/FieldInput.js +++ b/importApp/src/components/FieldInput.js @@ -12,7 +12,6 @@ import { Control, Input, Help, - Select as SimpleSelect } from 'design-workshop' @@ -37,7 +36,7 @@ class FieldInput extends React.Component { let options; if (fieldSchema.constraints && fieldSchema.constraints.enum) { - options = getEnumOptions(fieldSchema.constraints.enum, fieldSchema.constraints.required) + options = getEnumOptions(fieldSchema.constraints.enum) } return { fieldSchema, @@ -165,15 +164,10 @@ class FieldInput extends React.Component { } else if (fieldSchema.constraints && fieldSchema.constraints.enum) { return ( - - { - this.state.options.map((item, index) => { - return ( - - ) - }) - } - +