From 868b9eaf36de9877c62a5f09bd580b5a2ae739f2 Mon Sep 17 00:00:00 2001 From: Naeem Baghi Date: Tue, 25 Dec 2018 15:36:21 +0330 Subject: [PATCH 1/2] Examples: add title for arrays --- example/data/array.json | 1 + example/data/simplearray.json | 1 + 2 files changed, 2 insertions(+) diff --git a/example/data/array.json b/example/data/array.json index 63cdaab4..cf2806ec 100644 --- a/example/data/array.json +++ b/example/data/array.json @@ -6,6 +6,7 @@ "properties": { "comments": { "type": "array", + "title": "Comments", "maxItems": 2, "items": { "type": "object", diff --git a/example/data/simplearray.json b/example/data/simplearray.json index bb18a0d9..4af9f97b 100644 --- a/example/data/simplearray.json +++ b/example/data/simplearray.json @@ -6,6 +6,7 @@ "properties": { "comments": { "type": "array", + "title": "Comments", "maxItems": 2, "items": { "type": "object", From 4990b7eca821953b3df6b1df38a105d57d136038 Mon Sep 17 00:00:00 2001 From: Naeem Baghi Date: Tue, 25 Dec 2018 16:02:05 +0330 Subject: [PATCH 2/2] Add asterisk for required field's labels and some minor improvements --- src/Array.js | 8 +++--- src/Checkbox.js | 2 +- src/FieldSet.js | 4 +-- src/MultiSelect.js | 15 ++++++++--- src/NativeDateField.js | 35 ++++++++++++------------ src/Number.js | 44 +++++++++---------------------- src/Radios.js | 6 ++--- src/Select.js | 10 ++++--- src/Text.js | 23 ++++++++++++---- src/TextArea.js | 37 ++++++++++---------------- src/TripleBoolean.js | 7 +++-- src/__tests__/DateCapture-test.js | 4 +-- 12 files changed, 96 insertions(+), 99 deletions(-) diff --git a/src/Array.js b/src/Array.js index 2b9de922..ab438812 100644 --- a/src/Array.js +++ b/src/Array.js @@ -8,8 +8,8 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import IconButton from "@material-ui/core/IconButton"; import DeleteIcon from "@material-ui/icons/Close"; -import Typography from "@material-ui/core/Typography"; import cloneDeep from "lodash/cloneDeep"; +import FormLabel from "@material-ui/core/FormLabel"; import utils from "./utils"; import ComposedComponent from "./ComposedComponent"; import type { Localization } from "./types"; @@ -208,9 +208,9 @@ class Array extends Component { return (
- - {getLocalizedString(form.title)} - + + {form.title && getLocalizedString(form.title)} +
{arrays}