From f3174649f08795cdb04bf8e8e2735408dd91578a Mon Sep 17 00:00:00 2001 From: Alexey Sandler Date: Wed, 25 Dec 2019 16:01:38 +0200 Subject: Convert template summary from json to string. Issue-ID: VID-724 Signed-off-by: Alexey Sandler Change-Id: I02eb17e7e22ee7e12989c8bea6873baa0cefd092 Signed-off-by: Alexey Sandler --- .../instantiation.templates.modal.service.spec.ts | 10 +++++----- .../instantiation.templates.row.model.ts | 9 ++++----- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'vid-webpack-master/src/app/shared/components') diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts index 6540a6551..a17abedfc 100644 --- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts +++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts @@ -56,13 +56,13 @@ describe('instantiation templates modal service', () => { test('convert map to json', () => { let result:InstantiationTemplatesRowModel = new InstantiationTemplatesRowModel({ - "requestSummary": { - "vnf": 2, - "vfModule": 3, - "network": 1 + requestSummary: { + 'vnf': 2, + 'vfModule': 3, + 'network': 1 } }); - expect(result.summary).toEqual( "{\"vnf\":2,\"vfModule\":3,\"network\":1}"); + expect(result.summary).toEqual( "vnf: 2, vfModule: 3, network: 1"); }); diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts index df40da74d..f2eda9df3 100644 --- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts +++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts @@ -45,13 +45,12 @@ export class InstantiationTemplatesRowModel extends InstantiationBase{ return ''; } return instanceName; - } + }; - convertRequestSummaryFromMapToString = (requestSummary): string => { - let myvnf: string = JSON.stringify(requestSummary); - return myvnf; + convertRequestSummaryFromMapToString = (requestSummary: Map): string => { + let values: string[] = _.map(requestSummary, (count: number, instanceType: string) => instanceType + ": " + count); + return _.join(values, ", "); } - } -- cgit 1.2.3-korg