diff --git a/app/src/frontend/multi-edit.js b/app/src/frontend/multi-edit.js index 231dfa7a..c4f2e0e5 100644 --- a/app/src/frontend/multi-edit.js +++ b/app/src/frontend/multi-edit.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import { Link, Redirect } from 'react-router-dom'; import { parse } from 'query-string'; import PropTypes from 'prop-types'; @@ -6,6 +6,7 @@ import PropTypes from 'prop-types'; import Sidebar from './sidebar'; import CONFIG from './fields-config.json'; import InfoBox from './info-box'; +import { sanitiseURL } from './helpers'; const MultiEdit = (props) => { if (!props.user){ @@ -44,16 +45,16 @@ const MultiEdit = (props) => {

{title}

+
{ Object.keys(data).map((key => { const label = fieldTitleFromSlug(key); - return (

- Set {label} to {data[key]} -

) + return })) } +
- + Back to view Back to edit @@ -69,6 +70,37 @@ MultiEdit.propTypes = { location: PropTypes.object } +const DataEntry = (props) => { + let content; + + if (props.value != null && props.value !== '') { + if (typeof(props.value) === 'boolean') { + content = (props.value)? 'Yes' : 'No' + } else if (Array.isArray(props.value)) { + if (props.value.length) { + content =
    { + props.value.map((item, index) => { + return
  • {item}
  • + }) + }
+ } else { + content = '\u00A0' + } + } else { + content = props.value + } + } else { + content = '\u00A0' + } + + return ( + +
{props.label}
+
{content}
+
+ ) +} + function sectionTitleFromCat(cat) { for (let index = 0; index < CONFIG.length; index++) { const section = CONFIG[index];