|
|
|
@ -25,8 +25,12 @@ import { |
|
|
|
createDeviceProfileConfiguration, |
|
|
|
createDeviceProfileTransportConfiguration, |
|
|
|
DeviceProfile, |
|
|
|
DeviceProfileType, DeviceProvisionConfiguration, DeviceProvisionType, |
|
|
|
DeviceTransportType, deviceTransportTypeConfigurationInfoMap, deviceTransportTypeHintMap, |
|
|
|
DeviceProfileType, |
|
|
|
DeviceProvisionConfiguration, |
|
|
|
DeviceProvisionType, |
|
|
|
DeviceTransportType, |
|
|
|
deviceTransportTypeConfigurationInfoMap, |
|
|
|
deviceTransportTypeHintMap, |
|
|
|
deviceTransportTypeTranslationMap |
|
|
|
} from '@shared/models/device.models'; |
|
|
|
import { MatHorizontalStepper } from '@angular/material/stepper'; |
|
|
|
@ -43,7 +47,8 @@ import { StepperSelectionEvent } from '@angular/cdk/stepper'; |
|
|
|
import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout'; |
|
|
|
import { MediaBreakpoints } from '@shared/models/constants'; |
|
|
|
import { RuleChainId } from '@shared/models/id/rule-chain-id'; |
|
|
|
import {ServiceType} from "@shared/models/queue.models"; |
|
|
|
import { ServiceType } from '@shared/models/queue.models'; |
|
|
|
import { deepTrim } from '@core/utils'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'tb-device-wizard', |
|
|
|
@ -108,7 +113,7 @@ export class DeviceWizardDialogComponent extends |
|
|
|
deviceProfileId: [null, Validators.required], |
|
|
|
newDeviceProfileTitle: [{value: null, disabled: true}], |
|
|
|
defaultRuleChainId: [{value: null, disabled: true}], |
|
|
|
defaultQueueName: [''], |
|
|
|
defaultQueueName: [{value: null, disabled: true}], |
|
|
|
description: [''] |
|
|
|
} |
|
|
|
); |
|
|
|
@ -288,7 +293,7 @@ export class DeviceWizardDialogComponent extends |
|
|
|
if (this.deviceWizardFormGroup.get('defaultRuleChainId').value) { |
|
|
|
deviceProfile.defaultRuleChainId = new RuleChainId(this.deviceWizardFormGroup.get('defaultRuleChainId').value); |
|
|
|
} |
|
|
|
return this.deviceProfileService.saveDeviceProfile(deviceProfile).pipe( |
|
|
|
return this.deviceProfileService.saveDeviceProfile(deepTrim(deviceProfile)).pipe( |
|
|
|
map(profile => profile.id), |
|
|
|
tap((profileId) => { |
|
|
|
this.deviceWizardFormGroup.patchValue({ |
|
|
|
@ -319,7 +324,7 @@ export class DeviceWizardDialogComponent extends |
|
|
|
id: this.customerFormGroup.get('customerId').value |
|
|
|
}; |
|
|
|
} |
|
|
|
return this.data.entitiesTableConfig.saveEntity(device); |
|
|
|
return this.data.entitiesTableConfig.saveEntity(deepTrim(device)); |
|
|
|
} |
|
|
|
|
|
|
|
private saveCredentials(device: BaseData<HasId>): Observable<boolean> { |
|
|
|
|