Skip to content

Commit a2d6dc0

Browse files
Merge branch 'main' into i-frame
2 parents 1d74c80 + 5084896 commit a2d6dc0

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

projects/graphql-client/src/graphql-request.service.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Inject, Injectable } from '@angular/core';
22
import { Apollo, gql } from 'apollo-angular';
3-
import { includes, uniq } from 'lodash-es';
3+
import { includes, isNil, uniq } from 'lodash-es';
44
import { defer, EMPTY, Observable, Observer, of, Subject, zip } from 'rxjs';
5-
import { buffer, catchError, debounceTime, filter, map, mergeMap, take } from 'rxjs/operators';
5+
import { buffer, catchError, debounceTime, filter, map, mergeMap, take, tap } from 'rxjs/operators';
66
import {
77
GraphQlHandler,
88
GraphQlHandlerType,
@@ -151,15 +151,31 @@ export class GraphQlRequestService {
151151
errorPolicy: 'all',
152152
fetchPolicy: options.cacheability
153153
})
154-
.pipe(map(response => response.data));
154+
.pipe(
155+
tap(response => {
156+
if (!isNil(response.errors)) {
157+
// tslint:disable-next-line: no-console
158+
console.error(`Query response error(s) for request '${requestString}'`, response.errors);
159+
}
160+
}),
161+
map(response => response.data)
162+
);
155163
}
156164

157165
private executeMutation<TResponse extends { [key: string]: unknown }>(requestString: string): Observable<TResponse> {
158166
return this.apollo
159167
.mutate<TResponse>({
160168
mutation: gql(`mutation ${requestString}`)
161169
})
162-
.pipe(mergeMap(response => (response.data ? of(response.data) : EMPTY)));
170+
.pipe(
171+
tap(response => {
172+
if (!isNil(response.errors)) {
173+
// tslint:disable-next-line: no-console
174+
console.error(`Mutation response error(s) for request '${requestString}'`, response.errors);
175+
}
176+
}),
177+
mergeMap(response => (response.data ? of(response.data) : EMPTY))
178+
);
163179
}
164180

165181
private getResultForRequest<T>(request: GraphQlRequest): Observable<T> {

projects/observability/src/pages/explorer/explorer-dashboard-builder.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ export class ExplorerDashboardBuilder {
304304
title: 'API Boundary Type',
305305
width: '1',
306306
visible: false,
307+
filterable: true,
307308
value: {
308309
type: 'attribute-specification',
309310
attribute: 'apiBoundaryType'
@@ -317,6 +318,7 @@ export class ExplorerDashboardBuilder {
317318
title: 'API Discovery State',
318319
width: '1',
319320
visible: false,
321+
filterable: true,
320322
value: {
321323
type: 'attribute-specification',
322324
attribute: 'apiDiscoveryState'
@@ -330,6 +332,7 @@ export class ExplorerDashboardBuilder {
330332
title: 'API ID',
331333
width: '1',
332334
visible: false,
335+
filterable: true,
333336
value: {
334337
type: 'attribute-specification',
335338
attribute: 'apiId'
@@ -343,6 +346,7 @@ export class ExplorerDashboardBuilder {
343346
title: 'Entry Span ID',
344347
width: '1',
345348
visible: false,
349+
filterable: true,
346350
value: {
347351
type: 'attribute-specification',
348352
attribute: 'apiTraceId'
@@ -356,6 +360,7 @@ export class ExplorerDashboardBuilder {
356360
title: 'Service ID',
357361
width: '1',
358362
visible: false,
363+
filterable: true,
359364
value: {
360365
type: 'attribute-specification',
361366
attribute: 'serviceId'
@@ -369,6 +374,7 @@ export class ExplorerDashboardBuilder {
369374
title: 'Trace ID',
370375
width: '1',
371376
visible: false,
377+
filterable: true,
372378
value: {
373379
type: 'attribute-specification',
374380
attribute: 'traceId'
@@ -382,6 +388,7 @@ export class ExplorerDashboardBuilder {
382388
title: 'Request URL',
383389
width: '1',
384390
visible: false,
391+
filterable: true,
385392
value: {
386393
type: 'attribute-specification',
387394
attribute: 'requestUrl'
@@ -504,6 +511,7 @@ export class ExplorerDashboardBuilder {
504511
{
505512
type: 'table-widget-column',
506513
visible: false,
514+
filterable: true,
507515
value: {
508516
type: 'attribute-specification',
509517
attribute: 'traceId'

projects/observability/src/shared/dashboard/widgets/table/services/table-widget-columns.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ export class TableWidgetColumnsService {
5555
width: '1',
5656
visible: false,
5757
editable: true,
58-
filterable: this.isFilterable(attribute),
58+
filterable: this.isFilterable(attribute.type),
5959
specification: new SpecificationBuilder().attributeSpecificationForKey(attribute.name)
6060
};
6161
}
6262

63-
private isFilterable(attribute: AttributeMetadata): boolean {
64-
return this.filterBuilderLookupService.isBuildableType(toFilterAttributeType(attribute.type));
63+
private isFilterable(type?: AttributeMetadataType): boolean {
64+
return type === undefined ? false : this.filterBuilderLookupService.isBuildableType(toFilterAttributeType(type));
6565
}
6666

6767
private lookupDisplayType(type: AttributeMetadataType): string {

0 commit comments

Comments
 (0)