diff options
author | 2020-05-14 18:13:14 +0530 | |
---|---|---|
committer | 2020-05-14 14:39:59 +0000 | |
commit | 8edf6f6c1ce26923439f3474f54904d05d076714 (patch) | |
tree | 39887c03c4a69b2c8ddfde7576bcf6b57d9eece4 /cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts | |
parent | ae362a76b5bef17db5c7c747b01b504f8ca2a66d (diff) |
Designer > Breadcrumb
1. Change Package name to current package name
2. Make package name link open to package view
Issue-ID: CCSDK-2247
Change-Id: Ica060beff9a0785d80c69cf971623dd45ebe75fe
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts | 21 |
1 files changed, 17 insertions, 4 deletions
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 34194e42f..e70d98d04 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 @@ -1,8 +1,11 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; import { DesignerStore } from '../designer.store'; import { PackageCreationUtils } from '../../package-creation/package-creation.utils'; -import { RouterLink, Router } from '@angular/router'; +import { RouterLink, Router, ActivatedRoute } from '@angular/router'; import { Subject } from 'rxjs'; +import { BluePrintDetailModel } from '../../model/BluePrint.detail.model'; +import { viewClassName } from '@angular/compiler'; +import { SourceViewService } from './source-view.service'; @Component({ selector: 'app-designer-source-view', @@ -15,10 +18,13 @@ export class DesignerSourceViewComponent implements OnInit, OnDestroy { lang = 'json'; private controllerSideBar: boolean; private ngUnsubscribe = new Subject(); + viewedPackage: BluePrintDetailModel = new BluePrintDetailModel(); constructor(private store: DesignerStore, private packageCreationUtils: PackageCreationUtils, - private router: Router) { + private router: Router, + private route: ActivatedRoute, + private sourceViewService: SourceViewService) { this.controllerSideBar = true; } @@ -29,13 +35,20 @@ export class DesignerSourceViewComponent implements OnInit, OnDestroy { this.content = this.packageCreationUtils.transformToJson(state.template); }); + const id = this.route.snapshot.paramMap.get('id'); + this.sourceViewService.getPagedPackages(id).subscribe( + (bluePrintDetailModels) => { + if (bluePrintDetailModels) { + this.viewedPackage = bluePrintDetailModels[0]; + } + }); } - convertAndOpenInDesingerView() { + convertAndOpenInDesingerView(id) { // TODO validate json against scheme console.log('convertAndOpenInDesingerView ...', this.content); this.store.saveSourceContent(this.content); - this.router.navigateByUrl('/packages/designer'); + this.router.navigate(['/packages/designer', id]); } ngOnDestroy() { |