Skip to content

Commit 2874cca

Browse files
Merge branch 'log-icon' into log-components
2 parents 10f3d37 + e25a66c commit 2874cca

File tree

17 files changed

+87
-66
lines changed

17 files changed

+87
-66
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nginx:1.15-alpine
1+
FROM nginx:1.20-alpine
22
COPY dist/hypertrace-ui /usr/share/nginx/html
33
COPY conf/default.conf /etc/nginx/conf.d/default.conf
44
EXPOSE 2020

projects/components/src/popover/popover.component.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
OnDestroy,
1010
Output
1111
} from '@angular/core';
12-
import { Subscription } from 'rxjs';
1312
import { PopoverBackdrop, PopoverPositionType, PopoverRelativePositionLocation } from './popover';
1413
import { PopoverContentComponent } from './popover-content.component';
1514
import { PopoverRef } from './popover-ref';
@@ -51,12 +50,14 @@ export class PopoverComponent implements OnDestroy {
5150
@ContentChild(PopoverContentComponent, { static: true })
5251
public content!: PopoverContentComponent;
5352

54-
private subscription?: Subscription;
53+
private popover?: PopoverRef;
5554

5655
public constructor(private readonly popoverService: PopoverService, private readonly popoverElement: ElementRef) {}
5756

5857
public ngOnDestroy(): void {
59-
this.subscription?.unsubscribe();
58+
if (!this.popover?.closed) {
59+
this.popover?.close();
60+
}
6061
}
6162

6263
@HostListener('click')
@@ -65,7 +66,7 @@ export class PopoverComponent implements OnDestroy {
6566
return;
6667
}
6768

68-
const popover = this.popoverService.drawPopover({
69+
this.popover = this.popoverService.drawPopover({
6970
position: {
7071
type: PopoverPositionType.Relative,
7172
origin: this.popoverElement,
@@ -76,17 +77,17 @@ export class PopoverComponent implements OnDestroy {
7677
});
7778

7879
// Closing can happen internal to the Popover for things like closeOnBackdropClick. Let the consumer know.
79-
this.subscription = popover.closed$.subscribe(() => this.popoverClose.emit());
80+
this.popover.closed$.subscribe(() => this.popoverClose.emit());
8081

81-
popover.closeOnBackdropClick();
82+
this.popover.closeOnBackdropClick();
8283

8384
if (this.closeOnClick) {
84-
popover.closeOnPopoverContentClick();
85+
this.popover.closeOnPopoverContentClick();
8586
}
8687
if (this.closeOnNavigate) {
87-
popover.closeOnNavigation();
88+
this.popover.closeOnNavigation();
8889
}
8990

90-
this.popoverOpen.emit(popover);
91+
this.popoverOpen.emit(this.popover);
9192
}
9293
}

projects/distributed-tracing/src/shared/dashboard/data/graphql/waterfall/trace-waterfall-data-source.model.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,12 @@ describe('Trace Waterfall data source model', () => {
9898
})
9999
],
100100
logEventProperties: [
101-
expect.objectContaining({
102-
name: 'traceId'
103-
}),
104101
expect.objectContaining({
105102
name: 'attributes'
106103
}),
107104
expect.objectContaining({
108105
name: 'timestamp'
109106
}),
110-
expect.objectContaining({
111-
name: 'spanId'
112-
}),
113107
expect.objectContaining({
114108
name: 'summary'
115109
})
@@ -175,18 +169,12 @@ describe('Trace Waterfall data source model', () => {
175169
})
176170
],
177171
logEventProperties: [
178-
expect.objectContaining({
179-
name: 'traceId'
180-
}),
181172
expect.objectContaining({
182173
name: 'attributes'
183174
}),
184175
expect.objectContaining({
185176
name: 'timestamp'
186177
}),
187-
expect.objectContaining({
188-
name: 'spanId'
189-
}),
190178
expect.objectContaining({
191179
name: 'summary'
192180
})

projects/distributed-tracing/src/shared/dashboard/data/graphql/waterfall/trace-waterfall-data-source.model.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ export class TraceWaterfallDataSourceModel extends GraphQlDataSourceModel<Waterf
6161
];
6262

6363
protected readonly logEventSpecifications: Specification[] = [
64-
this.specificationBuilder.attributeSpecificationForKey('traceId'),
6564
this.specificationBuilder.attributeSpecificationForKey('attributes'),
6665
this.specificationBuilder.attributeSpecificationForKey('timestamp'),
67-
this.specificationBuilder.attributeSpecificationForKey('spanId'),
6866
this.specificationBuilder.attributeSpecificationForKey('summary')
6967
];
7068

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/waterfall-chart.component.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ describe('Waterfall Chart component', () => {
3131
responseHeaders: {},
3232
responseBody: 'Response Body',
3333
tags: {},
34-
errorCount: 0
34+
errorCount: 0,
35+
logEvents: []
3536
},
3637
{
3738
id: 'second-id',
@@ -52,7 +53,8 @@ describe('Waterfall Chart component', () => {
5253
responseHeaders: {},
5354
responseBody: '',
5455
tags: {},
55-
errorCount: 0
56+
errorCount: 0,
57+
logEvents: []
5658
},
5759
{
5860
id: 'third-id',
@@ -73,7 +75,8 @@ describe('Waterfall Chart component', () => {
7375
responseHeaders: {},
7476
responseBody: '',
7577
tags: {},
76-
errorCount: 0
78+
errorCount: 0,
79+
logEvents: []
7780
}
7881
];
7982

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/waterfall-chart.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class WaterfallChartService {
4343
serviceName: datum.serviceName,
4444
protocolName: datum.protocolName,
4545
hasError: datum.errorCount > 0,
46-
hasLogs: datum.logEvents && datum.logEvents.length > 0
46+
hasLogs: datum.logEvents.length > 0
4747
},
4848
$$iconType: this.iconLookupService.forSpanType(datum.spanType)!,
4949
getChildren: () => of([]),

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/waterfall-chart.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface WaterfallData {
2323
responseBody?: string;
2424
tags: Dictionary<unknown>;
2525
errorCount: number;
26-
logEvents?: LogEvent[];
26+
logEvents: LogEvent[];
2727
}
2828

2929
export interface WaterfallDataNode extends WaterfallData, Omit<StatefulPrefetchedTreeTableRow, '$$state'> {
@@ -40,9 +40,6 @@ export interface WaterfallChartState {
4040
}
4141

4242
export interface LogEvent {
43-
[key: string]: unknown;
44-
traceId: string;
45-
spanId: string;
4643
attributes: Dictionary<unknown>;
4744
timestamp: string;
4845
summary: string;

projects/observability/src/shared/components/entity-renderer/entity-renderer.component.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('Entity Renderer Component', () => {
8383

8484
expect(rendererElement).toHaveClass('navigable');
8585
spectator.dispatchFakeEvent(rendererElement, 'click');
86-
expect(entityNavService.navigateToEntity).toHaveBeenCalledWith(entity);
86+
expect(entityNavService.navigateToEntity).toHaveBeenCalledWith(entity, false);
8787
});
8888

8989
test('renders an entity without icon by default', () => {

projects/observability/src/shared/components/entity-renderer/entity-renderer.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export class EntityRendererComponent implements OnChanges {
3232
@Input()
3333
public entity?: Entity;
3434

35+
@Input()
36+
public inactive: boolean = false;
37+
3538
@Input()
3639
public navigable: boolean = true;
3740

@@ -59,8 +62,9 @@ export class EntityRendererComponent implements OnChanges {
5962
this.setIconType();
6063
}
6164
}
65+
6266
public onClickNavigate(): void {
63-
this.navigable && this.entity && this.entityNavService.navigateToEntity(this.entity);
67+
this.navigable && this.entity && this.entityNavService.navigateToEntity(this.entity, this.inactive);
6468
}
6569

6670
private setName(): void {
Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
11
import { TableCellParser, TableCellParserBase, TableRow } from '@hypertrace/components';
22
import { Entity, entityIdKey } from '../../../../graphql/model/schema/entity';
33
import { ObservabilityTableCellType } from '../../observability-table-cell-type';
4-
import { parseEntityFromTableRow } from './entity-table-cell-renderer-util';
4+
import { isInactiveEntity, parseEntityFromTableRow } from './entity-table-cell-renderer-util';
55

66
@TableCellParser({
77
type: ObservabilityTableCellType.Entity
88
})
99
export class EntityTableCellParser extends TableCellParserBase<CellData, CellData, string | undefined> {
1010
public parseValue(cellData: CellData, row: TableRow): CellData {
11-
return parseEntityFromTableRow(cellData, row);
11+
const entity = parseEntityFromTableRow(cellData, row);
12+
13+
if (entity === undefined) {
14+
return undefined;
15+
}
16+
17+
return {
18+
...entity,
19+
isInactive: isInactiveEntity(row) === true
20+
};
1221
}
1322

1423
public parseFilterValue(cellData: CellData): string | undefined {
1524
return cellData !== undefined ? cellData[entityIdKey] : undefined;
1625
}
1726
}
1827

19-
type CellData = Entity | undefined;
28+
type CellData = MaybeInactiveEntity | undefined;
29+
30+
export interface MaybeInactiveEntity extends Entity {
31+
isInactive: boolean;
32+
}

0 commit comments

Comments
 (0)