Skip to content

Commit

Permalink
SNRGY-3599 fix missing device names in chart export edit dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
franzmueller committed Nov 6, 2024
1 parent 76e9d3e commit 4105c0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h2>Choose a {{dataSourcePlaceholder}}</h2>
<mat-label>{{dataSourcePlaceholder}}</mat-label>
<senergy-select-search [required]="true" [multiple]="true" [compareWith]="compare" formControlName="exports"
(selectionChange)="dataSourceChanged($event.value)" [options]="dataSourceOptions"
useOptionViewProperty="name">
[getOptionViewValue]="getDataSourceName" >
</senergy-select-search>

<mat-error *ngIf="form.controls.exports.invalid">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
}
}

0 comments on commit 4105c0a

Please sign in to comment.