Commit 20c90c8a6f3f9c1f0cc7ce9cca791fc228930160
1 parent
cb9f5cde
Improve device/device profile components, remove unnecessary transport configurations
Showing
10 changed files
with
28 additions
and
28 deletions
... | ... | @@ -29,11 +29,11 @@ |
29 | 29 | formControlName="configuration"> |
30 | 30 | </tb-mqtt-device-profile-transport-configuration> |
31 | 31 | </ng-template> |
32 | - <ng-template [ngSwitchCase]="deviceTransportType.LWM2M"> | |
32 | + <!--ng-template [ngSwitchCase]="deviceTransportType.LWM2M"> | |
33 | 33 | <tb-lwm2m-device-profile-transport-configuration |
34 | 34 | [required]="required" |
35 | 35 | formControlName="configuration"> |
36 | 36 | </tb-lwm2m-device-profile-transport-configuration> |
37 | - </ng-template> | |
37 | + </ng-template--> | |
38 | 38 | </div> |
39 | 39 | </div> | ... | ... |
... | ... | @@ -89,7 +89,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro |
89 | 89 | let configuration: DeviceProfileTransportConfiguration = null; |
90 | 90 | if (this.lwm2mDeviceProfileTransportConfigurationFormGroup.valid) { |
91 | 91 | configuration = this.lwm2mDeviceProfileTransportConfigurationFormGroup.getRawValue().configuration; |
92 | - configuration.type = DeviceTransportType.LWM2M; | |
92 | + // configuration.type = DeviceTransportType.LWM2M; | |
93 | 93 | } |
94 | 94 | this.propagateChange(configuration); |
95 | 95 | } | ... | ... |
... | ... | @@ -26,7 +26,7 @@ import { |
26 | 26 | createDeviceProfileTransportConfiguration, |
27 | 27 | DeviceProfile, |
28 | 28 | DeviceProfileType, |
29 | - DeviceTransportType, deviceTransportTypeHintMap, | |
29 | + DeviceTransportType, deviceTransportTypeConfigurationInfoMap, deviceTransportTypeHintMap, | |
30 | 30 | deviceTransportTypeTranslationMap |
31 | 31 | } from '@shared/models/device.models'; |
32 | 32 | import { MatHorizontalStepper } from '@angular/material/stepper'; |
... | ... | @@ -123,7 +123,7 @@ export class DeviceWizardDialogComponent extends |
123 | 123 | this.deviceWizardFormGroup.updateValueAndValidity(); |
124 | 124 | this.createProfile = true; |
125 | 125 | this.createTransportConfiguration = this.deviceWizardFormGroup.get('transportType').value && |
126 | - DeviceTransportType.DEFAULT !== this.deviceWizardFormGroup.get('transportType').value; | |
126 | + deviceTransportTypeConfigurationInfoMap.get(this.deviceWizardFormGroup.get('transportType').value).hasProfileConfiguration; | |
127 | 127 | } |
128 | 128 | } |
129 | 129 | )); |
... | ... | @@ -228,7 +228,7 @@ export class DeviceWizardDialogComponent extends |
228 | 228 | this.transportConfigFormGroup.patchValue( |
229 | 229 | {transportConfiguration: createDeviceProfileTransportConfiguration(deviceTransportType)}); |
230 | 230 | this.createTransportConfiguration = this.createProfile && deviceTransportType && |
231 | - DeviceTransportType.DEFAULT !== deviceTransportType; | |
231 | + deviceTransportTypeConfigurationInfoMap.get(deviceTransportType).hasProfileConfiguration; | |
232 | 232 | } |
233 | 233 | |
234 | 234 | add(): void { | ... | ... |
... | ... | @@ -16,9 +16,9 @@ |
16 | 16 | |
17 | 17 | --> |
18 | 18 | <form [formGroup]="defaultDeviceConfigurationFormGroup" style="padding-bottom: 16px;"> |
19 | - <tb-json-object-edit | |
19 | + <!--tb-json-object-edit | |
20 | 20 | [required]="required" |
21 | 21 | label="{{ 'device-profile.type-default' | translate }}" |
22 | 22 | formControlName="configuration"> |
23 | - </tb-json-object-edit> | |
23 | + </tb-json-object-edit--> | |
24 | 24 | </form> | ... | ... |
... | ... | @@ -16,9 +16,9 @@ |
16 | 16 | |
17 | 17 | --> |
18 | 18 | <form [formGroup]="defaultDeviceTransportConfigurationFormGroup" style="padding-bottom: 16px;"> |
19 | - <tb-json-object-edit | |
19 | + <!--tb-json-object-edit | |
20 | 20 | [required]="required" |
21 | 21 | label="{{ 'device-profile.transport-type-default' | translate }}" |
22 | 22 | formControlName="configuration"> |
23 | - </tb-json-object-edit> | |
23 | + </tb-json-object-edit--> | |
24 | 24 | </form> | ... | ... |
... | ... | @@ -29,11 +29,11 @@ |
29 | 29 | formControlName="configuration"> |
30 | 30 | </tb-mqtt-device-transport-configuration> |
31 | 31 | </ng-template> |
32 | - <ng-template [ngSwitchCase]="deviceTransportType.LWM2M"> | |
32 | + <!--ng-template [ngSwitchCase]="deviceTransportType.LWM2M"> | |
33 | 33 | <tb-lwm2m-device-transport-configuration |
34 | 34 | [required]="required" |
35 | 35 | formControlName="configuration"> |
36 | 36 | </tb-lwm2m-device-transport-configuration> |
37 | - </ng-template> | |
37 | + </ng-template--> | |
38 | 38 | </div> |
39 | 39 | </div> | ... | ... |
... | ... | @@ -16,9 +16,9 @@ |
16 | 16 | |
17 | 17 | --> |
18 | 18 | <form [formGroup]="lwm2mDeviceTransportConfigurationFormGroup" style="padding-bottom: 16px;"> |
19 | - <tb-json-object-edit | |
19 | + <!--tb-json-object-edit | |
20 | 20 | [required]="required" |
21 | 21 | label="{{ 'device-profile.transport-type-lwm2m' | translate }}" |
22 | 22 | formControlName="configuration"> |
23 | - </tb-json-object-edit> | |
23 | + </tb-json-object-edit--> | |
24 | 24 | </form> | ... | ... |
... | ... | @@ -89,7 +89,7 @@ export class Lwm2mDeviceTransportConfigurationComponent implements ControlValueA |
89 | 89 | let configuration: DeviceTransportConfiguration = null; |
90 | 90 | if (this.lwm2mDeviceTransportConfigurationFormGroup.valid) { |
91 | 91 | configuration = this.lwm2mDeviceTransportConfigurationFormGroup.getRawValue().configuration; |
92 | - configuration.type = DeviceTransportType.LWM2M; | |
92 | + // configuration.type = DeviceTransportType.LWM2M; | |
93 | 93 | } |
94 | 94 | this.propagateChange(configuration); |
95 | 95 | } | ... | ... |
... | ... | @@ -16,9 +16,9 @@ |
16 | 16 | |
17 | 17 | --> |
18 | 18 | <form [formGroup]="mqttDeviceTransportConfigurationFormGroup" style="padding-bottom: 16px;"> |
19 | - <tb-json-object-edit | |
19 | + <!--tb-json-object-edit | |
20 | 20 | [required]="required" |
21 | 21 | label="{{ 'device-profile.transport-type-mqtt' | translate }}" |
22 | 22 | formControlName="configuration"> |
23 | - </tb-json-object-edit> | |
23 | + </tb-json-object-edit--> | |
24 | 24 | </form> | ... | ... |
... | ... | @@ -33,7 +33,7 @@ export enum DeviceProfileType { |
33 | 33 | export enum DeviceTransportType { |
34 | 34 | DEFAULT = 'DEFAULT', |
35 | 35 | MQTT = 'MQTT', |
36 | - LWM2M = 'LWM2M' | |
36 | +// LWM2M = 'LWM2M' | |
37 | 37 | } |
38 | 38 | |
39 | 39 | export enum MqttTransportPayloadType { |
... | ... | @@ -68,7 +68,7 @@ export const deviceTransportTypeTranslationMap = new Map<DeviceTransportType, st |
68 | 68 | [ |
69 | 69 | [DeviceTransportType.DEFAULT, 'device-profile.transport-type-default'], |
70 | 70 | [DeviceTransportType.MQTT, 'device-profile.transport-type-mqtt'], |
71 | - [DeviceTransportType.LWM2M, 'device-profile.transport-type-lwm2m'] | |
71 | + // [DeviceTransportType.LWM2M, 'device-profile.transport-type-lwm2m'] | |
72 | 72 | ] |
73 | 73 | ); |
74 | 74 | |
... | ... | @@ -76,7 +76,7 @@ export const deviceTransportTypeHintMap = new Map<DeviceTransportType, string>( |
76 | 76 | [ |
77 | 77 | [DeviceTransportType.DEFAULT, 'device-profile.transport-type-default-hint'], |
78 | 78 | [DeviceTransportType.MQTT, 'device-profile.transport-type-mqtt-hint'], |
79 | - [DeviceTransportType.LWM2M, 'device-profile.transport-type-lwm2m-hint'] | |
79 | + // [DeviceTransportType.LWM2M, 'device-profile.transport-type-lwm2m-hint'] | |
80 | 80 | ] |
81 | 81 | ); |
82 | 82 | |
... | ... | @@ -101,16 +101,16 @@ export const deviceTransportTypeConfigurationInfoMap = new Map<DeviceTransportTy |
101 | 101 | DeviceTransportType.MQTT, |
102 | 102 | { |
103 | 103 | hasProfileConfiguration: true, |
104 | - hasDeviceConfiguration: true, | |
104 | + hasDeviceConfiguration: false, | |
105 | 105 | } |
106 | 106 | ], |
107 | - [ | |
107 | + /*[ | |
108 | 108 | DeviceTransportType.LWM2M, |
109 | 109 | { |
110 | 110 | hasProfileConfiguration: true, |
111 | - hasDeviceConfiguration: true, | |
111 | + hasDeviceConfiguration: false, | |
112 | 112 | } |
113 | - ] | |
113 | + ]*/ | |
114 | 114 | ] |
115 | 115 | ); |
116 | 116 | |
... | ... | @@ -188,10 +188,10 @@ export function createDeviceProfileTransportConfiguration(type: DeviceTransportT |
188 | 188 | }; |
189 | 189 | transportConfiguration = {...mqttTransportConfiguration, type: DeviceTransportType.MQTT}; |
190 | 190 | break; |
191 | - case DeviceTransportType.LWM2M: | |
191 | + /*case DeviceTransportType.LWM2M: | |
192 | 192 | const lwm2mTransportConfiguration: Lwm2mDeviceProfileTransportConfiguration = {}; |
193 | 193 | transportConfiguration = {...lwm2mTransportConfiguration, type: DeviceTransportType.LWM2M}; |
194 | - break; | |
194 | + break;*/ | |
195 | 195 | } |
196 | 196 | } |
197 | 197 | return transportConfiguration; |
... | ... | @@ -209,10 +209,10 @@ export function createDeviceTransportConfiguration(type: DeviceTransportType): D |
209 | 209 | const mqttTransportConfiguration: MqttDeviceTransportConfiguration = {}; |
210 | 210 | transportConfiguration = {...mqttTransportConfiguration, type: DeviceTransportType.MQTT}; |
211 | 211 | break; |
212 | - case DeviceTransportType.LWM2M: | |
212 | + /* case DeviceTransportType.LWM2M: | |
213 | 213 | const lwm2mTransportConfiguration: Lwm2mDeviceTransportConfiguration = {}; |
214 | 214 | transportConfiguration = {...lwm2mTransportConfiguration, type: DeviceTransportType.LWM2M}; |
215 | - break; | |
215 | + break;*/ | |
216 | 216 | } |
217 | 217 | } |
218 | 218 | return transportConfiguration; | ... | ... |