Skip to content

Commit 118a32f

Browse files
authored
Merge branch 'main' into AddFormControlDisabledToCombobox
2 parents afcfe7f + fc90cc3 commit 118a32f

34 files changed

+788
-47
lines changed

projects/common/src/time/time-range.service.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,11 @@ describe('Time range service', () => {
8181
});
8282
});
8383
});
84+
85+
test('returns custom time filter', () => {
86+
const spectator = buildService();
87+
expect(spectator.service.toQueryParams(new Date(1642296703000), new Date(1642396703000))).toStrictEqual({
88+
['time']: new FixedTimeRange(new Date(1642296703000), new Date(1642396703000)).toUrlString()
89+
});
90+
});
8491
});

projects/common/src/time/time-range.service.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
22
import { isEmpty } from 'lodash-es';
33
import { EMPTY, ReplaySubject } from 'rxjs';
44
import { catchError, defaultIfEmpty, filter, map, switchMap, take } from 'rxjs/operators';
5-
import { NavigationService } from '../navigation/navigation.service';
5+
import { NavigationService, QueryParamObject } from '../navigation/navigation.service';
66
import { ReplayObservable } from '../utilities/rxjs/rxjs-utils';
77
import { FixedTimeRange } from './fixed-time-range';
88
import { RelativeTimeRange } from './relative-time-range';
@@ -110,4 +110,12 @@ export class TimeRangeService {
110110
public static toFixedTimeRange(startTime: Date, endTime: Date): FixedTimeRange {
111111
return new FixedTimeRange(startTime, endTime);
112112
}
113+
114+
public toQueryParams(startTime: Date, endTime: Date): QueryParamObject {
115+
const newTimeRange = new FixedTimeRange(startTime, endTime);
116+
117+
return {
118+
[TimeRangeService.TIME_RANGE_QUERY_PARAM]: newTimeRange.toUrlString()
119+
};
120+
}
113121
}

projects/components/src/popover/popover-position-builder.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ export class PopoverPositionBuilder {
109109
return globalPosition.centerHorizontally().centerVertically();
110110
case PopoverFixedPositionLocation.Right:
111111
return globalPosition.right('0').top('0');
112+
113+
case PopoverFixedPositionLocation.Custom:
114+
return globalPosition
115+
.left(`${popoverPosition.customLocation!.x}px`)
116+
.top(`${popoverPosition.customLocation!.y}px`);
112117
case PopoverFixedPositionLocation.RightUnderHeader:
113118
default:
114119
return globalPosition.right('0').top(this.headerHeight ?? '0');

projects/components/src/popover/popover.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export interface PopoverRelativePosition {
3434
export interface PopoverFixedPosition {
3535
type: PopoverPositionType.Fixed;
3636
location: PopoverFixedPositionLocation;
37+
customLocation?: {
38+
x: number;
39+
y: number;
40+
};
3741
}
3842

3943
export type PopoverPosition =
@@ -65,7 +69,8 @@ export const enum PopoverRelativePositionLocation {
6569
export const enum PopoverFixedPositionLocation {
6670
RightUnderHeader,
6771
Centered,
68-
Right
72+
Right,
73+
Custom
6974
}
7075

7176
export const POPOVER_DATA = new InjectionToken<unknown>('POPOVER_DATA');

projects/observability/src/pages/apis/api-detail/metrics/api-metrics.dashboard.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,10 @@ export const apiMetricsDashboard: DashboardDefaultConfiguration = {
276276
}
277277
}
278278
}
279-
]
279+
],
280+
'selection-handler': {
281+
type: 'cartesian-explorer-selection-handler'
282+
}
280283
},
281284
{
282285
type: 'container-widget',
@@ -336,7 +339,11 @@ export const apiMetricsDashboard: DashboardDefaultConfiguration = {
336339
type: 'entity-error-percentage-timeseries-data-source'
337340
}
338341
}
339-
]
342+
],
343+
'selection-handler': {
344+
type: 'cartesian-explorer-selection-handler',
345+
'show-context-menu': true
346+
}
340347
},
341348
{
342349
type: 'cartesian-widget',
@@ -375,7 +382,11 @@ export const apiMetricsDashboard: DashboardDefaultConfiguration = {
375382
}
376383
}
377384
}
378-
]
385+
],
386+
'selection-handler': {
387+
type: 'cartesian-explorer-selection-handler',
388+
'show-context-menu': true
389+
}
379390
}
380391
]
381392
}
@@ -410,7 +421,11 @@ export const apiMetricsDashboard: DashboardDefaultConfiguration = {
410421
}
411422
}
412423
}
413-
]
424+
],
425+
'selection-handler': {
426+
type: 'cartesian-explorer-selection-handler',
427+
'show-context-menu': true
428+
}
414429
}
415430
]
416431
}

projects/observability/src/pages/apis/api-detail/overview/api-overview.dashboard.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,10 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = {
295295
}
296296
}
297297
}
298-
]
298+
],
299+
'selection-handler': {
300+
type: 'cartesian-explorer-selection-handler'
301+
}
299302
},
300303
{
301304
type: 'cartesian-widget',
@@ -389,7 +392,10 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = {
389392
}
390393
}
391394
}
392-
]
395+
],
396+
'selection-handler': {
397+
type: 'cartesian-explorer-selection-handler'
398+
}
393399
},
394400
{
395401
type: 'cartesian-widget',
@@ -483,7 +489,10 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = {
483489
}
484490
}
485491
}
486-
]
492+
],
493+
'selection-handler': {
494+
type: 'cartesian-explorer-selection-handler'
495+
}
487496
}
488497
]
489498
},

