@@ -12,6 +12,7 @@ import DragHandle from 'components/DragHandle/DragHandle.react';
12
12
import CreateViewDialog from './CreateViewDialog.react' ;
13
13
import EditViewDialog from './EditViewDialog.react' ;
14
14
import DeleteViewDialog from './DeleteViewDialog.react' ;
15
+ import ViewValueDialog from './ViewValueDialog.react' ;
15
16
import BrowserMenu from 'components/BrowserMenu/BrowserMenu.react' ;
16
17
import MenuItem from 'components/BrowserMenu/MenuItem.react' ;
17
18
import Separator from 'components/BrowserMenu/Separator.react' ;
@@ -48,6 +49,7 @@ class Views extends TableView {
48
49
lastError : null ,
49
50
lastNote : null ,
50
51
loading : false ,
52
+ viewValue : null ,
51
53
} ;
52
54
this . headersRef = React . createRef ( ) ;
53
55
this . noteTimeout = null ;
@@ -149,7 +151,11 @@ class Views extends TableView {
149
151
if ( val . __type === 'Date' ) {
150
152
type = 'Date' ;
151
153
} else if ( val . __type === 'Pointer' ) {
152
- type = 'Pointer' ;
154
+ if ( val . className && val . objectId ) {
155
+ type = 'Pointer' ;
156
+ } else {
157
+ type = 'Object' ;
158
+ }
153
159
} else if ( val . __type === 'File' ) {
154
160
type = 'File' ;
155
161
} else if ( val . __type === 'GeoPoint' ) {
@@ -264,7 +270,11 @@ class Views extends TableView {
264
270
if ( value . __type === 'Date' ) {
265
271
type = 'Date' ;
266
272
} else if ( value . __type === 'Pointer' ) {
267
- type = 'Pointer' ;
273
+ if ( value . className && value . objectId ) {
274
+ type = 'Pointer' ;
275
+ } else {
276
+ type = 'Object' ;
277
+ }
268
278
} else if ( value . __type === 'File' ) {
269
279
type = 'File' ;
270
280
} else if ( value . __type === 'GeoPoint' ) {
@@ -290,8 +300,14 @@ class Views extends TableView {
290
300
} else {
291
301
content = String ( value ) ;
292
302
}
303
+ const isViewable = [ 'String' , 'Number' , 'Object' ] . includes ( type ) ;
304
+ const cellProps = { } ;
305
+ if ( isViewable ) {
306
+ cellProps . onClick = ( ) => this . handleValueClick ( value ) ;
307
+ cellProps . style = { cursor : 'pointer' } ;
308
+ }
293
309
return (
294
- < td key = { name } className = { styles . cell } >
310
+ < td key = { name } className = { styles . cell } { ... cellProps } >
295
311
{ content }
296
312
</ td >
297
313
) ;
@@ -435,7 +451,14 @@ class Views extends TableView {
435
451
436
452
renderExtras ( ) {
437
453
let extras = null ;
438
- if ( this . state . showCreate ) {
454
+ if ( this . state . viewValue !== null ) {
455
+ extras = (
456
+ < ViewValueDialog
457
+ value = { this . state . viewValue }
458
+ onClose = { ( ) => this . setState ( { viewValue : null } ) }
459
+ />
460
+ ) ;
461
+ } else if ( this . state . showCreate ) {
439
462
let classNames = [ ] ;
440
463
if ( this . props . schema ?. data ) {
441
464
const classes = this . props . schema . data . get ( 'classes' ) ;
@@ -534,6 +557,10 @@ class Views extends TableView {
534
557
this . props . navigate ( path ) ;
535
558
}
536
559
560
+ handleValueClick ( value ) {
561
+ this . setState ( { viewValue : value } ) ;
562
+ }
563
+
537
564
showNote ( message , isError ) {
538
565
if ( ! message ) {
539
566
return ;
0 commit comments