File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed
src/internal-packages/crud/lib/component Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ class Document extends React.Component {
7272 * Update the document in the database.
7373 *
7474 * @param {Object } object - The replacement document.
75+ *
76+ * @todo : Durran: Determine shard key.
7577 */
7678 update : function ( object ) {
7779 app . dataService . findOneAndReplace (
Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ class EditableElement extends React.Component {
255255 * @returns {Component } The value component.
256256 */
257257 valueComponent ( type ) {
258- return require ( VALUE_MAPPINGS [ type ] ) ;
258+ return require ( VALUE_MAPPINGS [ type ] || './non-editable-value' ) ;
259259 }
260260}
261261
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const React = require ( 'react' ) ;
4+
5+ /**
6+ * The document value class.
7+ */
8+ const VALUE_CLASS = 'document-property-value' ;
9+
10+ /**
11+ * Non editable value component.
12+ */
13+ class NonEditableValue extends React . Component {
14+
15+ /**
16+ * The component constructor.
17+ *
18+ * @param {Object } props - The properties.
19+ */
20+ constructor ( props ) {
21+ super ( props ) ;
22+ this . value = props . element . currentValue ;
23+ }
24+
25+ /**
26+ * Render a single non editable value.
27+ *
28+ * @returns {React.Component } The element component.
29+ */
30+ render ( ) {
31+ return (
32+ < div className = { VALUE_CLASS } >
33+ { String ( this . value ) }
34+ </ div >
35+ ) ;
36+ }
37+ }
38+
39+ NonEditableValue . displayName = 'NonEditableValue' ;
40+
41+ module . exports = NonEditableValue ;
You can’t perform that action at this time.
0 commit comments