Browse Source

Map widget: disable data key aggregation settings in data layer configuration options

pull/14685/head
Ekaterina Chantsova 10 months ago
parent
commit
c6ae93f8f2
  1. 2
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-dialog.component.ts
  2. 2
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-row.component.ts
  3. 3
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-settings.component.models.ts
  4. 4
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-settings.component.ts

2
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-dialog.component.ts

@ -496,7 +496,7 @@ export class MapDataLayerDialogComponent extends DialogComponent<MapDataLayerDia
const targetDataKey: DataKey = this.dataLayerFormGroup.get(keyType).value;
this.context.editKey(targetDataKey,
this.dataLayerFormGroup.get('dsDeviceId').value, this.dataLayerFormGroup.get('dsEntityAliasId').value,
this.dataLayerType === 'trips' ? widgetType.timeseries : widgetType.latest).subscribe(
this.dataLayerType === 'trips' ? widgetType.timeseries : widgetType.latest, false).subscribe(
(updatedDataKey) => {
if (updatedDataKey) {
this.dataLayerFormGroup.get(keyType).patchValue(updatedDataKey);

2
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-row.component.ts

@ -247,7 +247,7 @@ export class MapDataLayerRowComponent implements ControlValueAccessor, OnInit {
const targetDataKey: DataKey = this.dataLayerFormGroup.get(keyType).value;
this.context.editKey(targetDataKey,
this.dataLayerFormGroup.get('dsDeviceId').value, this.dataLayerFormGroup.get('dsEntityAliasId').value,
this.dataLayerType === 'trips' ? widgetType.timeseries : widgetType.latest).subscribe(
this.dataLayerType === 'trips' ? widgetType.timeseries : widgetType.latest, false).subscribe(
(updatedDataKey) => {
if (updatedDataKey) {
this.dataLayerFormGroup.get(keyType).patchValue(updatedDataKey);

3
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-settings.component.models.ts

@ -24,6 +24,7 @@ export interface MapSettingsContext {
aliasController: IAliasController;
callbacks: WidgetConfigCallbacks;
widget: Widget;
editKey: (key: DataKey, deviceId: string, entityAliasId: string, WidgetType?: widgetType) => Observable<DataKey>;
editKey: (key: DataKey, deviceId: string, entityAliasId: string, WidgetType?: widgetType,
hideDataKeyAggregation?: boolean) => Observable<DataKey>;
generateDataKey: (key: DataKey) => DataKey;
}

4
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-settings.component.ts

@ -304,7 +304,8 @@ export class MapSettingsComponent implements OnInit, ControlValueAccessor, Valid
this.propagateChange(this.modelValue);
}
private editKey(key: DataKey, deviceId: string, entityAliasId: string, _widgetType = widgetType.latest): Observable<DataKey> {
private editKey(key: DataKey, deviceId: string, entityAliasId: string, _widgetType = widgetType.latest,
hideDataKeyAggregation = true): Observable<DataKey> {
return this.dialog.open<DataKeyConfigDialogComponent, DataKeyConfigDialogData, DataKey>(DataKeyConfigDialogComponent,
{
disableClose: true,
@ -321,6 +322,7 @@ export class MapSettingsComponent implements OnInit, ControlValueAccessor, Valid
hideDataKeyColor: true,
hideDataKeyDecimals: true,
hideDataKeyUnits: true,
hideDataKeyAggregation: hideDataKeyAggregation,
widget: this.widget,
dashboard: null,
dataKeySettingsForm: null,

Loading…
Cancel
Save