diff options
Diffstat (limited to 'vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts')
-rw-r--r-- | vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts index ffc2e681a..4bfedd913 100644 --- a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts +++ b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts @@ -12,6 +12,7 @@ import {updateDrawingBoardStatus} from "../shared/storeUtil/utils/global/global. import {Router, UrlTree} from "@angular/router"; import {of} from "rxjs"; import {MsoService} from "../shared/services/msoService/mso.service"; +import {ServiceAction} from "../shared/models/serviceInstanceActions"; export let PENDING : string = "pending"; export let INPROGRESS : string = "in_progress"; @@ -28,7 +29,8 @@ export class InstantiationStatusComponentService { constructor( private _aaiService: AaiService, private _msoService: MsoService, private _router : Router, - private _store: NgRedux<AppState>) { + private _store: NgRedux<AppState>, + private _featureFlagsService:FeatureFlagsService) { } generateServiceInfoDataMapping(arr: ServiceInfoModel[]) : { [serviceInstanceId: string]: ServiceInfoModel[]}{ @@ -69,7 +71,7 @@ export class InstantiationStatusComponentService { } open(item: ServiceInfoModel): void { - if (FeatureFlagsService.getFlagState(Features.FLAG_1902_VNF_GROUPING, this._store)) { + if (this._featureFlagsService.getFlagState(Features.FLAG_1902_VNF_GROUPING)) { this._aaiService.getServiceModelById(item['serviceModelId']).subscribe((result)=>{ const serviceModel = new ServiceModel(result); @@ -91,7 +93,7 @@ export class InstantiationStatusComponentService { } navigateToNewViewOnlyOrOldEditView(item: ServiceInfoModel) { - if (FeatureFlagsService.getFlagState(Features.FLAG_1902_NEW_VIEW_EDIT, this._store)) { + if (this._featureFlagsService.getFlagState(Features.FLAG_1902_NEW_VIEW_EDIT)) { this.navigateToNewViewEdit(item, DrawingBoardModes.VIEW); } else { @@ -122,19 +124,31 @@ export class InstantiationStatusComponentService { ['/servicePlanning/' + mode], { queryParams: - { - serviceModelId: item.serviceModelId, - serviceInstanceId: item.serviceInstanceId, - serviceType : item.serviceType, - subscriberId : item.subscriberId, - jobId: item.jobId - } + mode==DrawingBoardModes.RECREATE ? + this.getRecreateQueryParams(item) : + this.getDefaultViewEditQueryParams(item) }); } + private getDefaultViewEditQueryParams(item: ServiceInfoModel) { + return { + serviceModelId: item.serviceModelId, + serviceInstanceId: item.serviceInstanceId, + serviceType: item.serviceType, + subscriberId: item.subscriberId, + jobId: item.jobId + }; + } + + private getRecreateQueryParams(item: ServiceInfoModel) { + return { + serviceModelId: item.serviceModelId, + jobId: item.jobId + }; + } + getViewEditUrl(viewEditUrlTree:UrlTree): string { return '../../serviceModels.htm#' + viewEditUrlTree.toString(); - } getStatus(status : string) : ServiceStatus { @@ -162,6 +176,18 @@ export class InstantiationStatusComponentService { retry(item: ServiceInfoModel): void { this.navigateToNewViewEdit(item, DrawingBoardModes.RETRY_EDIT); } + + recreate(item: ServiceInfoModel): void { + this.navigateToNewViewEdit(item, DrawingBoardModes.RECREATE); + } + + isRecreateEnabled(item: ServiceInfoModel): boolean { + return item.action === ServiceAction.INSTANTIATE; + } + + isRecreateVisible(): boolean { + return this._featureFlagsService.getFlagState(Features.FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE); + } } |