diff --git a/src/internal-packages/crud/lib/component/document.jsx b/src/internal-packages/crud/lib/component/document.jsx index 99769588d4e..5675839f714 100644 --- a/src/internal-packages/crud/lib/component/document.jsx +++ b/src/internal-packages/crud/lib/component/document.jsx @@ -72,6 +72,8 @@ class Document extends React.Component { * Update the document in the database. * * @param {Object} object - The replacement document. + * + * @todo: Durran: Determine shard key. */ update: function(object) { app.dataService.findOneAndReplace( diff --git a/src/internal-packages/crud/lib/component/editable-element.jsx b/src/internal-packages/crud/lib/component/editable-element.jsx index ccd29de63c6..fe5b0602319 100644 --- a/src/internal-packages/crud/lib/component/editable-element.jsx +++ b/src/internal-packages/crud/lib/component/editable-element.jsx @@ -255,7 +255,7 @@ class EditableElement extends React.Component { * @returns {Component} The value component. */ valueComponent(type) { - return require(VALUE_MAPPINGS[type]); + return require(VALUE_MAPPINGS[type] || './non-editable-value'); } } diff --git a/src/internal-packages/crud/lib/component/non-editable-value.jsx b/src/internal-packages/crud/lib/component/non-editable-value.jsx new file mode 100644 index 00000000000..c1d3a91e3d3 --- /dev/null +++ b/src/internal-packages/crud/lib/component/non-editable-value.jsx @@ -0,0 +1,41 @@ +'use strict'; + +const React = require('react'); + +/** + * The document value class. + */ +const VALUE_CLASS = 'document-property-value'; + +/** + * Non editable value component. + */ +class NonEditableValue extends React.Component { + + /** + * The component constructor. + * + * @param {Object} props - The properties. + */ + constructor(props) { + super(props); + this.value = props.element.currentValue; + } + + /** + * Render a single non editable value. + * + * @returns {React.Component} The element component. + */ + render() { + return ( +
+ {String(this.value)} +
+ ); + } +} + +NonEditableValue.displayName = 'NonEditableValue'; + +module.exports = NonEditableValue;