diff options
author | 2020-03-03 16:15:39 +0200 | |
---|---|---|
committer | 2020-03-08 11:43:12 +0200 | |
commit | 742d6d369b761220e565f39f2fa09413141ad93f (patch) | |
tree | c3f48794abab6cedb5d698b75b2fe525a56c7958 /vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts | |
parent | f7c41b1c4aeea09e67c8bb88f39d15e02cd1708f (diff) |
allow platform multi-selection for network
Issue-ID: VID-785
Change-Id: I4e6a4c2f0dc8c0e11f2571eec0789ad5672a9147
Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Diffstat (limited to 'vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts')
-rw-r--r-- | vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts index a7f16db4b..e0418fcfa 100644 --- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts @@ -9,12 +9,11 @@ import * as _ from 'lodash'; import {FormControlModel,} from "../../../../models/formControlModels/formControl.model"; import {LogService} from "../../../../utils/log/log.service"; import {AppState} from "../../../../store/reducers"; -import {DropdownFormControl} from "../../../../models/formControlModels/dropdownFormControl.model"; -import {FormControlType} from "../../../../models/formControlModels/formControlTypes.enum"; import {NetworkInstance} from "../../../../models/networkInstance"; import {NetworkModel} from "../../../../models/networkModel"; import {SharedControllersService} from "../sharedControlles/shared.controllers.service"; + export enum FormControlNames { INSTANCE_NAME = 'instanceName', PRODUCT_FAMILY_ID = 'productFamilyId', @@ -56,6 +55,7 @@ export class NetworkControlGenerator { const networkInstance = this._basicControlGenerator.retrieveInstanceIfUpdateMode(this.store, this.getNetworkInstance(serviceId, networkStoreKey, isUpdateMode)); const networkModel = new NetworkModel(this.store.getState().service.serviceHierarchy[serviceId].networks[networkName]); let result: FormControlModel[] = []; + const flags = this.store.getState().global.flags; if (!_.isNil(networkModel)) { result.push(this.getInstanceName(networkInstance, serviceId, networkName, networkModel.isEcompGeneratedNaming)); @@ -63,7 +63,7 @@ export class NetworkControlGenerator { result.push(this._sharedControllersService.getLcpRegionControl(serviceId, networkInstance, result)); result.push(this._sharedControllersService.getLegacyRegion(networkInstance)); result.push(this._sharedControllersService.getTenantControl(serviceId, networkInstance)); - result.push(this.getPlatformControl(networkInstance)); + result.push(this._sharedControllersService.getPlatformMultiselectControl(networkInstance, result, flags['FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT'])); result.push(this._sharedControllersService.getLineOfBusinessControl(networkInstance)); } return result; @@ -80,6 +80,7 @@ export class NetworkControlGenerator { let result: FormControlModel[] = []; const networkInstance = this._basicControlGenerator.retrieveInstanceIfUpdateMode(this.store, this.getNetworkInstance(serviceId, networkStoreKey, isUpdateMode)); const networkModel = new NetworkModel(this.store.getState().service.serviceHierarchy[serviceId].networks[networkName]); + const flags = this.store.getState().global.flags; if (!_.isNil(networkModel)) { result.push(this.getInstanceName(networkInstance, serviceId, networkName, networkModel.isEcompGeneratedNaming)); @@ -87,7 +88,7 @@ export class NetworkControlGenerator { result.push(this._sharedControllersService.getLcpRegionControl(serviceId, networkInstance, result)); result.push(this._sharedControllersService.getLegacyRegion(networkInstance)); result.push(this._sharedControllersService.getTenantControl(serviceId, networkInstance)); - result.push(this.getPlatformControl(networkInstance)); + result.push(this._sharedControllersService.getPlatformMultiselectControl(networkInstance, result, flags['FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT'])); result.push(this._sharedControllersService.getLineOfBusinessControl(networkInstance)); result.push(this._sharedControllersService.getRollbackOnFailureControl(networkInstance)); } @@ -99,20 +100,4 @@ export class NetworkControlGenerator { const networkModel: NetworkModel = this.store.getState().service.serviceHierarchy[serviceId].networks[networkName]; return this._sharedControllersService.getInstanceNameController(instance, serviceId, isEcompGeneratedNaming, networkModel); } - - getPlatformControl = (instance: any): DropdownFormControl => { - return new DropdownFormControl({ - type: FormControlType.DROPDOWN, - controlName: 'platformName', - displayName: 'Platform', - dataTestId: 'platform', - placeHolder: 'Select Platform', - isDisabled: false, - name: "platform", - value: instance ? instance.platformName : null, - validations: [], - onInitSelectedField: ['platformList'], - onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters) - }) - }; } |