summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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/action-attributes/action-attributes.component.html71
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts127
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html6
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts12
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts2
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html2
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts13
-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
-rw-r--r--docs/usecases/pnf-simulator.rst6
11 files changed, 190 insertions, 83 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/action-attributes/action-attributes.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html
index 5a0c9aaad..013fa8af9 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html
@@ -14,8 +14,8 @@
<div class="row">
<div class="col pr-0 text-center">
<button type="button" data-toggle="modal" data-target="#exampleModalScrollable"
- class="btn btn-secondary"><i class="icon-custom-attribute" type="button"
- aria-hidden="true"></i></button>
+ class="btn btn-secondary" (click)="clearFormInputs()"><i class="icon-custom-attribute" type="button"
+ aria-hidden="true" ></i></button>
<span>Create Custom</span>
</div>
<div class="col text-center">
@@ -43,7 +43,7 @@
<div class="row">
<div class="col">
<div class="form-group" *ngFor="let input of inputs">
- <label for="exampleFormControlTextarea1">{{input.name}}
+ <label >{{input.name}}
<i [hidden]="!input.required" class="icon-required-star" type="button"
aria-hidden="true"></i>
<i [hidden]="input.required" class="icon-required-star optional-attribute"
@@ -52,7 +52,7 @@
<div class="attributeOptions">
<a data-toggle="modal" data-target="#exampleModalScrollable2"
class="accordion-delete editAttribute" tooltip="Edit Attribute"
- placement="bottom"><i class="icon-edit"></i></a>
+ placement="bottom" (click)="editAttribute(input)"><i class="icon-edit"></i></a>
<a class="accordion-delete deleteAttribute" tooltip="Delete Attribute"
placement="bottom"><i class="icon-delete-sm"></i></a>
</div>
@@ -80,13 +80,20 @@
<div class="row">
<div class="col">
<div class="form-group" *ngFor="let output of outputs">
- <label for="exampleFormControlTextarea1">{{output.name}}
+ <label >{{output.name}}
<i [hidden]="!output.required" class="icon-required-star" type="button"
aria-hidden="true"></i>
<i [hidden]="output.required" class="icon-required-star optional-attribute"
type="button" aria-hidden="true"></i>
</label>
+ <div class="attributeOptions">
+ <a data-toggle="modal" data-target="#exampleModalScrollable2"
+ class="accordion-delete editAttribute" tooltip="Edit Attribute"
+ placement="bottom" (click)="editAttribute(output)"><i class="icon-edit"></i></a>
+ <a class="accordion-delete deleteAttribute" tooltip="Delete Attribute"
+ placement="bottom"><i class="icon-delete-sm"></i></a>
+ </div>
</div>
</div>
</div>
@@ -277,11 +284,6 @@
)"></i></a>
</div>
</div>
- <div class="carousel__snapper" [hidden]="!isNotComponentResourceResolution">
- <a href="#carousel__slide4" [hidden]="isParametersHidden"
- class="carousel__prev">Parameters</a>
- <a href="#carousel__slide2" class="carousel__next">Attributes</a>
- </div>
</li>
<!--Attribute-->
<li id="carousel__slide2" tabindex="1" class="carousel__slide">
@@ -294,13 +296,13 @@
<div class="scrollWrapper">
<div *ngIf="suggestedAttributes.length>0"
class="btn-group btn-group-toggle" data-toggle="buttons">
- <label class="btn btn-secondary active"
+ <label class="btn btn-secondary"
*ngFor="let suggestedAttribute of suggestedAttributes"
[id]="suggestedAttribute"
(click)="addTempOutputAttr(suggestedAttribute)">
<input type="radio" name="options"
[id]="suggestedAttribute+'.,.'"
- autocomplete="off">
+ autocomplete="off" [checked]="suggestedAttributes[0].includes(suggestedAttribute)">
{{suggestedAttribute}}
</label>
@@ -311,11 +313,6 @@
</div>
</div>
</div>
- <div class="carousel__snapper"></div>
- <a href="#carousel__slide1" class="carousel__prev">Functions</a>
- <a href="#carousel__slide3" [hidden]="!isNotComponentResourceResolution"
- class="carousel__next">Artifacts</a>
-
</li>
<!--Artifact-->
<li id="carousel__slide3" [hidden]="isNotComponentResourceResolution" tabindex="2"
@@ -329,12 +326,14 @@
<div class="scrollWrapper">
<div *ngIf="currentArtifacts.length>0"
class="btn-group btn-group-toggle" data-toggle="buttons">
- <label class="btn btn-secondary active"
+ <label class="btn btn-secondary"
*ngFor="let suggestedArtifact of currentArtifacts"
(click)="addArtifactFile(suggestedArtifact)">
<input type="radio" name="options" [id]="suggestedArtifact"
autocomplete="off"
- (click)="addTempOutputAttr(suggestedArtifact)">
+ (click)="addArtifactFile(suggestedArtifact)"
+ [checked]="currentArtifacts[0].includes(suggestedArtifact)"
+ >
{{suggestedArtifact}}
</label>
@@ -345,11 +344,6 @@
</div>
</div>
</div>
- <div class="carousel__snapper" [hidden]="!isNotComponentResourceResolution">
- <a href="#carousel__slide2" class="carousel__prev">Attributes</a>
- <a href="#carousel__slide4" [hidden]="isParametersHidden"
- class="carousel__next">Parmeters</a>
- </div>
</li>
<!--Parameter-->
<li id="carousel__slide4"
@@ -362,29 +356,28 @@
<div class="tab-pane fade show active" id="list-home" role="tabpanel"
aria-labelledby="list-home-list">
<div class="scrollWrapper">
- <div *ngIf="suggestedAttributes.length>0"
+ <div *ngIf="suggestedMappingParameters.length>0"
class="btn-group btn-group-toggle" data-toggle="buttons">
- <label class="btn btn-secondary active"
- *ngFor="let suggestedAttribute of suggestedAttributes"
- (click)="addTempOutputAttr(suggestedAttribute)">
- <input type="radio" name="options" [id]="suggestedAttribute"
+ <label class="btn btn-secondary"
+ *ngFor="let suggestedMappingParameter of suggestedMappingParameters"
+ (click)="addSuggestedMappingParameter(suggestedMappingParameter)">
+ <!--[class]="suggestedMappingParameters[0].includes(suggestedMappingParameter)?'btn btn-secondary active':'btn btn-secondary'">
+ --> <input type="radio" name="options" [id]="suggestedMappingParameter"
autocomplete="off"
- (click)="addTempOutputAttr(suggestedAttribute)">
- {{suggestedAttribute}}
+ (click)="addSuggestedMappingParameter(suggestedMappingParameter)"
+ [checked]="suggestedMappingParameters[0].includes(suggestedMappingParameter)"
+
+ >
+ {{suggestedMappingParameter}}
</label>
</div>
- <div *ngIf="suggestedAttributes.length == 0">
+ <div *ngIf="suggestedMappingParameters.length == 0">
<p class="noAttributes">No Attributes Available</p>
</div>
</div>
</div>
</div>
- <div class="carousel__snapper"></div>
- <a href="#carousel__slide3" [hidden]="isNotComponentResourceResolution"
- class="carousel__prev">Artifacts</a>
- <a href="#carousel__slide1" class="carousel__next">Functions</a>
-
</li>
</ol>
<aside class="carousel__navigation">
@@ -434,11 +427,11 @@
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#input" role="tab"
- aria-controls="home" aria-selected="true">Inputs</a>
+ aria-controls="home" aria-selected="true" >Inputs</a>
</li>
<li class="nav-item">
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#output" role="tab"
- aria-controls="profile" aria-selected="false">Outputs</a>
+ aria-controls="profile" aria-selected="false" >Outputs</a>
</li>
</ul>
<div class="tab-content border-0 mt-2" id="myTabContent">
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts
index babfec772..668aff9b5 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts
@@ -5,6 +5,8 @@ import {DesignerDashboardState} from '../model/designer.dashboard.state';
import {Action} from './models/Action';
import {FunctionsStore} from '../functions.store';
import {FunctionsState} from '../model/functions.state';
+import {PackageCreationStore} from '../../package-creation/package-creation.store';
+import {CBAPackage} from '../../package-creation/mapping-models/CBAPacakge.model';
@Component({
selector: 'app-action-attributes',
@@ -44,8 +46,14 @@ export class ActionAttributesComponent implements OnInit {
isNotComponentResourceResolution = true;
currentArtifacts: string[] = [];
isParametersHidden = true;
+ cbaPackage: CBAPackage;
+ suggestedMappingParameters: string[] = [];
+ selectedParameterList: string[] = [];
+ currentSuggestedArtifact: string;
- constructor(private designerStore: DesignerStore, private functionsStore: FunctionsStore) {
+ constructor(private designerStore: DesignerStore,
+ private functionsStore: FunctionsStore,
+ private packageCreationStore: PackageCreationStore) {
}
@@ -82,6 +90,12 @@ export class ActionAttributesComponent implements OnInit {
this.functionsStore.state$.subscribe(functions => {
this.functions = functions;
});
+
+ this.packageCreationStore.state$
+ .subscribe(cbaPackage => {
+ this.cbaPackage = cbaPackage;
+
+ });
}
@@ -139,23 +153,47 @@ export class ActionAttributesComponent implements OnInit {
submitAttributes() {
this.addInput(this.inputActionAttribute);
if (this.selectedFunctionName && this.selectedAttributeName) {
+ console.log(this.getValue());
this.outputActionAttribute.value =
- '["' + this.selectedFunctionName + '","' + this.selectedAttributeName + '"]';
+ this.getValue();
}
this.addOutput(this.outputActionAttribute);
this.clearFormInputs();
this.storeOutputs(this.newOutputs);
this.storeInputs((this.newInputs));
this.newInputs.forEach(input => {
- this.inputs.push(input);
+ if (!this.inputs.includes(input)) {
+ this.inputs.push(input);
+ }
});
this.newOutputs.forEach(output => {
- this.outputs.push(output);
+ if (!this.outputs.includes(output)) {
+ this.outputs.push(output);
+ }
});
}
- private clearFormInputs() {
+ private getValue() {
+ let value = '["' + this.selectedFunctionName + '", "' + '","' + this.selectedAttributeName;
+
+ if (!this.isParametersHidden) {
+ let currentSelected = '';
+ for (const selectedParameter of this.selectedParameterList) {
+ currentSelected += '"' + selectedParameter + '",';
+ }
+ value += '","' + this.currentSuggestedArtifact + '",'
+ + currentSelected.substr(0, currentSelected.length - 2) + '';
+ } else if (!this.isNotComponentResourceResolution && this.currentSuggestedArtifact) {
+ value += '","' + this.currentSuggestedArtifact + '';
+
+ }
+
+ return value += '"]';
+ }
+
+ public clearFormInputs() {
+ console.log('trying to clear ');
this.inputActionAttribute = new InputActionAttribute();
this.outputActionAttribute = new OutputActionAttribute();
this.outputOtherType = '';
@@ -167,9 +205,11 @@ export class ActionAttributesComponent implements OnInit {
let inputs = '';
InputActionAttributes.forEach(input => {
inputs += this.appendAttributes(input);
-
+ console.log(inputs);
});
- this.writeAttribute(inputs, 'inputs');
+ if (inputs.length > 0) {
+ this.writeAttribute(inputs, 'inputs');
+ }
}
private storeOutputs(OutputActionAttributes: OutputActionAttribute[]) {
@@ -177,7 +217,10 @@ export class ActionAttributesComponent implements OnInit {
OutputActionAttributes.forEach(output => {
outputs += this.appendOutputAttributes(output);
});
- this.writeAttribute(outputs, 'outputs');
+ if (outputs.length > 0) {
+ this.writeAttribute(outputs, 'outputs');
+ }
+
}
private appendAttributes(inputActionAttribute: InputActionAttribute) {
@@ -307,15 +350,28 @@ export class ActionAttributesComponent implements OnInit {
private writeAttribute(newAttributes: string, attributeType: string) {
newAttributes = this.removeTheLastComma(newAttributes);
- const originalAttributes = this.convertToString(this.designerState.template.workflows[this.actionName]
+ console.log(newAttributes);
+ let originalAttributes = this.convertToString(this.designerState.template.workflows[this.actionName]
+ [attributeType]);
+ this.createAttributeTypeIfNotExisted(originalAttributes, attributeType);
+ originalAttributes = this.convertToString(this.designerState.template.workflows[this.actionName]
[attributeType]);
- console.log(originalAttributes.substr(0, originalAttributes.length - 1) + ',' + newAttributes + '}');
- this.designerState.template.workflows[this.actionName][attributeType] =
- this.convertToObject(originalAttributes.substr(0, originalAttributes.length - 1)
- + ',' + newAttributes + '}');
+ if (originalAttributes.length > 2) {
+ this.designerState.template.workflows[this.actionName][attributeType] =
+ this.convertToObject(originalAttributes.substr(0, originalAttributes.length - 1)
+ + ',' + newAttributes + '}');
+ } else {
+ this.designerState.template.workflows[this.actionName][attributeType] =
+ this.convertToObject(originalAttributes.substr(0, originalAttributes.length - 1)
+ + newAttributes + '}');
+ }
+ /* console.log(originalAttributes.substr(0, originalAttributes.length - 1) + ',' + newAttributes + '}');
+ this.designerState.template.workflows[this.actionName][attributeType] =
+ this.convertToObject(originalAttributes.substr(0, originalAttributes.length - 1)
+ + ',' + newAttributes + '}');*/
}
- private removeTheLastComma = (newInputs: string) => {
+ private removeTheLastComma(newInputs: string): string {
if (newInputs.endsWith(',')) {
newInputs = newInputs.substr(0, newInputs.length - 1);
}
@@ -332,16 +388,15 @@ export class ActionAttributesComponent implements OnInit {
getAttributesAndOutputs(functionName: string) {
this.suggestedAttributes = [];
console.log(functionName);
- if (functionName.includes('component-resource-resolution')) {
+
+ const nodeTemplate = this.designerState.template.node_templates[functionName];
+ if (nodeTemplate['type'].includes('component-resource-resolution')) {
this.isNotComponentResourceResolution = false;
this.isParametersHidden = true;
} else {
this.isNotComponentResourceResolution = true;
this.isParametersHidden = true;
}
- const nodeTemplate = this.designerState.template.node_templates[functionName];
- console.log(this.designerState.template.node_templates);
- console.log(nodeTemplate);
/* tslint:disable:no-string-literal */
console.log(nodeTemplate['type']);
this.functions.serverFunctions
@@ -394,8 +449,40 @@ export class ActionAttributesComponent implements OnInit {
}
addArtifactFile(suggestedArtifact: string) {
- console.log(suggestedArtifact);
+ this.currentSuggestedArtifact = suggestedArtifact;
this.isParametersHidden = !this.selectedAttributeName.includes('assignment-map');
- console.log('assignement map ' + this.isParametersHidden);
+ if (!this.isParametersHidden) {
+ this.suggestedMappingParameters = this.getSuggestedMappingParameters(suggestedArtifact);
+ }
+ }
+
+ private getSuggestedMappingParameters(suggestedArtifact: string) {
+ const suggestedMappingParameters = [];
+
+ this.cbaPackage.mapping.files.forEach(((value, key) => {
+ if (key.includes(suggestedArtifact)) {
+
+ JSON.parse(value).forEach(value2 => {
+ suggestedMappingParameters.push(value2['name']);
+ });
+ }
+ }));
+ return suggestedMappingParameters;
+ }
+
+ addSuggestedMappingParameter(suggestedMappingParameter: string) {
+ this.addAttribute(this.selectedParameterList, suggestedMappingParameter);
+ this.deleteAttribute(this.suggestedMappingParameters, suggestedMappingParameter);
+
+ }
+
+ editAttribute(input: any) {
+ console.log(input);
+ }
+
+ private createAttributeTypeIfNotExisted(originalAttributes: string, attributeType: string) {
+ if (!originalAttributes) {
+ this.designerState.template.workflows[this.actionName][attributeType] = {};
+ }
}
}
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html
index 3ca377df7..b0bfe8be7 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html
@@ -10,7 +10,7 @@
</li>
<i class="fa fa-angle-right ml-2 mr-2"></i>
<li class="breadcrumb-item">
- <a routerLink="/packages/package/{{viewedPackage.id}}">{{viewedPackage.artifactName}}</a>
+ <a routerLink="/packages/package/{{packageId}}">{{viewedPackage.artifactName}}</a>
<button type="button" class="btn package-info-btn tooltip-bottom" data-toggle="modal"
data-target="#exampleModalLong" data-tooltip="Package Details">
<i class="icon-info" aria-hidden="true"></i>
@@ -161,7 +161,7 @@
<li class="nav-item">
<div class="btn-group viewBtns" role="group">
<button type="button" class="btn btn-secondary topologySource active">Designer</button>
- <button [routerLink]="['/designer/source', viewedPackage.id]" type="button"
+ <button [routerLink]="['/designer/source', packageId]" type="button"
class="btn btn-secondary topologyView">Scripting
</button>
</div>
@@ -336,7 +336,7 @@
</div>
</div>
</div>
- <app-functions-attribute></app-functions-attribute>
+ <app-functions-attribute (saveEvent)="saveBluePrint()"></app-functions-attribute>
</div>
</div>
</div>
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts
index 88f28b780..a2b57d6ad 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts
@@ -85,6 +85,7 @@ export class DesignerComponent implements OnInit, OnDestroy {
steps: string[];
designerState: DesignerDashboardState;
currentActionName: string;
+ packageId: any;
constructor(
private designerStore: DesignerStore,
@@ -98,6 +99,7 @@ export class DesignerComponent implements OnInit, OnDestroy {
private designerService: DesignerService,
private packageCreationService: PackageCreationService,
private packageCreationExtractionService: PackageCreationExtractionService,
+ private activatedRoute: ActivatedRoute,
private toastService: ToastrService) {
this.controllerSideBar = true;
this.actionAttributesSideBar = false;
@@ -240,6 +242,13 @@ export class DesignerComponent implements OnInit, OnDestroy {
for (const workflowsKey in topologtTemplate.workflows) {
if (workflowsKey && !this.actions.includes(workflowsKey)) {
this.actions.push(workflowsKey);
+ /* tslint:disable:no-string-literal */
+ if (!this.designerState.template.workflows[workflowsKey]['inputs']) {
+ this.designerState.template.workflows[workflowsKey]['inputs'] = {};
+ }
+ if (!this.designerState.template.workflows[workflowsKey]['outputs']) {
+ this.designerState.template.workflows[workflowsKey]['outputs'] = {};
+ }
}
}
}
@@ -247,6 +256,9 @@ export class DesignerComponent implements OnInit, OnDestroy {
// action triggering
this.functionStore.retrieveFuntions();
+ this.activatedRoute.paramMap.subscribe(res => {
+ this.packageId = res.get('id');
+ });
}
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts
index 857654c56..c9151c558 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts
@@ -78,7 +78,7 @@ export class DesignerStore extends Store<DesignerDashboardState> {
}
saveSourceContent(code: string) {
- console.log(code);
+ // console.log(code);
if (code) {
const topologyTemplate = JSON.parse(code);
this.setState({
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html
index ab5bb123e..505844c57 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html
@@ -206,7 +206,7 @@
</div>
</div>
</div>
- <button class="btn btn-info" (click)="saveFunctionData()">Save</button>
+ <button class="btn btn-info btn-select-template m-auto" (click)="saveFunctionData()">Save</button>
</div>
<!--function - Select Template - Modal-->
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 347f304c8..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
@@ -1,4 +1,4 @@
-import { Component, OnDestroy, OnInit } from '@angular/core';
+import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
import { DesignerStore } from '../designer.store';
import { PackageCreationStore } from '../../package-creation/package-creation.store';
import { Subject } from 'rxjs';
@@ -34,6 +34,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
actionName = '';
functionName = '';
interfaceChildName = '';
+ @Output() saveEvent = new EventEmitter<string>();
constructor(
@@ -132,7 +133,11 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
if (inputs) {
for (const [key, value] of Object.entries(inputs)) {
console.log(key + ' - ' + value);
- this.currentFuncion.inputs[key] = value;
+ if (typeof value === 'object') {
+ this.currentFuncion.inputs[key] = JSON.stringify(value);
+ } else {
+ this.currentFuncion.inputs[key] = value;
+ }
}
}
if (outputs) {
@@ -182,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'
};
}
@@ -210,6 +215,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
console.log(node_templates);
// tslint:disable-next-line: no-unused-expression
this.designerStore.addNodeTemplate(instanceName, type, node_templates[instanceName]);
+ this.saveEvent.emit('save');
}
// Template logic
private setIsMappingOrTemplate(key: string, templateAndMapping: TemplateAndMapping, isFromTemplate: boolean) {
@@ -262,6 +268,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
getObjectValue(object) {
return Object.values(object);
}
+
getNodeType(nodeName: string) {
this.functionStore.state$
.subscribe(state => {
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() {
diff --git a/docs/usecases/pnf-simulator.rst b/docs/usecases/pnf-simulator.rst
index 3712253ee..2f6c8472d 100644
--- a/docs/usecases/pnf-simulator.rst
+++ b/docs/usecases/pnf-simulator.rst
@@ -42,12 +42,6 @@ here but they are not tested by the author of this guide.
.. tab:: sysrepo/sysrepo-netopeer2 (latest)
- .. warning::
- Currently there is an issue for the SSH connection between CDS and the netconf server because of unmatching
- exchange key algorhithms
- (see `Stackoverflow <https://stackoverflow.com/questions/64047502/java-lang-illegalstateexception-unable-to-negotiate-key-exchange-for-server-hos>`_).
- **Use legacy version (right tab) until the issue is resolved.**
-
Download and run docker container with ``docker run -d --name netopeer2 -p 830:830 -p 6513:6513 sysrepo/sysrepo-netopeer2:latest``
Enter the container with ``docker exec -it netopeer2 bin/bash``