From 43735f17aea3d8378c2022713121ec3a11f05e7b Mon Sep 17 00:00:00 2001 From: rusikv Date: Mon, 27 Mar 2023 16:29:31 +0300 Subject: [PATCH] Added string items list for sparkplug transport configuration --- ...ile-transport-configuration.component.html | 27 ++++++---------- ...ofile-transport-configuration.component.ts | 32 ------------------- 2 files changed, 9 insertions(+), 50 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.html b/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.html index 1ef7892ecb..ecc9d1923d 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.html @@ -21,24 +21,15 @@
- - device-profile.mqtt-device-topic-filters-spark-plug-attribute-metric-names - - - {{name}} - close - - - - - + + +
diff --git a/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts b/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts index cf931a7fed..24b3f60fb4 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts @@ -41,8 +41,6 @@ import { import { isDefinedAndNotNull } from '@core/utils'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { COMMA, ENTER, SEMICOLON } from '@angular/cdk/keycodes'; -import { MatChipInputEvent } from '@angular/material/chips'; @Component({ selector: 'tb-mqtt-device-profile-transport-configuration', @@ -79,8 +77,6 @@ export class MqttDeviceProfileTransportConfigurationComponent implements Control private propagateChange = (v: any) => { }; - separatorKeysCodes = [ENTER, COMMA, SEMICOLON]; - constructor(private store: Store, private fb: UntypedFormBuilder) { } @@ -175,34 +171,6 @@ export class MqttDeviceProfileTransportConfigurationComponent implements Control } } - removeAttributeMetricName(name: string): void { - const names: string[] = this.mqttDeviceProfileTransportConfigurationFormGroup.get('sparkplugAttributesMetricNames').value; - const index = names.indexOf(name); - if (index >= 0) { - names.splice(index, 1); - this.mqttDeviceProfileTransportConfigurationFormGroup.get('sparkplugAttributesMetricNames').setValue(names); - } - } - - addAttributeMetricName(event: MatChipInputEvent): void { - const input = event.input; - let value = event.value; - if ((value || '').trim()) { - value = value.trim(); - let names: string[] = this.mqttDeviceProfileTransportConfigurationFormGroup.get('sparkplugAttributesMetricNames').value; - if (!names || names.indexOf(value) === -1) { - if (!names) { - names = []; - } - names.push(value); - this.mqttDeviceProfileTransportConfigurationFormGroup.get('sparkplugAttributesMetricNames').setValue(names, {emitEvent: true}); - } - } - if (input) { - input.value = ''; - } - } - private updateModel() { let configuration: DeviceProfileTransportConfiguration = null; if (this.mqttDeviceProfileTransportConfigurationFormGroup.valid) {