Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/distributed-tracing/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export * from './shared/dashboard/data/graphql/filter/graphql-filter-data-source
export * from './shared/dashboard/data/graphql/filter/graphql-filter-data-source.model';
export * from './shared/dashboard/data/graphql/graphql-table-control-options-data-source.model';
export * from './shared/dashboard/data/graphql/graphql-data-source.model';
export * from './shared/dashboard/data/graphql/graphql-options-data-source.model';
export * from './shared/dashboard/data/graphql/graphql-table-control-options-data-source.model';
export * from './shared/dashboard/data/graphql/graphql-query-event.service';
export * from './shared/dashboard/data/graphql/graphql-data-source.module';
export * from './shared/dashboard/data/graphql/specifiers/attribute-specification.model';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { TracingTableCellType } from '../../tracing-table-cell-type';
@TableCellParser({
type: TracingTableCellType.Metric
})
export class MetricTableCellParser extends TableCellParserBase<number, number | null, number | null> {
public parseValue(cellData: CellData): number | null {
export class MetricTableCellParser extends TableCellParserBase<number, CellValue, CellValue> {
public parseValue(cellData: CellData): CellValue {
const extractedValue = this.extractValue(cellData);

return extractedValue === null ? extractedValue : Math.round(this.extractValue(cellData)!);
return extractedValue === undefined ? extractedValue : Math.round(extractedValue);
}

public parseFilterValue(cellData: number): number | null {
public parseFilterValue(cellData: number): CellValue {
return this.parseValue(cellData);
}

Expand All @@ -21,12 +21,12 @@ export class MetricTableCellParser extends TableCellParserBase<number, number |
}

// tslint:disable-next-line:no-null-undefined-union
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this lint rule no longer needed

private extractValue(cellData: CellData): number | undefined | null {
private extractValue(cellData: CellData): CellValue {
switch (typeof cellData) {
case 'number':
return cellData;
case 'object':
return cellData.value;
return cellData === null ? undefined : cellData.value;
default:
return undefined;
}
Expand All @@ -37,11 +37,12 @@ export class MetricTableCellParser extends TableCellParserBase<number, number |
case 'number':
return undefined;
case 'object':
return cellData.units;
return cellData === null ? undefined : cellData.units;
default:
return undefined;
}
}
}

type CellData = number | Partial<MetricAggregation>;
type CellData = number | null | Partial<MetricAggregation>;
type CellValue = number | undefined;
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { TracingTableCellType } from '../../tracing-table-cell-type';
<!-- This displays as "<value> <unit>", e.g. 120 ms -->
<span
>{{ this.value | htDisplayNumber: this.formatter }}
<span *ngIf="this.value !== null && this.units">{{ this.units }}</span></span
<span *ngIf="this.value !== undefined && this.units">{{ this.units }}</span></span
>
</div>
`
Expand Down

This file was deleted.