diff options
author | Amichai Hemli <ah0398@intl.att.com> | 2019-07-09 14:23:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-07-09 14:23:37 +0000 |
commit | 58d22b526418ffeb89337fed9e20406da420bc6f (patch) | |
tree | 4357c9cfe1c92d57ac0a3f90167cade7af505b95 /vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts | |
parent | 302b02a847e7aa8ccf3ff4bc14ff8a9cf67511b0 (diff) | |
parent | 97d9f66df456ef4573047a90baa3cc3ee4bfb0b7 (diff) |
Merge changes Ib4430bf2,Icc0bdb9e,I2736b984
* changes:
Merge from ecomp 718fd196 - Ext. Services Simulator
Merge from ecomp 718fd196 - Integration Tests
Merge from ecomp 718fd196 - Modern UI
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts')
-rw-r--r-- | vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts index 946c5cab5..7df2f3a3f 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts @@ -11,6 +11,7 @@ import * as _ from 'lodash'; import {ErrorMsgService} from "../../../shared/components/error-msg/error-msg.service"; import {DrawingBoardModes} from "../drawing-board.modes"; import {ServiceInstance} from "../../../shared/models/serviceInstance"; +import {FeatureFlagsService, Features} from "../../../shared/services/featureFlag/feature-flags.service"; @Injectable() export class DrawingBoardHeaderService{ @@ -38,7 +39,13 @@ export class DrawingBoardHeaderService{ showAuditInfo(serviceModelId) : void { let instance: ServiceInstance = this.store.getState().service.serviceInstance[serviceModelId]; let model = new ServiceModel(this.store.getState().service.serviceHierarchy[serviceModelId]); - AuditInfoModalComponent.openInstanceAuditInfoModal.next({instanceId : serviceModelId , type : 'SERVICE', model : model , instance : instance, trackById: instance.trackById}); + AuditInfoModalComponent.openInstanceAuditInfoModal.next({instanceId : serviceModelId , type : 'SERVICE', model : model , instance : instance}); + } + + toggleResumeService(serviceModelId, isResume: boolean) : void { + const action: ServiceInstanceActions = isResume ? ServiceInstanceActions.Resume : ServiceInstanceActions.None; + this.store.dispatch(addServiceAction(serviceModelId, action)); + } @@ -49,7 +56,7 @@ export class DrawingBoardHeaderService{ const serviceInstance = this.store.getState().service.serviceInstance[serviceInstanceId]; if(!_.isNil(serviceInstance)){ const validationCounter = serviceInstance.validationCounter; - if (!_.isNil(this.errorMsgService.errorMsgObject)&& mode !== DrawingBoardModes.RETRY_EDIT) return true; + if (!_.isNil(this.errorMsgService.errorMsgObject) && mode !== DrawingBoardModes.RETRY_EDIT) return true; if(validationCounter > 0) return true; if(serviceInstance.action !== ServiceInstanceActions.None) return false; if(mode === DrawingBoardModes.RETRY_EDIT) return false; @@ -83,4 +90,18 @@ export class DrawingBoardHeaderService{ return mode === DrawingBoardModes.CREATE || ((mode === DrawingBoardModes.RETRY_EDIT || mode === DrawingBoardModes.EDIT)&& !_.isNil(serviceInstance) && !_.isNil(serviceInstance[serviceModelId])&& serviceInstance[serviceModelId].action === ServiceInstanceActions.Create); } + + showResumeService(serviceModelId: string): boolean { + const serviceInstance: ServiceInstance = !_.isNil(this.store.getState().service.serviceInstance)? this.store.getState().service.serviceInstance[serviceModelId] : null; + if (serviceInstance) + { + return FeatureFlagsService.getFlagState(Features.FLAG_1908_RESUME_MACRO_SERVICE, this.store) && + serviceInstance.vidNotions.instantiationType.toLowerCase() === "macro" && + serviceInstance.subscriptionServiceType.toLowerCase() !== "transport" && + serviceInstance.orchStatus && + (serviceInstance.orchStatus.toLowerCase() === "assigned" || + serviceInstance.orchStatus.toLowerCase() === "inventoried"); + } + return false; + } } |