|
|
|
@ -92,7 +92,7 @@ export class MqttDeviceProfileTransportConfigurationComponent implements Control |
|
|
|
}); |
|
|
|
let configurationFormGroup = this.mqttDeviceProfileTransportConfigurationFormGroup.controls.configuration as FormGroup; |
|
|
|
configurationFormGroup.get('transportPayloadType').valueChanges.subscribe(payloadType => { |
|
|
|
this.onTransportPayloadTypeChanged(payloadType, configurationFormGroup); |
|
|
|
this.updateTransportPayloadBasedControls(type, configurationFormGroup) |
|
|
|
this.mqttDeviceProfileTransportConfigurationFormGroup.updateValueAndValidity(); |
|
|
|
}); |
|
|
|
this.mqttDeviceProfileTransportConfigurationFormGroup.valueChanges.subscribe(() => { |
|
|
|
@ -132,10 +132,6 @@ export class MqttDeviceProfileTransportConfigurationComponent implements Control |
|
|
|
this.propagateChange(configuration); |
|
|
|
} |
|
|
|
|
|
|
|
private onTransportPayloadTypeChanged(type: MqttTransportPayloadType, configurationFormGroup: FormGroup) { |
|
|
|
this.updateTransportPayloadBasedControls(type, configurationFormGroup) |
|
|
|
} |
|
|
|
|
|
|
|
private updateTransportPayloadBasedControls(type: MqttTransportPayloadType, configurationFormGroup: FormGroup) { |
|
|
|
if (type === MqttTransportPayloadType.PROTOBUF) { |
|
|
|
configurationFormGroup.registerControl('deviceTelemetryProtoSchema', this.fb.control(null, Validators.required)); |
|
|
|
|