Skip to content

Commit

Permalink
feat(datapoints-graph): [no-issue] Context issue for non devicetype
Browse files Browse the repository at this point in the history
dashboards has been fixed.
  • Loading branch information
eniosultan committed Nov 6, 2024
1 parent dc58f9b commit dcb9c35
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ import {
} from '@c8y/ngx-components/datapoint-selector';
import { omit } from 'lodash-es';
import { aggregationType } from '@c8y/client';
import { WidgetConfigComponent } from '@c8y/ngx-components/context-dashboard';
import {
ContextDashboardComponent,
WidgetConfigComponent,
} from '@c8y/ngx-components/context-dashboard';
import {
AlarmDetails,
EventDetails,
Expand Down Expand Up @@ -86,7 +89,8 @@ export class DatapointsGraphWidgetConfigComponent
private formBuilder: FormBuilder,
private form: NgForm,
private translate: TranslateService,
@Optional() private widgetConfig: WidgetConfigComponent
@Optional() private widgetConfig: WidgetConfigComponent,
@Optional() private dashboardContextComponent: ContextDashboardComponent
) {
this.formGroup = this.initForm();
}
Expand Down Expand Up @@ -178,6 +182,9 @@ export class DatapointsGraphWidgetConfigComponent
}

private assignContextFromContextDashboard(datapoint: KPIDetails) {
if (!this.dashboardContextComponent?.isDeviceTypeDashboard) {
return;
}
const context = this.widgetConfig?.context;
if (context?.id) {
const { name, id } = context;
Expand Down

0 comments on commit dcb9c35

Please sign in to comment.