diff options
Diffstat (limited to 'vid-webpack-master')
5 files changed, 19 insertions, 6 deletions
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/control.generator.util.service.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/control.generator.util.service.ts index 08575bcad..bcbcefa8d 100644 --- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/control.generator.util.service.ts +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/control.generator.util.service.ts @@ -24,6 +24,7 @@ import * as _ from 'lodash'; export const SUPPLEMENTARY_FILE = 'supplementaryFile'; export const SDN_C_PRE_LOAD = 'sdncPreLoad'; +export const PAUSE_INSTANTIATION = 'pauseInstantiation'; @Injectable() export class ControlGeneratorUtil { diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts index b10ed9a75..c238f90a4 100644 --- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts @@ -9,7 +9,7 @@ import { import {NgRedux} from "@angular-redux/store"; import {AppState} from "../../../../store/reducers"; import {AaiService} from "../../../../services/aaiService/aai.service"; -import {ControlGeneratorUtil, SDN_C_PRE_LOAD} from "../control.generator.util.service"; +import {ControlGeneratorUtil, PAUSE_INSTANTIATION, SDN_C_PRE_LOAD} from "../control.generator.util.service"; import * as _ from "lodash"; import {FormGroup} from "@angular/forms"; import {Constants} from "../../../../utils/constants"; @@ -18,6 +18,7 @@ import {InputFormControl} from "../../../../models/formControlModels/inputFormCo import {NodeModel} from "../../../../models/nodeModel"; import {MultiselectFormControl} from "../../../../models/formControlModels/multiselectFormControl.model"; import {MultiSelectItem} from "../../../formControls/component/multiselect/multiselect.model"; +import {PauseStatus} from "../../../../models/serviceInstanceActions"; @Injectable() export class SharedControllersService { @@ -132,6 +133,15 @@ export class SharedControllersService { }) }; + getPauseInstantiation = (instance: any) : FormControlModel => { + return new CheckboxFormControl({ + controlName: PAUSE_INSTANTIATION, + displayName: 'Pause upon Completion', + dataTestId: 'pauseInstantiation', + value: instance && instance.pauseInstantiation === PauseStatus.AFTER_COMPLETION + }) + } + getProductFamilyControl = (instance : any, controls : FormControlModel[], isMandatory?: boolean) : DropdownFormControl => { return new DropdownFormControl({ type : FormControlType.DROPDOWN, diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.spec.ts index 154c60f9e..bbfde30d8 100644 --- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.spec.ts +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.spec.ts @@ -1080,8 +1080,8 @@ describe('VFModule Control Generator', () => { }); each([ - [true, 4, formControlsWithoutLcpRegionTenantLegacy], - [false, 7,formControlsWithLcpRegionTenantLegacy] + [true, 5, formControlsWithoutLcpRegionTenantLegacy], + [false, 8,formControlsWithLcpRegionTenantLegacy] ]). test('getAlaCarteFormControls should return the correct order of controls', (flag: boolean, controlAmount: number, orderedControls: string[]) => { when(mockFeatureFlagsService.getFlagState(Features.FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF)).thenReturn(flag); diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.ts index b7cf80be3..8c6af89da 100644 --- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.ts +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.ts @@ -24,6 +24,7 @@ import {MessageModal} from "../../../messageModal/message-modal.service"; import {ButtonType} from "../../../customModal/models/button.type"; import {SharedTreeService} from "../../../../../drawingBoard/service-planning/objectsToTree/shared.tree.service"; import {FeatureFlagsService, Features} from "../../../../services/featureFlag/feature-flags.service"; +import {PauseStatus} from "../../../../models/serviceInstanceActions"; export enum FormControlNames { INSTANCE_NAME = 'instanceName', @@ -122,7 +123,6 @@ export class VfModuleControlGenerator { } const vnf: VnfInstance = this.store.getState().service.serviceInstance[serviceId].vnfs[vnfStoreKey]; const vnfModel = this.newVNFModel(serviceId, vnf); - const vfModuleInstance = this._basicControlGenerator.retrieveInstanceIfUpdateMode(this.store, this.getVfModuleInstance(serviceId, vnfStoreKey, uuidData, isUpdateMode)); let result: FormControlModel[] = []; this.pushInstanceAndVGToForm(result, vfModuleInstance, serviceId, vnfModel, true); @@ -133,6 +133,7 @@ export class VfModuleControlGenerator { } result.push(this._sharedControllersService.getRollbackOnFailureControl(vfModuleInstance)); result.push(this._sharedControllersService.getSDNCControl(vfModuleInstance, false, this.getSdncExtraContents())); + result.push(this._sharedControllersService.getPauseInstantiation(vfModuleInstance)); if (this.store.getState().global.flags['FLAG_SUPPLEMENTARY_FILE']) { result = this._basicControlGenerator.concatSupplementaryFile(result, vfModuleInstance); } diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popup.service.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popup.service.ts index 6bf593462..70b23f23b 100644 --- a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popup.service.ts +++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popup.service.ts @@ -22,6 +22,7 @@ import * as _ from 'lodash'; import {createVFModuleInstance, updateVFModuleInstance} from "../../../../storeUtil/utils/vfModule/vfModule.actions"; import {SharedControllersService} from "../../../genericForm/formControlsServices/sharedControlles/shared.controllers.service"; import {SharedTreeService} from "../../../../../drawingBoard/service-planning/objectsToTree/shared.tree.service"; +import {PauseStatus} from "../../../../models/serviceInstanceActions"; export abstract class VfModulePopupServiceBase { dynamicInputs: any; @@ -33,10 +34,11 @@ export abstract class VfModulePopupServiceBase { closeDialogEvent: Subject<any> = new Subject<any>(); isUpdateMode: boolean; storeVFModule = (that, formValues: any): void => { + formValues.pauseInstantiation = (formValues.pauseInstantiation || formValues.pauseInstantiation === PauseStatus.AFTER_COMPLETION) + ? PauseStatus.AFTER_COMPLETION : null; formValues.modelInfo = new ModelInfo(that.model); formValues.uuid = formValues.modelInfo.uuid; formValues.isMissingData = false; - if (!that.uuidData.vFModuleStoreKey) { this._store.dispatch(createVFModuleInstance(formValues, that.uuidData.modelName, that.uuidData.serviceId, 0, that.uuidData.vnfStoreKey)); } else { @@ -67,7 +69,6 @@ export abstract class VfModulePopupServiceBase { getModelInformation(serviceId: string, modelName: string, vfModuleModeNode:ITreeNode) { this._aaiService.getServiceModelById(serviceId).subscribe((result: any) => { this.serviceModel = new ServiceModel(result); - this.model = this._basicPopupService.getModelFromResponse(result, 'vfModules', modelName); const serviceInstance = this._store.getState().service.serviceInstance[serviceId]; this.modelInformations = [ |