Skip to content

Commit 8246dd2

Browse files
authored
Merge branch 'main' into add-filter-operators
2 parents 873861a + f0295d8 commit 8246dd2

File tree

14 files changed

+32005
-3787
lines changed

14 files changed

+32005
-3787
lines changed

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@hypertrace:registry=https://api.bintray.com/npm/hypertrace/npm
1+
@hypertrace:registry=https://hypertrace.jfrog.io/artifactory/api/npm/npm/

package-lock.json

Lines changed: 31767 additions & 3768 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"ts-node": "~9.1.1",
110110
"tslint": "~6.1.3",
111111
"tslint-config-prettier": "^1.18.0",
112-
"typescript": "^4.1.5",
112+
"typescript": "~4.1.5",
113113
"typescript-tslint-plugin": "^1.0.1"
114114
},
115115
"config": {

projects/components/src/multi-select/multi-select.component.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,34 @@ describe('Multi Select Component', () => {
138138
});
139139
}));
140140

141+
test('should block prevent default when checkbox is clicked', fakeAsync(() => {
142+
const onChange = jest.fn();
143+
spectator = hostFactory(
144+
`
145+
<ht-multi-select (selectedChange)="onChange($event)" [selected]="selected">
146+
<ht-select-option *ngFor="let option of options" [label]="option.label" [value]="option.value">
147+
</ht-select-option>
148+
</ht-multi-select>`,
149+
{
150+
hostProps: {
151+
options: selectionOptions,
152+
selected: [],
153+
onChange: onChange
154+
}
155+
}
156+
);
157+
158+
spectator.tick();
159+
spectator.click('.trigger-content');
160+
const selectedCheckboxElement = spectator.queryAll('ht-checkbox', { root: true })[0];
161+
expect(spectator.dispatchFakeEvent(selectedCheckboxElement, 'click', true).defaultPrevented).toBe(true);
162+
163+
expect(onChange).toHaveBeenCalledTimes(1);
164+
expect(onChange).toHaveBeenCalledWith([selectionOptions[0].value]);
165+
expect(spectator.query(LabelComponent)?.label).toEqual('first');
166+
flush();
167+
}));
168+
141169
test('should notify and update selection when selection is changed', fakeAsync(() => {
142170
const onChange = jest.fn();
143171

projects/components/src/multi-select/multi-select.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ import { MultiSelectJustify } from './multi-select-justify';
9292
(click)="this.onSelectionChange(item)"
9393
class="multi-select-option"
9494
>
95-
<ht-checkbox class="checkbox" [checked]="this.isSelectedItem(item)"></ht-checkbox>
95+
<ht-checkbox
96+
class="checkbox"
97+
(click)="this.preventClickDefault($event)"
98+
[checked]="this.isSelectedItem(item)"
99+
></ht-checkbox>
96100
<ht-icon
97101
class="icon"
98102
*ngIf="item.icon"
@@ -210,6 +214,10 @@ export class MultiSelectComponent<V> implements AfterContentInit, OnChanges {
210214
return this.selected !== undefined && this.selected.filter(value => value === item.value).length > 0;
211215
}
212216

217+
public preventClickDefault(event: Event): void {
218+
event.preventDefault();
219+
}
220+
213221
private setSelection(selected: V[]): void {
214222
this.selected = selected;
215223
this.setTriggerLabel();

projects/components/src/time-range/time-range.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
.trigger {
1616
display: flex;
1717
align-items: center;
18-
height: 32px;
18+
height: 36px;
1919
cursor: pointer;
2020

2121
.trigger-icon {

projects/distributed-tracing/src/shared/graphql/request/handlers/traces/traces-graphql-query-handler.service.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
22
import { Dictionary, forkJoinSafeEmpty } from '@hypertrace/common';
33
import { GraphQlHandlerType, GraphQlQueryHandler, GraphQlSelection } from '@hypertrace/graphql-client';
44
import { Observable } from 'rxjs';
5-
import { map } from 'rxjs/operators';
5+
import { defaultIfEmpty, map } from 'rxjs/operators';
66
import { MetadataService } from '../../../../services/metadata/metadata.service';
77
import { GlobalGraphQlFilterService } from '../../../model/schema/filter/global-graphql-filter.service';
88
import { GraphQlFilter } from '../../../model/schema/filter/graphql-filter';
@@ -98,9 +98,10 @@ export class TracesGraphQlQueryHandlerService implements GraphQlQueryHandler<Gra
9898
}
9999

100100
private resultUnits(specification: Specification, scope: string): Observable<string | undefined> {
101-
return this.metadataService
102-
.getAttribute(scope, specification.name)
103-
.pipe(map(attribute => (attribute.units !== '' ? attribute.units : undefined)));
101+
return this.metadataService.getAttribute(scope, specification.name).pipe(
102+
map(attribute => (attribute.units !== '' ? attribute.units : undefined)),
103+
defaultIfEmpty<string | undefined>(undefined)
104+
);
104105
}
105106
}
106107

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { CoreTableCellRendererType, TableMode, TableSortDirection, TableStyle } from '@hypertrace/components';
22
import { TracingTableCellType } from '@hypertrace/distributed-tracing';
3+
import { ObservabilityTableCellType } from '../../../../shared/components/table/observability-table-cell-type';
34
import { ObservabilityTraceType } from '../../../../shared/graphql/model/schema/observability-traces';
45

56
export const apiTraceListDashboard = {
@@ -24,10 +25,21 @@ export const apiTraceListDashboard = {
2425
{
2526
type: 'table-widget-column',
2627
title: 'Exit Calls',
27-
filterable: true,
28+
filterable: false,
29+
display: ObservabilityTableCellType.ExitCalls,
2830
value: {
29-
type: 'attribute-specification',
30-
attribute: 'apiExitCalls'
31+
type: 'composite-specification',
32+
specifications: [
33+
{
34+
type: 'attribute-specification',
35+
attribute: 'apiExitCalls'
36+
},
37+
{
38+
type: 'attribute-specification',
39+
attribute: 'apiCalleeNameCount'
40+
}
41+
],
42+
'order-by': 'apiExitCalls'
3143
},
3244
'click-handler': {
3345
type: 'api-trace-navigation-handler'

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { CoreTableCellRendererType, TableMode, TableSortDirection, TableStyle } from '@hypertrace/components';
22
import { TracingTableCellType } from '@hypertrace/distributed-tracing';
3+
import { ObservabilityTableCellType } from '../../../../shared/components/table/observability-table-cell-type';
34
import { ObservabilityTraceType } from '../../../../shared/graphql/model/schema/observability-traces';
45

56
export const serviceTraceListDashboard = {
@@ -50,10 +51,21 @@ export const serviceTraceListDashboard = {
5051
{
5152
type: 'table-widget-column',
5253
title: 'Exit Calls',
53-
filterable: true,
54+
filterable: false,
55+
display: ObservabilityTableCellType.ExitCalls,
5456
value: {
55-
type: 'attribute-specification',
56-
attribute: 'apiExitCalls'
57+
type: 'composite-specification',
58+
specifications: [
59+
{
60+
type: 'attribute-specification',
61+
attribute: 'apiExitCalls'
62+
},
63+
{
64+
type: 'attribute-specification',
65+
attribute: 'apiCalleeNameCount'
66+
}
67+
],
68+
'order-by': 'apiExitCalls'
5769
},
5870
'click-handler': {
5971
type: 'api-trace-navigation-handler'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@import 'color-palette';
2+
@import 'font';
3+
4+
.exit-calls-count {
5+
@include body-1-regular($gray-7);
6+
}
7+
8+
.api-callee-name-entries {
9+
@include body-small($gray-3);
10+
display: flex;
11+
align-items: center;
12+
justify-content: space-between;
13+
padding: 2px;
14+
15+
.api-callee-name {
16+
@include ellipsis-overflow();
17+
max-width: 200px;
18+
}
19+
20+
.api-callee-count {
21+
color: white;
22+
margin-left: 50px;
23+
}
24+
}
25+
26+
.remaining-api-callee {
27+
@include body-small($gray-3);
28+
padding: 2px;
29+
}

0 commit comments

Comments
 (0)