- 
                Notifications
    
You must be signed in to change notification settings  - Fork 11
 
feat: add navigation handling for inactive entities #815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            9 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      4a47b52
              
                feat: add navigation handling for inactive entities
              
              
                jake-bassett 911a4d2
              
                style: linting
              
              
                jake-bassett bcd3d81
              
                Merge branch 'main' of github.com:hypertrace/hypertrace-ui into endpo…
              
              
                jake-bassett 52781da
              
                feat: look at all aggregations to determine inactive
              
              
                jake-bassett 3fc1d42
              
                style: linting
              
              
                jake-bassett 20fafb4
              
                test: fix
              
              
                jake-bassett f33a635
              
                style: prettier
              
              
                jake-bassett 03abe7d
              
                Update projects/observability/src/shared/components/table/data-cell/e…
              
              
                jake-bassett 85604f8
              
                Merge branch 'main' into endpoint-list-drilldown
              
              
                jake-bassett File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
  
    
      
          
            19 changes: 16 additions & 3 deletions
          
          19 
        
  ...ts/observability/src/shared/components/table/data-cell/entity/entity-table-cell-parser.ts
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,19 +1,32 @@ | ||
| import { TableCellParser, TableCellParserBase, TableRow } from '@hypertrace/components'; | ||
| import { Entity, entityIdKey } from '../../../../graphql/model/schema/entity'; | ||
| import { ObservabilityTableCellType } from '../../observability-table-cell-type'; | ||
| import { parseEntityFromTableRow } from './entity-table-cell-renderer-util'; | ||
| import { isInactiveEntity, parseEntityFromTableRow } from './entity-table-cell-renderer-util'; | ||
| 
     | 
||
| @TableCellParser({ | ||
| type: ObservabilityTableCellType.Entity | ||
| }) | ||
| export class EntityTableCellParser extends TableCellParserBase<CellData, CellData, string | undefined> { | ||
| public parseValue(cellData: CellData, row: TableRow): CellData { | ||
| return parseEntityFromTableRow(cellData, row); | ||
| const entity = parseEntityFromTableRow(cellData, row); | ||
| 
     | 
||
| if (entity === undefined) { | ||
| return undefined; | ||
| } | ||
| 
     | 
||
| return { | ||
| ...entity, | ||
| isInactive: isInactiveEntity(row) === true | ||
                
      
                  jake-bassett marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| }; | ||
| } | ||
| 
     | 
||
| public parseFilterValue(cellData: CellData): string | undefined { | ||
| return cellData !== undefined ? cellData[entityIdKey] : undefined; | ||
| } | ||
| } | ||
| 
     | 
||
| type CellData = Entity | undefined; | ||
| type CellData = MaybeInactiveEntity | undefined; | ||
| 
     | 
||
| export interface MaybeInactiveEntity extends Entity { | ||
| isInactive: boolean; | ||
| } | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does inactive do? why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If an entity is inactive, it means we haven't seen any spans in the time range. Therefore, some of the screens won't show any data available and we may want to navigate to alternative pages instead for those APIs when drilled in to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is it same as under discovery entity?
The name is not clear honestly.
navigationFunction(entityId, sourceRoute, isInactive)i guess this alternate url would be defined in the entity map?