aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts
diff options
context:
space:
mode:
authorEinat Vinouze <einat.vinouze@intl.att.com>2019-08-27 16:01:01 +0300
committerIttay Stern <ittay.stern@att.com>2019-09-09 07:01:36 +0000
commite1f7974f0badbd4440d5b7ea5f1b1cb2d4973818 (patch)
tree46be9cdc44cbb475527bc3c43df23d16f7579d29 /vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts
parente25b88b5a7a0f3bf63ca7160a441b53145484bcc (diff)
Adding feature: Replace vfmodule
Issue-ID: VID-603 Change-Id: I59068a0979d6fb733e4243c8f78921f396dc9d17 Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com> Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com> Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts')
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts
index 6be5036b2..0e2d8e276 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts
@@ -28,6 +28,7 @@ import {ComponentInfoService} from "../component-info/component-info.service";
import {ComponentInfoModel} from "../component-info/component-info-model";
import {ObjectToModelTreeService} from "../objectsToTree/objectToModelTree/objectToModelTree.service";
import {DrawingBoardModes} from "../drawing-board.modes";
+import {ServiceInstanceActions} from "../../../shared/models/serviceInstanceActions";
@Component({
selector: 'drawing-board-tree',
@@ -203,6 +204,24 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit {
return false;
}
+
+
+ isUpgraded(node: ITreeNode): boolean {
+ return this.isLabeledAsAction(node, "Upgrade");
+ }
+
+ isDeleted(node: ITreeNode): boolean {
+ return this.isLabeledAsAction(node, "Delete");
+ }
+
+ private isLabeledAsAction(node: ITreeNode, action) {
+ let nodeAction = node.data.action.split('_').pop();
+ if (!_.isNil(nodeAction)) {
+ return nodeAction === action;
+ }
+ return false;
+ }
+
public selectNode(node: ITreeNode): void {
node.expand();
this._sharedTreeService.setSelectedVNF(node);
@@ -220,6 +239,13 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit {
this.tree.treeModel.getNodeById(id).parent.expand();
}
+ getcontextMenuOptionLabel(contextMenuOption: TreeNodeContextMenuModel): string{
+ let optionLabel = contextMenuOption.label;
+ if(contextMenuOption.label === ServiceInstanceActions.Upgrade) {
+ return optionLabel.concat(" to V" + this._store.getState().service.serviceInstance[this.serviceModelId].latestAvailableVersion);
+ }
+ return optionLabel;
+ }
}