summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master
diff options
context:
space:
mode:
authorikram <ikram@research.att.com>2020-07-12 10:06:24 -0400
committerIttay Stern <ittay.stern@att.com>2020-07-20 06:53:18 +0000
commitd2a7755c029d378c531faece1ba44cef48bebae1 (patch)
tree6e9e6e5af9ef288ec5ba9cb3e34f4a6a6be94b41 /vid-webpack-master
parentc8b60b0f9ec5c489df74d34c865446df0ba68c08 (diff)
Add Pause Functionality from Inside VF Module's Edit Dialog
Issue-ID: VID-858 Allow user to choose adding (and removing) Pause points from within the Edit Dialog of the VF Module. Currently, the support of adding is only from the vertical ellipsis menu. Also, there is currently no option of removing the pause point. This functionality will allow this to happen as well since inside the Edit dialog, the option is a checkbox which can now unchecked. Note: removing the pause point from within the vertical ellipse after being added will be covered in a separate user story. However, the desired functionality can still be reached using this commit as describe above. Signed-off-by: ikram <ikram@research.att.com> Change-Id: I90f9933ef445994d410c89e88f6d518a30ff3c60
Diffstat (limited to 'vid-webpack-master')
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/control.generator.util.service.ts1
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts12
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.spec.ts4
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.ts3
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popup.service.ts5
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 = [