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 {
72
72
* Update the document in the database.
73
73
*
74
74
* @param {Object } object - The replacement document.
75
+ *
76
+ * @todo : Durran: Determine shard key.
75
77
*/
76
78
update : function ( object ) {
77
79
app . dataService . findOneAndReplace (
Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ class EditableElement extends React.Component {
255
255
* @returns {Component } The value component.
256
256
*/
257
257
valueComponent ( type ) {
258
- return require ( VALUE_MAPPINGS [ type ] ) ;
258
+ return require ( VALUE_MAPPINGS [ type ] || './non-editable-value' ) ;
259
259
}
260
260
}
261
261
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