diff options
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard')
4 files changed, 26 insertions, 6 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.spec.ts index 90ecb8565..f76cf2133 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.spec.ts @@ -75,9 +75,10 @@ describe('Drawing board tree Service', () => { new TreeNodeContextMenuModel('undoDelete', 'context-menu-undoDelete', 'Undo Delete', 'undo-delete'), new TreeNodeContextMenuModel('undoUpgrade', 'context-menu-undoUpgrade', 'Undo Upgrade', 'undo-delete'), new TreeNodeContextMenuModel('changeAssociations', 'context-menu-changeAssociations', 'Change Associations', 'edit-file-o'), - new TreeNodeContextMenuModel('pauseInstantiation', 'context-menu-pause', 'Add pause upon completion', 'pause-upon-completion') + new TreeNodeContextMenuModel('pauseInstantiation', 'context-menu-pause', 'Add pause upon completion', 'pause-upon-completion'), + new TreeNodeContextMenuModel('removePause', 'context-menu-removePause', 'Remove Pause', 'pause-upon-completion') ]; - expect(options.length).toEqual(11); + expect(options.length).toEqual(12); expect(options).toEqual(expected); }); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts index 3fc5c531c..fe3f0932a 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts @@ -54,7 +54,8 @@ export class DrawingBoardTreeService { new TreeNodeContextMenuModel('undoDelete', 'context-menu-undoDelete', 'Undo Delete', 'undo-delete'), new TreeNodeContextMenuModel('undoUpgrade', 'context-menu-undoUpgrade', 'Undo Upgrade', 'undo-delete'), new TreeNodeContextMenuModel('changeAssociations', 'context-menu-changeAssociations', 'Change Associations', 'edit-file-o'), - new TreeNodeContextMenuModel('pauseInstantiation', 'context-menu-pause', 'Add pause upon completion', 'pause-upon-completion') + new TreeNodeContextMenuModel('pauseInstantiation', 'context-menu-pause', 'Add pause upon completion', 'pause-upon-completion'), + new TreeNodeContextMenuModel('removePause', 'context-menu-removePause', 'Remove Pause', 'pause-upon-completion') ]; } diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts index f7bf35abd..33ec0804f 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts @@ -23,6 +23,7 @@ import { deleteActionVfModuleInstance, deleteVFModuleField, pauseActionVFModuleInstance, + removePauseActionVFModuleInstance, removeVfModuleInstance, undoDeleteVfModuleInstance, undoUgradeVFModule, @@ -393,7 +394,14 @@ export class VFModuleModelInfo implements ILevelNodeInfo { method: (node, serviceModelId) => { this._store.dispatch(pauseActionVFModuleInstance(node.data.dynamicModelName, node.parent.data.vnfStoreKey, serviceModelId, node.data.modelName)); }, - visible: () => this._sharedTreeService.shouldShowPauseInstantiation(), + visible: () => this._sharedTreeService.shouldShowPauseInstantiation(node), + enable: () => true, + }, + removePause: { + method: (node, serviceModelId) => { + this._store.dispatch(removePauseActionVFModuleInstance(node.data.dynamicModelName, node.parent.data.vnfStoreKey, serviceModelId, node.data.modelName)); + }, + visible: () => this._sharedTreeService.shouldShowRemovePause(node), enable: () => true, } }; diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts index 98edb4161..3b00e64c3 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts @@ -1,7 +1,7 @@ import {Injectable} from "@angular/core"; import {NgRedux} from "@angular-redux/store"; import {AppState} from "../../../shared/store/reducers"; -import {ServiceInstanceActions} from "../../../shared/models/serviceInstanceActions"; +import {PauseStatus, ServiceInstanceActions} from "../../../shared/models/serviceInstanceActions"; import {MessageBoxData} from "../../../shared/components/messageBox/messageBox.data"; import {MessageBoxService} from "../../../shared/components/messageBox/messageBox.service"; import * as _ from "lodash"; @@ -222,7 +222,17 @@ export class SharedTreeService { } } - shouldShowPauseInstantiation(): boolean { + shouldShowRemovePause(node) : boolean { + if(FeatureFlagsService.getFlagState(Features.FLAG_2008_REMOVE_PAUSE_INSTANTIATION, this._store)){ + return node.pauseInstantiation === PauseStatus.AFTER_COMPLETION; + } + return false; + } + + shouldShowPauseInstantiation(node): boolean { + if(FeatureFlagsService.getFlagState(Features.FLAG_2008_REMOVE_PAUSE_INSTANTIATION, this._store)){ + return (FeatureFlagsService.getFlagState(Features.FLAG_2006_PAUSE_VFMODULE_INSTANTIATION_CREATION, this._store) && node.pauseInstantiation == null); + } return (FeatureFlagsService.getFlagState(Features.FLAG_2006_PAUSE_VFMODULE_INSTANTIATION_CREATION, this._store)); } /**************************************************** |