From 8e6c54564b783a47ad16dc031441fd5b884658ec Mon Sep 17 00:00:00 2001 From: orangemug Date: Sat, 25 Apr 2020 11:38:13 +0100 Subject: [PATCH 1/2] Add to source tile urls to support multiple values. --- src/components/inputs/DynamicArrayInput.jsx | 12 ++++++++++- src/components/sources/SourceTypeEditor.jsx | 24 +++++++++------------ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/components/inputs/DynamicArrayInput.jsx b/src/components/inputs/DynamicArrayInput.jsx index 84d6bb9..9fa05c6 100644 --- a/src/components/inputs/DynamicArrayInput.jsx +++ b/src/components/inputs/DynamicArrayInput.jsx @@ -7,6 +7,7 @@ import {MdDelete} from 'react-icons/md' import DocLabel from '../fields/DocLabel' import EnumInput from '../inputs/SelectInput' import capitalize from 'lodash.capitalize' +import UrlInput from '../inputs/UrlInput' class DynamicArrayInput extends React.Component { @@ -35,6 +36,9 @@ class DynamicArrayInput extends React.Component { if (this.props.type === 'number') { values.push(0) } + else if (this.props.type === 'url') { + values.push(""); + } else if (this.props.type === 'enum') { const {fieldSpec} = this.props; const defaultValue = Object.keys(fieldSpec.values)[0]; @@ -57,7 +61,13 @@ class DynamicArrayInput extends React.Component { const inputs = this.values.map((v, i) => { const deleteValueBtn= let input; - if (this.props.type === 'number') { + if(this.props.type === 'url') { + input = + } + else if (this.props.type === 'number') { input = { - return - - - }) + const tiles = this.props.source.tiles || []; + return + + } render() { From 0a8d0974ca8d83b9cda977ce4ad5b9481a41d5e1 Mon Sep 17 00:00:00 2001 From: orangemug Date: Sat, 25 Apr 2020 13:31:15 +0100 Subject: [PATCH 2/2] Fixed field spec for image/video. --- src/components/sources/SourceTypeEditor.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/sources/SourceTypeEditor.jsx b/src/components/sources/SourceTypeEditor.jsx index 363dace..425ed4d 100644 --- a/src/components/sources/SourceTypeEditor.jsx +++ b/src/components/sources/SourceTypeEditor.jsx @@ -104,7 +104,7 @@ class ImageSourceEditor extends React.Component { } return
- + this.props.onChange({ @@ -155,7 +155,7 @@ class VideoSourceEditor extends React.Component { } return
- +