/**
* @license
-* Copyright (C) 2017 "IoT.bzh"
+* Copyright (C) 2017-2018 "IoT.bzh"
* Author Sebastien Douheret <sebastien@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
import { SdkInstallComponent } from './sdk-install.component';
import { AlertService } from '../../../@core-xds/services/alert.service';
-import { SdkService, ISdk } from '../../../@core-xds/services/sdk.service';
+import { SdkService, ISdk, StatusType } from '../../../@core-xds/services/sdk.service';
import { ISdkMessage } from '../../../@core-xds/services/xdsagent.service';
interface ISdkMgt extends ISdk {
this.sdks = [];
sdks.forEach(s => {
// only display not installed SDK
- if (s.status !== 'Not Installed') {
+ if (s.status !== StatusType.NOT_INSTALLED) {
return;
}
profMap[s.profile] = s.profile;
modal.result.then(res => {
if (res === 'yes') {
- // Request installation
- this.sdkSvr.install(sdk).subscribe(r => { }, err => this.alert.error(err));
-
const modalInstall = this.modalService.open(SdkInstallComponent, {
size: 'lg',
backdrop: 'static',
container: 'nb-layout',
});
modalInstall.componentInstance.sdk = sdk;
+
+ // Request installation
+ this.sdkSvr.install(sdk).subscribe(
+ r => { },
+ err => {
+ modalInstall.dismiss('SDK install failure');
+ this.alert.error(err);
+ });
}
});