Portal list configuration

This commit is contained in:
2020-03-03 16:05:27 -06:00
parent 8ab376a581
commit 2117659510
3 changed files with 47 additions and 8 deletions

View File

@@ -19,6 +19,8 @@ export default connect(null, mapDispatchToProps)(props => {
const target = e.target;
if (target.type === 'checkbox') {
target.value = e.target.checked ? 'true' : 'false';
} else if (target.type === 'textarea') {
e.target.string_array = String(e.target.value).replace(/\r\n/g,'\n').split('\n');
}
props.changed(target);
};
@@ -118,6 +120,18 @@ export default connect(null, mapDispatchToProps)(props => {
value={props.value}/>;
break;
case 'string_array':
data = (
<textarea autoFocus={props.autoFocus}
disabled={props.readOnly}
rows={4}
cols={40}
onChange={e=>handleChanged(e)}
className={'ConfigurationItemInput'}
value={props.value.join('\n')} />
);
break;
default:
data = <div>{props.value}</div>;
}
@@ -130,7 +144,7 @@ export default connect(null, mapDispatchToProps)(props => {
<tr>
{infoDisplay ?
<td width='100%'>{infoDisplay} {props.label}</td> :
<td width='100%'>{props.label}</td>}
<td width='100%' valign={'top'}>{props.label}</td>}
<td>{data}</td>
</tr>
</tbody>