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-09-22 11:56:38 +0200
committerShaabanEltanany <shaaban.eltanany.ext@orange.com>2020-09-22 22:29:23 +0200
commit81d82489f5592770a9e5f9ee137bfc1558b48153 (patch)
tree0cb464ad59e1477462faa4c0f2e409431b5821eb /cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard
parent2c2fa8779bc21dabbe8b5367eca5dec55afae3c2 (diff)
adding saving simple function at designer
Issue-ID: CCSDK-2298 Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com> Change-Id: Id4ebd3413103d6433e84b3513c4f651176a9833f
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.ts26
1 files changed, 15 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 2b0521bb2..228953eb9 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
@@ -17,6 +17,7 @@ import {ToastrService} from 'ngx-toastr';
import {NgxFileDropEntry} from 'ngx-file-drop';
import {PackageCreationService} from '../package-creation/package-creation.service';
import {ComponentCanDeactivate} from '../../../../common/core/canDactivate/ComponentCanDeactivate';
+import {PackageCreationExtractionService} from '../package-creation/package-creation-extraction.service';
@Component({
selector: 'app-configuration-dashboard',
@@ -54,13 +55,17 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
private packageCreationUtils: PackageCreationUtils,
private router: Router,
private designerStore: DesignerStore,
- private toastService: ToastrService
+ private toastService: ToastrService,
+ private packageCreationExtractionService: PackageCreationExtractionService
) {
super();
+
this.packageCreationStore.state$.subscribe(
cbaPackage => {
this.cbaPackage = cbaPackage;
});
+
+
}
ngOnInit() {
@@ -83,9 +88,12 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
}
- private refreshCurrentPackage() {
+
+ private refreshCurrentPackage(id?) {
this.id = this.route.snapshot.paramMap.get('id');
- this.configurationDashboardService.getPagedPackages(this.id).subscribe(
+ console.log(this.id);
+ id = id ? id : this.id;
+ this.configurationDashboardService.getPagedPackages(id).subscribe(
(bluePrintDetailModels) => {
if (bluePrintDetailModels) {
this.viewedPackage = bluePrintDetailModels[0];
@@ -97,10 +105,10 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
private downloadCBAPackage(bluePrintDetailModels: BluePrintDetailModel) {
this.configurationDashboardService.downloadResource(
- bluePrintDetailModels[0].artifactName + '/' + bluePrintDetailModels[0].artifactVersion).subscribe(response => {
+ this.viewedPackage.artifactName + '/' + this.viewedPackage.artifactVersion).subscribe(response => {
const blob = new Blob([response], {type: 'application/octet-stream'});
this.currentBlob = blob;
- this.extractBlobToStore(blob, bluePrintDetailModels[0]);
+ this.extractBlobToStore(blob, this.viewedPackage);
});
}
@@ -218,8 +226,8 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
const id = bluePrintDetailModels.toString().split('id')[1].split(':')[1].split('"')[1];
this.toastService.info('package updated successfully ');
this.isSaveEnabled = false;
- this.id = id;
this.router.navigate(['/packages/package/' + id]);
+ this.refreshCurrentPackage(id);
}
}, error => {
this.toastService.error('error happened when editing ' + error.message);
@@ -266,11 +274,7 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
}
goToDesignerMode(id) {
- // this.designerService.setActionName(this.customActionName);
- this.packageCreationStore.state$.subscribe(cba => {
- console.log(cba);
- sessionStorage.setItem('cba', this.packageCreationUtils.transformToJson(cba));
- });
+
this.router.navigate(['/packages/designer', id, {actionName: this.customActionName}]);
}