File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed 
packages/graph-explorer/src Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,11 @@ describe("scalar", () => {
158158      expect ( result ) . toBe ( "hello world" ) ; 
159159    } ) ; 
160160
161+     it ( "should return EMPTY_VALUE for empty string scalar" ,  ( )  =>  { 
162+       const  result  =  getDisplayValueForScalar ( "   " ) ; 
163+       expect ( result ) . toBe ( LABELS . EMPTY_VALUE ) ; 
164+     } ) ; 
165+ 
161166    it ( "should return number for integer scalar" ,  ( )  =>  { 
162167      const  result  =  getDisplayValueForScalar ( 123456 ) ; 
163168      expect ( result ) . toBe ( "123,456" ) ; 
Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ export function getDisplayValueForScalar(value: ScalarValue) {
9393  const  typedValue  =  createTypedValue ( value ) ; 
9494  switch  ( typedValue . type )  { 
9595    case  "string" :
96-       return  typedValue . value ; 
96+       // Check for empty string 
97+       return  ! typedValue . value . trim ( )  ? LABELS . EMPTY_VALUE  : typedValue . value ; 
9798    case  "number" :
9899      return  new  Intl . NumberFormat ( ) . format ( typedValue . value ) ; 
99100    case  "boolean" :
Original file line number Diff line number Diff line change @@ -38,4 +38,6 @@ export const LABELS = {
3838  MISSING_TYPE : `${ ASCII . LAQUO } ${ ASCII . RAQUO }  , 
3939  /** Shown when a value is missing */ 
4040  MISSING_VALUE : `${ ASCII . LAQUO } ${ ASCII . RAQUO }  , 
41+   /** Shown when a value is empty (like empty string) */ 
42+   EMPTY_VALUE : `${ ASCII . LAQUO } ${ ASCII . RAQUO }  , 
4143}  as  const ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments