diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-12-04 15:08:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-12-04 15:08:37 +0000 |
commit | ce1a30dd1159eb31c2662cf93daee52c90d272d9 (patch) | |
tree | 295cb8ef4dbce9f89d0bdf89c4a0f4f8cf8daa5a /vid-webpack-master | |
parent | 52add03b07f17c5542bae1db749383cb6d6485d2 (diff) | |
parent | 1df91a571e683fa069a4968954dc7dcc61467145 (diff) |
Merge "Extract subscriber-name only when it is not defined"
Diffstat (limited to 'vid-webpack-master')
2 files changed, 12 insertions, 4 deletions
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/instantiationTemplates/templates__instance_template.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/instantiationTemplates/templates__instance_template.json index d94dbd39d..85f8582ab 100644 --- a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/instantiationTemplates/templates__instance_template.json +++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/instantiationTemplates/templates__instance_template.json @@ -1,5 +1,5 @@ { - "action": "None_Create", + "action": "Create", "instanceName": "vProbe_NC_Service_DG_new_SI", "productFamilyId": null, "lcpCloudRegionId": null, diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.ts index 7923313bf..8228f9531 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.ts @@ -180,7 +180,7 @@ export class DrawingBoardHeader { } } - extractOwningEntityNameAccordingtoId(id:String): string { + extractOwningEntityNameAccordingToId(id:String): string { let owningEntityName; _.forEach(this.store.getState().service.categoryParameters.owningEntityList,(owningEntity: OwningEntity) => { if (owningEntity.id === id) { @@ -190,12 +190,20 @@ export class DrawingBoardHeader { return owningEntityName; } + private extractSubscriberNameByGlobalSubscriberId(globalSubscriberId: string) { + return this.store.getState().service.subscribers.find(sub => sub.id === globalSubscriberId).name; + } + extractServiceFields(): any { let instanceFields : ServiceInstance; instanceFields = this.store.getState().service.serviceInstance[this.serviceModelId]; if (instanceFields.action === ServiceInstanceActions.Create) { - instanceFields.subscriberName = this.store.getState().service.subscribers.find(sub => sub.id === instanceFields.globalSubscriberId).name; - instanceFields.owningEntityName = this.extractOwningEntityNameAccordingtoId(instanceFields.owningEntityId); + if(_.isNil(instanceFields.subscriberName)) { + instanceFields.subscriberName = this.extractSubscriberNameByGlobalSubscriberId(instanceFields.globalSubscriberId); + } + if (_.isNil(instanceFields.owningEntityName)) { + instanceFields.owningEntityName = this.extractOwningEntityNameAccordingToId(instanceFields.owningEntityId); + } } return _.omit(instanceFields,['optionalGroupMembersMap', 'upgradedVFMSonsCounter', 'isUpgraded', 'latestAvailableVersion']); } |