Skip to content

Commit 646d092

Browse files
feat: adding link support for topology widget
1 parent 03f0001 commit 646d092

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

projects/dashboards/src/public-api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ export * from './widgets/widget-renderer';
1818
export * from './widgets/interactive-data-widget-renderer';
1919
export * from './widgets/header/widget-header.model';
2020
export * from './widgets/container/container-widget.model';
21+
export * from './widgets/link/link-widget.model';
2122

2223
export * from './dashboard.module';

projects/observability/src/shared/dashboard/widgets/topology/topology-widget-renderer.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ import { TopologyWidgetModel } from './topology-widget.model';
3434
changeDetection: ChangeDetectionStrategy.OnPush,
3535
template: `
3636
<div class="topology-container" [ngClass]="{ 'box-style': this.model.enableBoxStyle }">
37-
<ht-titled-content [title]="this.model.title | htDisplayTitle">
37+
<ht-titled-content
38+
[title]="this.model.title | htDisplayTitle"
39+
[link]="this.model.link?.url"
40+
[linkLabel]="this.model.link?.displayText"
41+
>
3842
<div class="visualization" *htLoadAsync="this.data$ as data">
3943
<div *ngIf="this.model.showLegend" class="legend">
4044
<div class="latency">

projects/observability/src/shared/dashboard/widgets/topology/topology-widget.model.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
import { BOOLEAN_PROPERTY, Model, ModelApi, ModelProperty, STRING_PROPERTY } from '@hypertrace/hyperdash';
1+
import { LinkWidgetModel } from '@hypertrace/dashboards';
2+
import {
3+
BOOLEAN_PROPERTY,
4+
Model,
5+
ModelApi,
6+
ModelModelPropertyTypeInstance,
7+
ModelProperty,
8+
ModelPropertyType,
9+
STRING_PROPERTY
10+
} from '@hypertrace/hyperdash';
211
import { ModelInject, MODEL_API } from '@hypertrace/hyperdash-angular';
312
import { Observable } from 'rxjs';
413
import { TopologyData, TopologyDataSourceModel } from '../../data/graphql/topology/topology-data-source.model';
@@ -16,6 +25,17 @@ export class TopologyWidgetModel {
1625
})
1726
public title?: string;
1827

28+
@ModelProperty({
29+
key: 'link',
30+
required: false,
31+
// tslint:disable-next-line: no-object-literal-type-assertion
32+
type: {
33+
key: ModelPropertyType.TYPE,
34+
defaultModelClass: LinkWidgetModel
35+
} as ModelModelPropertyTypeInstance
36+
})
37+
public link?: LinkWidgetModel;
38+
1939
@ModelProperty({
2040
key: 'showLegend',
2141
displayName: 'Show Legend',

0 commit comments

Comments
 (0)