File tree Expand file tree Collapse file tree 1 file changed +19
-15
lines changed 
packages/compass-connections-navigation/src Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ export const collectionItemActions = ({
199199  type : 'collection'  |  'view'  |  'timeseries' ; 
200200  isRenameCollectionEnabled : boolean ; 
201201} ) : NavigationItemActions  =>  { 
202-   const  actions : NavigationItemActions  =  [ 
202+   const  actions : NullableNavigationItemActions  =  [ 
203203    { 
204204      action : 'open-in-new-tab' , 
205205      label : 'Open in new tab' , 
@@ -208,30 +208,34 @@ export const collectionItemActions = ({
208208  ] ; 
209209
210210  if  ( hasWriteActionsDisabled )  { 
211-     return  actions ; 
211+     return  stripNullActions ( actions ) ; 
212212  } 
213213
214-   if  ( canEditCollection   &&   type  ===  'view' )  { 
214+   if  ( type  ===  'view' )  { 
215215    actions . push ( {  separator : true  } ) ; 
216216    actions . push ( 
217-       { 
218-         action : 'drop-collection' , 
219-         label : 'Drop view' , 
220-         icon : 'Trash' , 
221-       } , 
217+       canEditCollection 
218+         ? { 
219+             action : 'drop-collection' , 
220+             label : 'Drop view' , 
221+             icon : 'Trash' , 
222+           } 
223+         : null , 
222224      { 
223225        action : 'duplicate-view' , 
224226        label : 'Duplicate view' , 
225227        icon : 'Copy' , 
226228      } , 
227-       { 
228-         action : 'modify-view' , 
229-         label : 'Modify view' , 
230-         icon : 'Edit' , 
231-       } 
229+       canEditCollection 
230+         ? { 
231+             action : 'modify-view' , 
232+             label : 'Modify view' , 
233+             icon : 'Edit' , 
234+           } 
235+         : null 
232236    ) ; 
233237
234-     return  actions ; 
238+     return  stripNullActions ( actions ) ; 
235239  } 
236240
237241  if  ( type  !==  'timeseries'  &&  canEditCollection  &&  isRenameCollectionEnabled )  { 
@@ -251,7 +255,7 @@ export const collectionItemActions = ({
251255    } ) ; 
252256  } 
253257
254-   return  actions ; 
258+   return  stripNullActions ( actions ) ; 
255259} ; 
256260
257261export  const  connectionContextMenuActions  =  ( { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments