diff options
author | RachithaRamappa93 <rachitha.ramappa@att.com> | 2021-01-27 18:43:58 +0530 |
---|---|---|
committer | Ikram Ikramullah <ikram@research.att.com> | 2021-02-02 20:12:35 +0000 |
commit | 0fcfb59f750894e7be6d087c61672a68ed4679d8 (patch) | |
tree | 12139b118e983bcbbd0ab3d27b82f091c33c2cfa /vid-webpack-master/src | |
parent | 5340236b84bd3289e5f5010158a0f40a4b1edb32 (diff) |
Audit screen corrections from drawing board
Change-Id: Ia1479d18f9af34e39258bd68ae0b14cb52f3fbd0
Issue-ID: VID-945
Signed-off-by: rachitha.ramappa@att.com
Diffstat (limited to 'vid-webpack-master/src')
5 files changed, 54 insertions, 5 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 8cebb23e9..80ce6e055 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 @@ -12,6 +12,7 @@ import {ErrorMsgService} from "../../../shared/components/error-msg/error-msg.se import {DrawingBoardModes} from "../drawing-board.modes"; import {ServiceInstance} from "../../../shared/models/serviceInstance"; import {FeatureFlagsService, Features} from "../../../shared/services/featureFlag/feature-flags.service"; +import {ServiceInfoModel} from "../../../shared/server/serviceInfo/serviceInfo.model"; @Injectable() export class DrawingBoardHeaderService{ @@ -48,7 +49,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}); + let serviceInfoModel: ServiceInfoModel = this.store.getState().service.serviceInfoModel; + console.log("ShowAuditInfo : ServiceInfoModel from drawing-board-header service : ", serviceInfoModel); + if(serviceInfoModel != null || serviceInfoModel != undefined){ + AuditInfoModalComponent.openModal.next(serviceInfoModel); + } else{ + AuditInfoModalComponent.openInstanceAuditInfoModal.next({instanceId : serviceModelId , type : 'SERVICE', model : model , instance : instance}); + } } toggleResumeService(serviceModelId, isResume: boolean) : void { diff --git a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts index 676c3a451..20e93df0d 100644 --- a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts +++ b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts @@ -13,6 +13,7 @@ import {NgRedux} from '@angular-redux/store'; import {JobStatus, ServiceAction} from "../shared/models/serviceInstanceActions"; import {ActivatedRoute} from "@angular/router"; import {FeatureFlagsService, Features} from "../shared/services/featureFlag/feature-flags.service"; +import {updateServiceInfoModel} from "../shared/storeUtil/utils/service/service.actions"; export interface MenuAction{ name: string; @@ -62,7 +63,7 @@ export class InstantiationStatusComponent implements OnInit { name: "Open", dataTestId: "context-menu-open", className: "fa-external-link", - click: (item: ServiceInfoModel) => this.instantiationStatusComponentService.open(item), + click: (item: ServiceInfoModel) => this.openModule(item), enabled: (item: ServiceInfoModel) => this.isOpenEnabled(item), visible: () => true, }, @@ -70,7 +71,7 @@ export class InstantiationStatusComponent implements OnInit { name: "New View/Edit", dataTestId: "context-menu-new-view-edit", className: "fa-pencil", - click: (item: ServiceInfoModel) => this.instantiationStatusComponentService.forwardToNewViewEdit(item), + click: (item: ServiceInfoModel) => this.newViewEdit(item), enabled: () => true, visible: () => this.instantiationStatusComponentService.isNewViewEditVisible(), }, @@ -78,7 +79,7 @@ export class InstantiationStatusComponent implements OnInit { name: "Create another one", dataTestId: "context-menu-create-another-one", className: "fa-clone", - click: (item: ServiceInfoModel) => this.instantiationStatusComponentService.recreate(item), + click: (item: ServiceInfoModel) => this.recreateItem(item), enabled: (item: ServiceInfoModel) => this.instantiationStatusComponentService.isRecreateEnabled(item), visible: () => this.instantiationStatusComponentService.isRecreateVisible(), }, @@ -145,6 +146,11 @@ export class InstantiationStatusComponent implements OnInit { clearInterval(this.timer); } + openModule(item: ServiceInfoModel){ + this._store.dispatch(updateServiceInfoModel(item)); + this.instantiationStatusComponentService.open(item); + } + refreshData(): void { this.dataIsReady = false; this._serviceInfoService.getServicesJobInfo(this.lastUpdatedDate === null) @@ -166,6 +172,7 @@ export class InstantiationStatusComponent implements OnInit { } deleteItem(item: ServiceInfoModel): void { + this._store.dispatch(updateServiceInfoModel(item)); this._serviceInfoService.deleteJob(item.jobId).subscribe(() => { this.refreshData(); }); @@ -178,12 +185,24 @@ export class InstantiationStatusComponent implements OnInit { } retryItem(item: ServiceInfoModel) : void { + this._store.dispatch(updateServiceInfoModel(item)); if (item.isRetryEnabled) { this._instantiationStatusComponentService.retry(item); } } + recreateItem(item: ServiceInfoModel){ + this._store.dispatch(updateServiceInfoModel(item)); + this.instantiationStatusComponentService.recreate(item) + } + + newViewEdit(item: ServiceInfoModel) : void { + this._store.dispatch(updateServiceInfoModel(item)); + this.instantiationStatusComponentService.forwardToNewViewEdit(item) + } + resumeItem(item: ServiceInfoModel) : void { + this._store.dispatch(updateServiceInfoModel(item)); if(item.isRetryEnabled && item.jobStatus === JobStatus.COMPLETED_AND_PAUSED){ this._instantiationStatusComponentService.resume(item); } diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/main.reducer.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/main.reducer.ts index faf4aae4e..a8254b45d 100644 --- a/vid-webpack-master/src/app/shared/storeUtil/utils/main.reducer.ts +++ b/vid-webpack-master/src/app/shared/storeUtil/utils/main.reducer.ts @@ -31,6 +31,7 @@ import {pnfReducer} from "./pnf/pnf.reducers"; export let initialState: ServiceState = { serviceHierarchy: {}, + serviceInfoModel: {}, serviceInstance: {}, lcpRegionsAndTenants: new LcpRegionsAndTenants(), subscribers: null, @@ -44,6 +45,7 @@ export let initialState: ServiceState = { export interface ServiceState { serviceHierarchy: any; + serviceInfoModel: any; serviceInstance: { [uuid: string]: ServiceInstance; }; lcpRegionsAndTenants: LcpRegionsAndTenants; subscribers: SelectOptionInterface[]; diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts index 069ef82e8..20c6dbe85 100644 --- a/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts +++ b/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts @@ -12,6 +12,7 @@ export enum ServiceActions { UNDO_DELETE_ACTION_SERVICE_INSTANCE = "UNDO_DELETE_ACTION_SERVICE_INSTANCE", CHANGE_SERVICE_IS_DIRTY = "CHANGE_SERVICE_IS_DIRTY", UPGRADE_SERVICE_ACTION = "UPGRADE_SERVICE_ACTION", + UPDATE_SERVICE_INFO_MODEL = "UPDATE_SERVICE_INFO_MODEL", UNDO_UPGRADE_SERVICE_ACTION = "UNDO_UPGRADE_SERVICE_ACTION" } @@ -63,6 +64,10 @@ export interface ChangeServiceDirty extends Action { serviceId : string; } +export interface UpdateServiceModelInfoAction extends Action { + serviceInfoModel?: any; +} + export const addServiceAction: ActionCreator<AddServiceAction> = (serviceUuid : string, actionName : ServiceInstanceActions) => ({ type: ServiceActions.ADD_SERVICE_ACTION, serviceUuid: serviceUuid, @@ -117,3 +122,8 @@ export const undoUpgradeService: ActionCreator<UndoUpgradeServiceAction> = (serv type: ServiceActions.UNDO_UPGRADE_SERVICE_ACTION, serviceUuid }); + +export const updateServiceInfoModel : ActionCreator<UpdateServiceModelInfoAction> = (serviceInfoModel : any) => ({ + type: ServiceActions.UPDATE_SERVICE_INFO_MODEL, + serviceInfoModel +}); diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.reducers.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.reducers.ts index 811238385..771dc23c2 100644 --- a/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.reducers.ts +++ b/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.reducers.ts @@ -7,12 +7,14 @@ import { UndoUpgradeServiceAction, UpdateServiceInstanceAction, UpdateServiceModelAction, - UpgradeServiceAction + UpgradeServiceAction, + UpdateServiceModelInfoAction } from "./service.actions"; import {ServiceInstance} from "../../../models/serviceInstance"; import {ServiceState} from "../main.reducer"; import {ServiceInstanceActions} from "../../../models/serviceInstanceActions"; import * as _ from "lodash"; +import {ServiceInfoModel} from "../../../server/serviceInfo/serviceInfo.model"; export function serviceReducer(state: ServiceState, action: Action) : ServiceState{ @@ -98,6 +100,15 @@ export function serviceReducer(state: ServiceState, action: Action) : ServiceSta return undoUpgradeServiceInstance(clonedState, uuid); } } + + case ServiceActions.UPDATE_SERVICE_INFO_MODEL: { + const updateServiceInfoModel = <UpdateServiceModelInfoAction>action; + let newState = _.cloneDeep(state); + const serviceInfoModel : ServiceInfoModel = new ServiceInfoModel(); + const currentServiceInfoModel = state.serviceInfoModel ? serviceInfoModel : null; + newState.serviceInfoModel = Object.assign(serviceInfoModel, updateServiceInfoModel.serviceInfoModel); + return newState + } } } |