diff options
author | Einat Vinouze <einat.vinouze@intl.att.com> | 2020-03-12 10:46:51 +0200 |
---|---|---|
committer | Einat Vinouze <einat.vinouze@intl.att.com> | 2020-03-16 09:55:42 +0200 |
commit | 1c55c3023fb2d4108d17ae02577e74665dcae9ff (patch) | |
tree | eb537ad4c49a73cc1f089af3b9a3a44e489b2c00 /vid-webpack-master | |
parent | 572d023b1eaddafca6d407eaf3f5fc3aadbcec7e (diff) |
allow LOB multi-selection for network - add FF
Issue-ID: VID-788
Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Change-Id: I5358252a336730697bca3486c461f23354c823c0
Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Diffstat (limited to 'vid-webpack-master')
-rw-r--r-- | vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts | 46 |
1 files changed, 37 insertions, 9 deletions
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 c41c6c282..97c5516db 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 @@ -48,7 +48,7 @@ export class SharedControllersService { return this.getLineOfBusinessControlInternal(changeLcpRegionOptionsOnChange, instance); }; - private getLineOfBusinessControlInternal = (onChange: Function, instance?: any): DropdownFormControl => { + private getLineOfBusinessControlInternal = (onChange: Function, instance?: any): DropdownFormControl => { return new DropdownFormControl({ type: FormControlType.DROPDOWN, controlName: 'lineOfBusiness', @@ -288,23 +288,51 @@ export class SharedControllersService { } getPlatformMultiselectControl = (instance: any, controls: FormControlModel[], isMultiSelected: boolean) : MultiselectFormControl => { + return this.getMultiSelectFormControl( + 'platformName', + 'Platform', + 'multi-selectPlatform', + 'Select Platform', + "platform", + instance, + instance ? instance.platformName : null, + isMultiSelected, + 'platformList' + ); + }; + + getLobMultiselectControl = (instance: any, controls: FormControlModel[], isMultiSelected: boolean) : MultiselectFormControl => { + return this.getMultiSelectFormControl( + 'lineOfBusiness', + 'Line of business', + 'multi-lineOfBusiness', + 'Select Line Of Business', + "lineOfBusiness", + instance, + instance ? instance.lineOfBusiness : null, + isMultiSelected, + 'lineOfBusinessList'); + }; + + private getMultiSelectFormControl(controlName: string, displayName: string, dataTestId: string, placeholder: string, + name: string, instance: any, defaultValue, isMultiSelected: boolean, catagoryParamResponseFieldName: string) { return new MultiselectFormControl({ type: FormControlType.MULTI_SELECT, - controlName: 'platformName', - displayName: 'Platform', - dataTestId: 'multi-selectPlatform', + controlName, + displayName, + dataTestId, selectedFieldName: 'name', ngValue: 'name', - placeHolder: 'Select Platform', + placeHolder: placeholder, isDisabled: false, - name: "platform", - value: instance ? instance.platformName : '', + name: name, + value: instance ? defaultValue : '', limitSelection: isMultiSelected ? 1000 : 1, validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], - onInitSelectedField: ['platformList'], + onInitSelectedField: [catagoryParamResponseFieldName], onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters), onChange: (param: MultiSelectItem[], form: FormGroup) => { - form.controls['platformName'].setValue(param.map((multiSelectItem: MultiSelectItem) => { + form.controls[controlName].setValue(param.map((multiSelectItem: MultiSelectItem) => { return multiSelectItem.itemName }).join(',')); }, |