From 611c9da62c2e266f9facd97dc9f340ce311060a3 Mon Sep 17 00:00:00 2001 From: asgar Date: Fri, 1 Mar 2019 15:32:47 +0530 Subject: multiple asible servers support multiple asible servers support for CDT Issue-ID: APPC-1510 Change-Id: Id1b1b02274487cfbf6f108a57211a192924a6b08 Signed-off-by: Mohamed Asgar Samiulla --- src/app/shared/pipes/vm-filtering.pipe.ts | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src/app/shared/pipes') diff --git a/src/app/shared/pipes/vm-filtering.pipe.ts b/src/app/shared/pipes/vm-filtering.pipe.ts index c20397b..a036799 100644 --- a/src/app/shared/pipes/vm-filtering.pipe.ts +++ b/src/app/shared/pipes/vm-filtering.pipe.ts @@ -19,19 +19,33 @@ limitations under the License. ECOMP is a trademark and service mark of AT&T Intellectual Property. ============LICENSE_END============================================ */ -import {Pipe, PipeTransform} from '@angular/core'; +import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({name: 'vmFiltering', pure: false}) +@Pipe({ name: 'vmFiltering', pure: false }) export class VmFilteringPipe implements PipeTransform { - transform(value: any, action: any, templateId): any { - + transform(value: any, action: any, templateId, newVnfc): any { + let filterValue + if(action == 'ConfigScaleOut'){ + filterValue= templateId + } else if(action == 'Configure' || action == 'ConfigModify'){ + filterValue= newVnfc + } if (action == 'ConfigScaleOut') { let x = value.filter(obj => { //return value - return obj['template-id'] == templateId; + return obj['template-id'] == filterValue; }); + + return x; + } else if( action == 'Configure' || action == 'ConfigModify'){ + let x = value.filter(obj => { + //return value + return ( obj['vnfcType-id'] == filterValue || obj['vnfcType-id'] == undefined); + }); + + return x; } else { return value; -- cgit 1.2.3-korg