From e4ec69b8a8a179bc095f7e62efc9bbfa94017a5b Mon Sep 17 00:00:00 2001 From: Alexey Sandler Date: Mon, 16 Mar 2020 21:47:40 +0200 Subject: set default values in VFM Upgrade popup Issue-ID: VID-794 Signed-off-by: Alexey Sandler Change-Id: Ic8c896e0eea0535e0e52a394c403c2e167240b47 Signed-off-by: Alexey Sandler --- .../vfModuleUpgrade/vfModule.upgrade.popuop.service.ts | 7 ++++--- .../vfModuleUpgrade/vfModule.upgrade.popup.service.spec.ts | 14 +++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'vid-webpack-master/src/app/shared/components/genericFormPopup') diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popuop.service.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popuop.service.ts index 5fcdc3093..afc099c1e 100644 --- a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popuop.service.ts +++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popuop.service.ts @@ -45,8 +45,9 @@ export class VfModuleUpgradePopupService extends VfModulePopupServiceBase { getControls(serviceId: string, vnfStoreKey: string, vfModuleStoreKey: string, isUpdateMode: boolean): FormControlModel[] { let result: FormControlModel[] =[ this.getRetainAssignmentsControl(), - this._sharedControllersService.getSDNCControl(null) + this._sharedControllersService.getSDNCControl(null, true) ]; + const vfModuleInstance :VfModuleInstance = this._vfModuleControlGenerator.getVfModuleInstance(serviceId, vnfStoreKey, this.uuidData, isUpdateMode); let volumeGroupAllowed = this._store.getState().service.serviceHierarchy[serviceId].vfModules[this.uuidData['modelName']].volumeGroupAllowed; @@ -83,7 +84,7 @@ export class VfModuleUpgradePopupService extends VfModulePopupServiceBase { controlName: UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, displayName: 'Retain Volume Groups', dataTestId: UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, - value: true, + value: false, validations: [] }) }; @@ -94,7 +95,7 @@ export class VfModuleUpgradePopupService extends VfModulePopupServiceBase { controlName: UpgradeFormControlNames.RETAIN_ASSIGNMENTS, displayName: 'Retain Assignments', dataTestId: UpgradeFormControlNames.RETAIN_ASSIGNMENTS, - value: true, + value: false, validations: [] }) }; diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popup.service.spec.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popup.service.spec.ts index 2123d6a9f..86ec66652 100644 --- a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popup.service.spec.ts +++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popup.service.spec.ts @@ -133,12 +133,12 @@ describe('VFModule popup service', () => { } } - test('get controls should return retainAssignments control with true value', ()=> { - getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_ASSIGNMENTS, true, true); + test('get controls should return retainAssignments control with false', ()=> { + getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_ASSIGNMENTS, false, true); }); - test('get controls should return retainVolumeGroup control with true value', ()=> { - getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, true, true); + test('get controls should return retainVolumeGroup control with false', ()=> { + getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, false, true); }); [true, false].forEach(notExistsOnModel => { @@ -149,7 +149,7 @@ describe('VFModule popup service', () => { jest.spyOn(_sharedTreeService, 'isVfModuleCustomizationIdNotExistsOnModel').mockReturnValue(notExistsOnModel); - getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, true, notExistsOnModel); + getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, false, notExistsOnModel); }); }); @@ -232,7 +232,7 @@ describe('VFModule popup service', () => { }); - test( 'get controls should return usePreload with false value', () => { - getControlByNameAndCheckValue(SDN_C_PRE_LOAD, false, true); + test( 'get controls should return usePreload with true value', () => { + getControlByNameAndCheckValue(SDN_C_PRE_LOAD, true, true); }); }); -- cgit 1.2.3-korg