summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKAPIL SINGAL <ks220y@att.com>2020-09-13 23:32:52 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-13 23:32:52 +0000
commited5ccd2c544eb0da85342bc64308363997b3747f (patch)
tree1c15cddba447906548fac53af344381f9e9ad53c
parent3ccdf7e6e266578b98063e898b4acca0f1d15eda (diff)
parent6e998ce32f75614c90963954c62bde64df747c64 (diff)
Merge "improve manual enrichment"
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts32
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts2
2 files changed, 14 insertions, 20 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
index 968d4e16a..09434bc17 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
@@ -100,11 +100,11 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
bluePrintDetailModels[0].artifactName + '/' + bluePrintDetailModels[0].artifactVersion).subscribe(response => {
const blob = new Blob([response], {type: 'application/octet-stream'});
this.currentBlob = blob;
- this.extractBlobToStore(blob, bluePrintDetailModels);
+ this.extractBlobToStore(blob, bluePrintDetailModels[0]);
});
}
- private extractBlobToStore(blob: Blob, bluePrintDetailModels: BluePrintDetailModel) {
+ private extractBlobToStore(blob: Blob, bluePrintDetailModel: BluePrintDetailModel) {
this.zipFile.loadAsync(blob).then((zip) => {
Object.keys(zip.files).forEach((filename) => {
zip.files[filename].async('string').then((fileData) => {
@@ -120,10 +120,10 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
}
} else if (filename.includes('Definitions/')) {
- this.setImports(filename, fileData, bluePrintDetailModels);
+ this.setImports(filename, fileData, bluePrintDetailModel);
} else if (filename.includes('TOSCA-Metadata/')) {
const metaDataTabInfo: MetaDataTabModel = this.getMetaDataTabInfo(fileData);
- this.setMetaData(metaDataTabInfo, bluePrintDetailModels[0]);
+ this.setMetaData(metaDataTabInfo, bluePrintDetailModel);
}
}
});
@@ -136,7 +136,8 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
}
setImports(filename: string, fileData: any, bluePrintDetailModels: BluePrintDetailModel) {
- if (filename.includes(bluePrintDetailModels[0].artifactName)) {
+ console.log(filename);
+ if (filename.includes(bluePrintDetailModels.artifactName)) {
let definition = new VlbDefinition();
definition = fileData as VlbDefinition;
definition = JSON.parse(fileData);
@@ -295,22 +296,15 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
this.packageCreationService.enrichPackage(blob).subscribe(response => {
console.log('success');
const blobInfo = new Blob([response], {type: 'application/octet-stream'});
- this.configurationDashboardService.getPagedPackages(this.id).subscribe(
- (bluePrintDetailModels) => {
- if (bluePrintDetailModels) {
- this.packageCreationStore.clear();
- this.extractBlobToStore(blob, bluePrintDetailModels);
- this.isSaveEnabled = true;
- this.toastService.info('enriched successfully ');
- }
- });
-
- // saveAs(blobInfo, 'test' + '-' + '1.0.0' + '-CBA.zip');
-
+ this.currentBlob = blobInfo;
+ this.packageCreationStore.clear();
+ this.extractBlobToStore(this.currentBlob, this.viewedPackage);
+ this.isSaveEnabled = true;
+ this.toastService.info('enriched successfully ');
});
}, error => {
- this.toastService.error('error happened when editing ' + error.message);
- console.log('Error -' + error.message);
+ this.toastService.error('error happened when enrich ' + error.message);
+ console.error('Error -' + error.message);
});
}
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts
index e7ccbb39a..bd8360a14 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts
@@ -42,7 +42,7 @@ export class PackageCreationService {
}
private enrichBlueprint(body: any | null, options?: any): Observable<any> {
- return this.api.post(BlueprintURLs.enrich, body, {responseType: 'text'});
+ return this.api.post(BlueprintURLs.enrich, body, { responseType: 'blob' });
}
private deployBluePrint(body: any | null, options?: any): Observable<any> {