<ul class="breadcrumb-header">
<li><a routerLink="/packages">CBA Packages</a></li>
<i class="fa fa-angle-right ml-2 mr-2"></i>
- <li>Package Name</li>
+ <li>{{viewedPackage.artifactName}}</li>
</ul>
</h2>
<div class="col">
<div class="form-group text-center">
<input type="text" class="form-control customAction"
placeholder="Type Action Name" autofocus>
- <button type="button" class="btn submit">Start</button>
+ <button type="button" (click)="goToDesignerMode(viewedPackage.id)" class="btn submit">Start</button>
</div>
</div>
<div class="row">
<div class="col text-center">
<p class="selectedActions">0 selected</p>
- <button type="button"
+ <button type="button" (click)="goToDesignerMode(viewedPackage.id)"
class="btn submit">Start</button>
</div>
</div>
this.router.navigate(['/packages']);
}
- goToDesignerMode() {
- this.router.navigate(['/packages/designer']);
- }
+ goToDesignerMode(id) {
+ this.router.navigate(['/packages/designer', id]);
+ }
}
</li>
<i class="fa fa-angle-right ml-2 mr-2"></i>
<li class="breadcrumb-item">
- <a href="#">Package Name</a>
+ <a href="/package/{{viewedPackage.id}}">{{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>
<div class="source-button editBar">
<div class="btn-group viewBtns" role="group">
<button type="button" class="btn btn-secondary topologySource active">Designer</button>
- <button [routerLink]="['/designer/source']" type="button"
+ <button [routerLink]="['/designer/source', viewedPackage.id]" type="button"
class="btn btn-secondary topologyView">Scripting</button>
</div>
</div>
===================================================================
Copyright (C) 2019 Orange. All rights reserved.
===================================================================
+Modification Copyright (c) 2020 IBM
+===================================================================
Unless otherwise specified, all software contained herein is licensed
under the Apache License, Version 2.0 (the License);
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { distinctUntilChanged } from 'rxjs/operators';
+import { BluePrintDetailModel } from '../model/BluePrint.detail.model';
+import { ActivatedRoute } from '@angular/router';
+import { DesignerService } from './designer.service';
@Component({
private controllerSideBar: boolean;
private attributesSideBar: boolean;
+ viewedPackage: BluePrintDetailModel = new BluePrintDetailModel();
boardGraph: joint.dia.Graph;
boardPaper: joint.dia.Paper;
constructor(private designerStore: DesignerStore,
private functionStore: FunctionsStore,
private graphUtil: GraphUtil,
- private graphGenerator: GraphGenerator) {
+ private graphGenerator: GraphGenerator,
+ private route: ActivatedRoute,
+ private designerService: DesignerService) {
this.controllerSideBar = true;
this.attributesSideBar = false;
this.initializePalette();
this.stencilPaperEventListeners();
+ const id = this.route.snapshot.paramMap.get('id');
+ this.designerService.getPagedPackages(id).subscribe(
+ (bluePrintDetailModels) => {
+ if (bluePrintDetailModels) {
+ this.viewedPackage = bluePrintDetailModels[0];
+ }
+ });
+
/**
* the code to retrieve from server is commented
*/
===================================================================
Copyright (C) 2019 Orange. All rights reserved.
===================================================================
+Modification Copyright (c) 2020 IBM
+===================================================================
Unless otherwise specified, all software contained herein is licensed
under the Apache License, Version 2.0 (the License);
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {ApiService} from '../../../../common/core/services/api.typed.service';
-import {ResourceDictionaryURLs} from '../../../../common/constants/app-constants';
+import {ResourceDictionaryURLs, BlueprintURLs} from '../../../../common/constants/app-constants';
import {ModelType} from './model/ModelType.model';
+import { BluePrintDetailModel } from '../model/BluePrint.detail.model';
@Injectable({
})
export class DesignerService {
- constructor(private api: ApiService<ModelType>) {
+ constructor(private api: ApiService<ModelType>,
+ private api2: ApiService<BluePrintDetailModel>) {
}
getFunctions(modelDefinitionType: string): Observable<ModelType[]> {
return this.api.get(ResourceDictionaryURLs.getResourceDictionary + '/' + modelDefinitionType);
}
+ private getBluePrintModel(id: string): Observable<BluePrintDetailModel> {
+ return this.api2.getOne(BlueprintURLs.getOneBlueprint + '/' + id);
+ }
+
+ getPagedPackages(id: string) {
+ return this.getBluePrintModel(id);
+ }
+
}
<a href="#">CBA Packages</a>
</li>
<li class="breadcrumb-item">
- <a href="#">Package Name</a>
+ <a href="/package/{{viewedPackage.id}}">{{viewedPackage.artifactName}}</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
<p class="mb-0">Topology View</p>
</header>
<div class="source-button editBar">
<div class="btn-group viewBtns" role="group">
- <button (click)="convertAndOpenInDesingerView()" type="button" class="btn btn-secondary topologySource">Designer</button>
+ <button (click)="convertAndOpenInDesingerView(viewedPackage.id)" type="button" class="btn btn-secondary topologySource">Designer</button>
<button type="button"
class="btn btn-secondary topologyView active">Scripting</button>
</div>
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',
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;
}
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() {
--- /dev/null
+import {Injectable} from '@angular/core';
+import {Observable} from 'rxjs';
+import { ApiService } from 'src/app/common/core/services/api.typed.service';
+import { BluePrintDetailModel } from '../../model/BluePrint.detail.model';
+import { ModelType } from '../model/ModelType.model';
+import { ResourceDictionaryURLs, BlueprintURLs } from 'src/app/common/constants/app-constants';
+
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class SourceViewService {
+
+ constructor(private api1: ApiService<BluePrintDetailModel>) {
+ }
+
+
+ private getBluePrintModel(id: string): Observable<BluePrintDetailModel> {
+ return this.api1.getOne(BlueprintURLs.getOneBlueprint + '/' + id);
+ }
+ getPagedPackages(id: string) {
+ return this.getBluePrintModel(id);
+ }
+
+}
path: '',
component: PackagesDashboardComponent
},
- {path: 'designer', component: DesignerComponent},
- { path: 'designer/source', component: DesignerSourceViewComponent },
+ {path: 'designer/:id', component: DesignerComponent},
+ {path: 'designer/source/:id', component: DesignerSourceViewComponent},
{path: 'package/:id', component: ConfigurationDashboardComponent},
- {path: 'createPackage', component: PackageCreationComponent},
+ {path: 'createPackage', component: PackageCreationComponent}
];
@NgModule({