|
|
|
@ -33,6 +33,10 @@ import { |
|
|
|
deviceProvisionTypeTranslationMap |
|
|
|
} from '@shared/models/device.models'; |
|
|
|
import { generateSecret, isDefinedAndNotNull } from '@core/utils'; |
|
|
|
import { ActionNotificationShow } from '@core/notification/notification.actions'; |
|
|
|
import { Store } from '@ngrx/store'; |
|
|
|
import { AppState } from '@core/core.state'; |
|
|
|
import { TranslateService } from '@ngx-translate/core'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'tb-device-profile-provision-configuration', |
|
|
|
@ -73,7 +77,9 @@ export class DeviceProfileProvisionConfigurationComponent implements ControlValu |
|
|
|
|
|
|
|
private propagateChange = (v: any) => { }; |
|
|
|
|
|
|
|
constructor(private fb: FormBuilder) { |
|
|
|
constructor(protected store: Store<AppState>, |
|
|
|
private fb: FormBuilder, |
|
|
|
private translate: TranslateService) { |
|
|
|
} |
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
@ -149,4 +155,15 @@ export class DeviceProfileProvisionConfigurationComponent implements ControlValu |
|
|
|
} |
|
|
|
this.propagateChange(deviceProvisionConfiguration); |
|
|
|
} |
|
|
|
|
|
|
|
onProvisionCopied(isKey: boolean) { |
|
|
|
this.store.dispatch(new ActionNotificationShow( |
|
|
|
{ |
|
|
|
message: this.translate.instant(isKey ? 'device-profile.provision-key-copied-message' : 'device-profile.provision-secret-copied-message'), |
|
|
|
type: 'success', |
|
|
|
duration: 1200, |
|
|
|
verticalPosition: 'bottom', |
|
|
|
horizontalPosition: 'right' |
|
|
|
})); |
|
|
|
} |
|
|
|
} |
|
|
|
|