summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts
diff options
context:
space:
mode:
authorikram <ikram@research.att.com>2020-08-07 15:49:11 -0400
committerKruthi Bhat <krutbhat@att.com>2020-08-10 19:21:30 +0000
commit32af6479c686d217204de3a86940ac1256da4b9f (patch)
tree98eb5135887c5bf5943099a783c9cd3d7dbbd8a4 /vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts
parent09a6562a16715a2b89be11c941486be783c72364 (diff)
Visualization of the VF Module Sequencing
Issue-ID: VID-860 More scenarios covered in VID-860 for vf-module sequencing. Signed-off-by: ikram <ikram@research.att.com> Change-Id: Ie138ba2616961fba7856eaaf5f17b5dc63a08e6e
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts')
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts15
1 files changed, 13 insertions, 2 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts
index 2014be99d..8790afa56 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts
@@ -168,8 +168,19 @@ export class AvailableModelsTreeComponent {
DrawingBoardTreeService.triggerCheckIsDirty.next(this.serviceModelId);
} else {
let vfModule = this._defaultDataGeneratorService.generateVFModule(this.serviceHierarchy.vnfs[node.parent.data.name].vfModules[node.data.name], dynamicInputs, isEcompGeneratedNaming, isAlaCarte);
+ let positionOfNextInstance = null;
+ if(this._sharedTreeService.isAddPositionFlagTrue()) {
+ let baseModule = this.serviceHierarchy.vnfs[node.parent.data.name].vfModules[node.data.name].properties.baseModule;
+ if(baseModule) {
+ //Assign Position of 1 for the instance being created & update the positions(existing position +1) for remaining instances
+ positionOfNextInstance = 1;
+ this._defaultDataGeneratorService.updatePositionForRemainingVfModules(this.serviceModelId);
+ } else {
+ positionOfNextInstance = this._defaultDataGeneratorService.calculatePositionOfVfmodule(this.serviceModelId);
+ }
+ }
if (this._sharedTreeService.selectedVNF) {
- this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId, null, this._sharedTreeService.selectedVNF));
+ this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId, positionOfNextInstance, this._sharedTreeService.selectedVNF));
DrawingBoardTreeService.triggerCheckIsDirty.next(this.serviceModelId);
} else if (this._availableModelsTreeService.getOptionalVNFs(this.serviceModelId, node.parent.data.modelUniqueId).length === 1) {
let existVnf = this._store.getState().service.serviceInstance[this.serviceModelId].vnfs;
@@ -177,7 +188,7 @@ export class AvailableModelsTreeComponent {
for(let vnfKey in existVnf){
const modelUniqueId = this._sharedTreeService.modelUniqueId(existVnf[vnfKey]);
if(modelUniqueId === node.parent.data.id){
- this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId, null, vnfKey));
+ this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId, positionOfNextInstance, vnfKey));
DrawingBoardTreeService.triggerCheckIsDirty.next(this.serviceModelId);
}
}