summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKAPIL SINGAL <ks220y@att.com>2020-11-18 16:23:58 +0000
committerGerrit Code Review <gerrit@onap.org>2020-11-18 16:23:58 +0000
commitc83800e027316c997bd6dca2606cd3b7029c5730 (patch)
tree5799d8ee1543c6fefaa9f2c482c37b249cf5638b
parentb31e01699bec4d752687690d0663865df6680796 (diff)
parenta661be230e19c64310de293ca6a2e47ab469db9a (diff)
Merge "Stop loader and disaply errors when deploying a package"
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts10
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts2
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.html5
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts19
4 files changed, 25 insertions, 11 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 766c50a98..96e54d953 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
@@ -264,6 +264,10 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
this.packageCreationExtractionService.extractBlobToStore(this.currentBlob);
this.isSaveEnabled = true;
this.toastService.info('enriched successfully ');
+ }, err => {
+ this.handleError(err);
+ }, () => {
+ this.ngxService.stop();
});
}, error => {
this.toastService.error('error happened when enrich ' + error.message);
@@ -282,6 +286,10 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
const id = response.toString().split('id')[1].split(':')[1].split('"')[1];
this.isSaveEnabled = false;
this.router.navigate(['/packages/package/' + id]);
+ }, err => {
+ this.handleError(err);
+ }, () => {
+ this.ngxService.stop();
});
}, error => {
this.handleError(error);
@@ -324,6 +332,8 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
}
this.toastService.error('error happened when deploying ' + errorMessage);
console.log('Error -' + errorMessage);
+ this.ngxService.stop();
+ this.toastService.error('error happened when deploying' + error.message);
return throwError(errorMessage);
}
}
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
index 871236768..3890a980d 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
@@ -187,7 +187,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
if (value.isTemplate) {
this.nodeTemplates.artifacts[key + '-template'] = {
- type: 'artifact-template-resource',
+ type: 'artifact-template-velocity',
file: 'Templates/' + key + '-template.vtl'
};
}
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.html
index eedbe9f85..322acb92f 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.html
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.html
@@ -9,7 +9,7 @@
</li>
<i class="fa fa-angle-right ml-2 mr-2"></i>
<li class="breadcrumb-item">
- <a href="/package/{{viewedPackage.id}}">{{viewedPackage.artifactName}}</a>
+ <a href="/package/{{this.packageId}}">{{viewedPackage.artifactName}}</a>
<button type="button" class="btn package-info-btn" data-toggle="modal"
data-target="#exampleModalLong">
<i class="icon-info" aria-hidden="true"></i>
@@ -157,5 +157,4 @@
[theme]="'tomorrow_night_bright'" #editor style="height:500px">
</ace-editor>
- </div>
- \ No newline at end of file
+ </div> \ No newline at end of file
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts
index 2c576f2b9..ae4d09d20 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts
@@ -22,6 +22,7 @@ export class DesignerSourceViewComponent implements OnInit, OnDestroy {
viewedPackage: BluePrintDetailModel = new BluePrintDetailModel();
public customActionName = '';
cl = 'editBar';
+ packageId: string;
constructor(
private store: DesignerStore,
@@ -31,15 +32,15 @@ export class DesignerSourceViewComponent implements OnInit, OnDestroy {
private sourceViewService: SourceViewService) {
this.controllerSideBar = true;
}
- _toggleSidebar1() {
+ _toggleSidebar1() {
this.controllerSideBar = !this.controllerSideBar;
if (this.controllerSideBar === false) {
- this.cl = 'editBar2';
- }
+ this.cl = 'editBar2';
+ }
if (this.controllerSideBar === true) {
- this.cl = 'editBar';
- }
- }
+ this.cl = 'editBar';
+ }
+ }
ngOnInit() {
this.store.state$.subscribe(
@@ -55,13 +56,17 @@ export class DesignerSourceViewComponent implements OnInit, OnDestroy {
this.viewedPackage = bluePrintDetailModels[0];
}
});
+
+ this.route.paramMap.subscribe(res => {
+ this.packageId = res.get('id');
+ });
}
convertAndOpenInDesingerView(id) {
// TODO validate json against scheme
console.log('convertAndOpenInDesingerView ...', this.content);
this.store.saveSourceContent(this.content);
- this.router.navigate(['/packages/designer', id, { actionName: this.customActionName }]);
+ this.router.navigate(['/packages/designer', this.packageId, { actionName: this.customActionName }]);
}
ngOnDestroy() {