projects/observability/src/pages/apis/backend-detail/metrics/backend-metrics.dashboard.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,10 @@ export const backendMetricsDashboard: DashboardDefaultConfiguration = {
260260
}
261261
}
262262
}
263-
]
263+
],
264+
'selection-handler': {
265+
type: 'cartesian-explorer-selection-handler'
266+
}
264267
},
265268
{
266269
type: 'container-widget',
@@ -320,7 +323,11 @@ export const backendMetricsDashboard: DashboardDefaultConfiguration = {
320323
type: 'entity-error-percentage-timeseries-data-source'
321324
}
322325
}
323-
]
326+
],
327+
'selection-handler': {
328+
type: 'cartesian-explorer-selection-handler',
329+
'show-context-menu': true
330+
}
324331
},
325332
{
326333
type: 'cartesian-widget',
@@ -343,7 +350,11 @@ export const backendMetricsDashboard: DashboardDefaultConfiguration = {
343350
}
344351
}
345352
}
346-
]
353+
],
354+
'selection-handler': {
355+
type: 'cartesian-explorer-selection-handler',
356+
'show-context-menu': true
357+
}
347358
}
348359
]
349360
}
@@ -378,7 +389,11 @@ export const backendMetricsDashboard: DashboardDefaultConfiguration = {
378389
}
379390
}
380391
}
381-
]
392+
],
393+
'selection-handler': {
394+
type: 'cartesian-explorer-selection-handler',
395+
'show-context-menu': true
396+
}
382397
}
383398
]
384399
}

projects/observability/src/pages/apis/backend-detail/overview/backend-overview.component.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ export class BackendOverviewComponent {
287287
}
288288
}
289289
}
290-
]
290+
],
291+
'selection-handler': {
292+
type: 'cartesian-explorer-selection-handler'
293+
}
291294
},
292295
{
293296
type: 'cartesian-widget',
@@ -365,7 +368,10 @@ export class BackendOverviewComponent {
365368
}
366369
}
367370
}
368-
]
371+
],
372+
'selection-handler': {
373+
type: 'cartesian-explorer-selection-handler'
374+
}
369375
},
370376
{
371377
type: 'cartesian-widget',
@@ -443,7 +449,10 @@ export class BackendOverviewComponent {
443449
}
444450
}
445451
}
446-
]
452+
],
453+
'selection-handler': {
454+
type: 'cartesian-explorer-selection-handler'
455+
}
447456
}
448457
]
449458
},

projects/observability/src/pages/apis/service-detail/metrics/service-metrics.dashboard.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,10 @@ export const serviceMetricsDashboard: DashboardDefaultConfiguration = {
276276
}
277277
}
278278
}
279-
]
279+
],
280+
'selection-handler': {
281+
type: 'cartesian-explorer-selection-handler'
282+
}
280283
},
281284
{
282285
type: 'container-widget',
@@ -336,7 +339,11 @@ export const serviceMetricsDashboard: DashboardDefaultConfiguration = {
336339
type: 'entity-error-percentage-timeseries-data-source'
337340
}
338341
}
339-
]
342+
],
343+
'selection-handler': {
344+
type: 'cartesian-explorer-selection-handler',
345+
'show-context-menu': true
346+
}
340347
},
341348
{
342349
type: 'cartesian-widget',
@@ -375,7 +382,11 @@ export const serviceMetricsDashboard: DashboardDefaultConfiguration = {
375382
}
376383
}
377384
}
378-
]
385+
],
386+
'selection-handler': {
387+
type: 'cartesian-explorer-selection-handler',
388+
'show-context-menu': true
389+
}
379390
}
380391
]
381392
}
@@ -410,7 +421,11 @@ export const serviceMetricsDashboard: DashboardDefaultConfiguration = {
410421
}
411422
}
412423
}
413-
]
424+
],
425+
'selection-handler': {
426+
type: 'cartesian-explorer-selection-handler',
427+
'show-context-menu': true
428+
}
414429
}
415430
]
416431
}

projects/observability/src/pages/apis/service-detail/overview/service-overview.dashboard.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,11 @@ export const serviceOverviewDashboard: DashboardDefaultConfiguration = {
339339
}
340340
}
341341
}
342-
]
342+
],
343+
'selection-handler': {
344+
type: 'cartesian-explorer-selection-handler',
345+
'show-context-menu': true
346+
}
343347
},
344348
{
345349
type: 'cartesian-widget',
@@ -433,7 +437,11 @@ export const serviceOverviewDashboard: DashboardDefaultConfiguration = {
433437
}
434438
}
435439
}
436-
]
440+
],
441+
'selection-handler': {
442+
type: 'cartesian-explorer-selection-handler',
443+
'show-context-menu': true
444+
}
437445
},
438446
{
439447
type: 'cartesian-widget',
@@ -527,7 +535,11 @@ export const serviceOverviewDashboard: DashboardDefaultConfiguration = {
527535
}
528536
}
529537
}
530-
]
538+
],
539+
'selection-handler': {
540+
type: 'cartesian-explorer-selection-handler',
541+
'show-context-menu': true
542+
}
531543
}
532544
]
533545
},

0 commit comments

Comments
 (0)