diff --git a/src/app/widgets/charts/shared/data-source-selector/data-source-selector.component.html b/src/app/widgets/charts/shared/data-source-selector/data-source-selector.component.html index dee6103a..a295ee58 100644 --- a/src/app/widgets/charts/shared/data-source-selector/data-source-selector.component.html +++ b/src/app/widgets/charts/shared/data-source-selector/data-source-selector.component.html @@ -7,7 +7,7 @@

Choose a {{dataSourcePlaceholder}}

{{dataSourcePlaceholder}} + [getOptionViewValue]="getDataSourceName" > diff --git a/src/app/widgets/charts/shared/data-source-selector/data-source-selector.component.ts b/src/app/widgets/charts/shared/data-source-selector/data-source-selector.component.ts index 94a9d1ee..54ee8841 100644 --- a/src/app/widgets/charts/shared/data-source-selector/data-source-selector.component.ts +++ b/src/app/widgets/charts/shared/data-source-selector/data-source-selector.component.ts @@ -637,7 +637,7 @@ export class DataSourceSelectorComponent implements OnInit { }; compare(a: any, b: any): boolean { - return a && b && a.id === b.id && a.name === b.name; + return a && b && a.id === b.id; } compareFields(a: any, b: any): boolean { @@ -654,4 +654,8 @@ export class DataSourceSelectorComponent implements OnInit { a.criteria.function_id === b.criteria.function_id); return exportsMatch || deviceMatch || deviceGroupMatch; } + + getDataSourceName(x: any): string { + return x.display_name || x.name; + } }