aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/shared
diff options
context:
space:
mode:
authorLiu <yongqiang.liu@nokia-sbell.com>2020-01-27 10:59:12 +0800
committerTaka Cho <takamune.cho@att.com>2020-02-05 09:48:24 -0500
commit700ac8a7ec822f1b7a0505319e4c453ca045d2ed (patch)
tree628c687faf129b6c3f87fe1e6b9b5c11fc2417ac /src/app/shared
parent773f970c50772cddf75f7c7918935315e55d4e2d (diff)
add new action configscalein for cdt
Change-Id: I2f05079b7c2428351332ac84c1ea56f31d4a38d9 Issue-ID: APPC-1760 Signed-off-by: Taka Cho <takamune.cho@att.com>
Diffstat (limited to 'src/app/shared')
-rw-r--r--src/app/shared/pipes/vm-filtering.pipe.spec.ts10
-rw-r--r--src/app/shared/pipes/vm-filtering.pipe.ts4
2 files changed, 12 insertions, 2 deletions
diff --git a/src/app/shared/pipes/vm-filtering.pipe.spec.ts b/src/app/shared/pipes/vm-filtering.pipe.spec.ts
index 9c544cb..08df4de 100644
--- a/src/app/shared/pipes/vm-filtering.pipe.spec.ts
+++ b/src/app/shared/pipes/vm-filtering.pipe.spec.ts
@@ -38,6 +38,16 @@ describe('VmFilteringPipe', () => {
expect(pipe.transform(objArray,"ConfigScaleOut",1, {})[0].type,).toBe("conScale")
});
+ it('should return configscalein values if template id matches',()=>{
+ const pipe = new VmFilteringPipe();
+
+ let objArray = [
+ {action:"Configure","template-id":2,"type":"con"},
+ {action:"ConfigScaleIn","template-id":1,"type":"conScale"}
+ ]
+ expect(pipe.transform(objArray,"ConfigScaleIn",1, {})[0].type,).toBe("conScale")
+
+ });
it('should return configure calues',()=>{
const pipe = new VmFilteringPipe();
diff --git a/src/app/shared/pipes/vm-filtering.pipe.ts b/src/app/shared/pipes/vm-filtering.pipe.ts
index 6da7840..4c49eb3 100644
--- a/src/app/shared/pipes/vm-filtering.pipe.ts
+++ b/src/app/shared/pipes/vm-filtering.pipe.ts
@@ -25,12 +25,12 @@ export class VmFilteringPipe implements PipeTransform {
transform(value: any, action: any, templateId, newVnfc): any {
let filterValue
- if(action == 'ConfigScaleOut'){
+ if(action == 'ConfigScaleOut' || action == 'ConfigScaleIn'){
filterValue= templateId
} else if(action == 'Configure' || action == 'ConfigModify' || action == 'DistributeTraffic' || action == 'DistributeTrafficCheck'){
filterValue= newVnfc
}
- if (action == 'ConfigScaleOut') {
+ if (action == 'ConfigScaleOut' || action == 'ConfigScaleIn') {
let x = value.filter(obj => {
//return value
return obj['template-id'] == filterValue;