Skip to content

Commit f0295d8

Browse files
fix: removing filtering for exit calls cell in trace table (#772)
* feat: show exit calls break up on hover on exit calls cell in trace list * fix: addressing pull request comments * fix: lint errors * fix: addressing review commnet * chore: using composite specification * fix: lint errors and tests * fix: lint errors * fix: remove filtering for exit calls * refactor: addressing review comments * refactor: addressing review comments * refactor: addressing review comments * fix: update tests
1 parent 4d53214 commit f0295d8

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

projects/observability/src/pages/apis/api-detail/traces/api-trace-list.dashboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const apiTraceListDashboard = {
2525
{
2626
type: 'table-widget-column',
2727
title: 'Exit Calls',
28-
filterable: true,
28+
filterable: false,
2929
display: ObservabilityTableCellType.ExitCalls,
3030
value: {
3131
type: 'composite-specification',

projects/observability/src/pages/apis/service-detail/traces/service-trace-list.dashboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const serviceTraceListDashboard = {
5151
{
5252
type: 'table-widget-column',
5353
title: 'Exit Calls',
54-
filterable: true,
54+
filterable: false,
5555
display: ObservabilityTableCellType.ExitCalls,
5656
value: {
5757
type: 'composite-specification',

projects/observability/src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@include body-1-regular($gray-7);
66
}
77

8-
.api-callee-name-count {
8+
.api-callee-name-entries {
99
@include body-small($gray-3);
1010
display: flex;
1111
align-items: center;

projects/observability/src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ describe('Exit Calls table cell renderer component', () => {
3333
});
3434

3535
expect(spectator.queryAll('.exit-calls-count')[0]).toContainText('3');
36-
expect(spectator.component.apiCalleeNameCount).toMatchObject([
36+
expect(spectator.component.apiCalleeNameEntries).toMatchObject([
3737
['key1', '1'],
3838
['key2', '2']
3939
]);
40-
expect(spectator.component.totalCountOfDifferentApiCallee).toBe(2);
40+
expect(spectator.component.uniqueApiCalleeCount).toBe(2);
4141
expect(spectator.component.apiExitCalls).toBe(3);
4242
});
4343
});

projects/observability/src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ interface CellData {
2929
<span class="exit-calls-count">{{ this.apiExitCalls }}</span>
3030
3131
<ng-template #exitCallsTooltip>
32-
<ng-container *ngIf="this.apiExitCalls > 0">
33-
<div *ngFor="let item of this.apiCalleeNameCount" class="api-callee-name-count">
32+
<ng-container *ngIf="this.apiExitCalls > 0; else noExitCalls">
33+
<div *ngFor="let item of this.apiCalleeNameEntries" class="api-callee-name-entries">
3434
<span class="api-callee-name">{{ item[0] }}</span>
3535
<span class="api-callee-count">{{ item[1] }}</span>
3636
</div>
3737
<div
38-
*ngIf="this.totalCountOfDifferentApiCallee > this.maxShowApiCalleeNameCount"
38+
*ngIf="this.uniqueApiCalleeCount > ${ExitCallsTableCellRendererComponent.MAX_API_CALLEES_TO_SHOW}"
3939
class="remaining-api-callee"
4040
>
41-
and {{ this.totalCountOfDifferentApiCallee - this.maxShowApiCalleeNameCount }} more
41+
and {{ this.uniqueApiCalleeCount - ${ExitCallsTableCellRendererComponent.MAX_API_CALLEES_TO_SHOW} }} more
4242
</div>
4343
</ng-container>
44-
<ng-container *ngIf="this.apiExitCalls <= 0" class="no-exit-calls">No exit calls</ng-container>
44+
<ng-template #noExitCalls>No exit calls</ng-template>
4545
</ng-template>
4646
</div>
4747
`
@@ -52,10 +52,10 @@ interface CellData {
5252
parser: CoreTableCellParserType.NoOp
5353
})
5454
export class ExitCallsTableCellRendererComponent extends TableCellRendererBase<CellData, Trace> implements OnInit {
55-
public readonly apiCalleeNameCount: string[][];
55+
public static readonly MAX_API_CALLEES_TO_SHOW: number = 10;
56+
public readonly apiCalleeNameEntries: [string, string][];
5657
public readonly apiExitCalls: number;
57-
public readonly maxShowApiCalleeNameCount: number = 10;
58-
public readonly totalCountOfDifferentApiCallee!: number;
58+
public readonly uniqueApiCalleeCount: number;
5959

6060
public constructor(
6161
@Inject(TABLE_COLUMN_CONFIG) columnConfig: TableColumnConfig,
@@ -66,9 +66,12 @@ export class ExitCallsTableCellRendererComponent extends TableCellRendererBase<C
6666
@Inject(TABLE_ROW_DATA) rowData: Trace
6767
) {
6868
super(columnConfig, index, parser, cellData, rowData);
69-
const apiCalleeNameCount: string[][] = Object.entries(cellData.value[1]);
70-
this.totalCountOfDifferentApiCallee = apiCalleeNameCount.length;
71-
this.apiCalleeNameCount = apiCalleeNameCount.slice(0, this.maxShowApiCalleeNameCount);
69+
const apiCalleeNameEntries: [string, string][] = Object.entries(cellData.value[1]);
70+
this.uniqueApiCalleeCount = apiCalleeNameEntries.length;
71+
this.apiCalleeNameEntries = apiCalleeNameEntries.slice(
72+
0,
73+
ExitCallsTableCellRendererComponent.MAX_API_CALLEES_TO_SHOW
74+
);
7275
this.apiExitCalls = cellData.value[0];
7376
}
7477
}

0 commit comments

Comments
 (0)