summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared
diff options
context:
space:
mode:
authorAlexey Sandler <alexey.sandler@intl.att.com>2019-12-25 16:01:38 +0200
committerAlexey Sandler <alexey.sandler@intl.att.com>2019-12-25 19:02:34 +0200
commitf3174649f08795cdb04bf8e8e2735408dd91578a (patch)
treee799b09c0c969693ee6aeda0a2d363dd97498ae1 /vid-webpack-master/src/app/shared
parentc9a71e231684573c46b6b2b5d7d74dda926d0c91 (diff)
Convert template summary from json to string.
Issue-ID: VID-724 Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com> Change-Id: I02eb17e7e22ee7e12989c8bea6873baa0cefd092 Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Diffstat (limited to 'vid-webpack-master/src/app/shared')
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts10
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts9
-rw-r--r--vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts3
3 files changed, 11 insertions, 11 deletions
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 '<Automatically generated>';
}
return instanceName;
- }
+ };
- convertRequestSummaryFromMapToString = (requestSummary): string => {
- let myvnf: string = JSON.stringify(requestSummary);
- return myvnf;
+ convertRequestSummaryFromMapToString = (requestSummary: Map<string, number>): string => {
+ let values: string[] = _.map(requestSummary, (count: number, instanceType: string) => instanceType + ": " + count);
+ return _.join(values, ", ");
}
-
}
diff --git a/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts b/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts
index 8e47f0c78..c2fa2e662 100644
--- a/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts
+++ b/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts
@@ -35,7 +35,8 @@ export class ServiceInfoModel extends InstantiationBase{
auditUserId: string;
action: ServiceAction;
isRetryEnabled: boolean;
- requestSummary:string;
+ requestSummary: Map<string, number>;
+
}
export class ServiceInfoUiModel extends ServiceInfoModel{