summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard
diff options
context:
space:
mode:
authorShaabanEltanany <shaaban.eltanany.ext@orange.com>2020-06-21 21:48:49 +0200
committerShaaban Ebrahim <shaaban.eltanany.ext@orange.com>2020-06-22 12:11:40 +0000
commita68a19fcb0b1c9f7d0a91338e08b1854c99cf1c7 (patch)
treed2706a4b80b7d750d19bece02e759b28f09354b3 /cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard
parent3579d15b41d9f786650f76c3b6a98d28f0052f1a (diff)
solving continuous saving
Issue-ID: CCSDK-2336 Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com> Change-Id: I7e488950a77a19b7b1b4ac2e4c9044698b9ff757
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html6
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts18
2 files changed, 18 insertions, 6 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html
index ebfad93c3..bf6bf1251 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html
@@ -22,8 +22,8 @@
<div class="container">
<div class="creat-action-container">
- <a class="action-button save" (click)="editBluePrint()">
- <i class="icon-save-sm" aria-hidden="true"></i>
+ <a class="action-button save" (click)="editBluePrint()" >
+ <i class="icon-save-sm" aria-hidden="true" ></i>
<span>Save</span>
</a>
<a href="#" class="action-button" (click)="goBacktoDashboard()">
@@ -62,7 +62,7 @@
<div class="col-12 package-name deployed">
{{viewedPackage.artifactName}}
<img src="/assets/img/icon-deploy-inactive.svg" class="deply-status-icon">
- <span class="package-version">v1.0.2</span>
+ <span class="package-version">v{{viewedPackage.artifactVersion}}</span>
</div>
<div class="col-12 package-description">
Last modified {{ viewedPackage.createdDate | date:'short' }} By
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 4a92943e3..e1e33a39a 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
@@ -14,6 +14,7 @@ import {PackageCreationBuilder} from '../package-creation/creationModes/PackageC
import {saveAs} from 'file-saver';
import {DesignerStore} from '../designer/designer.store';
import {DesignerService} from '../designer/designer.service';
+import {ToastrService} from 'ngx-toastr';
@Component({
selector: 'app-configuration-dashboard',
@@ -42,7 +43,9 @@ export class ConfigurationDashboardComponent implements OnInit {
private packageCreationUtils: PackageCreationUtils,
private router: Router,
private designerStore: DesignerStore,
- private designerService: DesignerService) {
+ private designerService: DesignerService,
+ private toastService: ToastrService
+ ) {
}
ngOnInit() {
@@ -164,8 +167,17 @@ export class ConfigurationDashboardComponent implements OnInit {
this.create();
this.zipFile.generateAsync({type: 'blob'})
.then(blob => {
- this.packageCreationStore.saveBluePrint(blob);
- this.router.navigate(['/packages']);
+ this.packageCreationStore.saveBluePrint(blob).subscribe(
+ bluePrintDetailModels => {
+ if (bluePrintDetailModels) {
+ const id = bluePrintDetailModels.toString().split('id')[1].split(':')[1].split('"')[1];
+ this.toastService.info('package updated successfully ');
+ this.router.navigate(['/packages/package/' + id]);
+ }
+ }, error => {
+ this.toastService.error('error happened when editing ' + error.message);
+ console.log('Error -' + error.message);
+ });
});
}