diff options
author | 2019-05-14 12:49:31 +0530 | |
---|---|---|
committer | 2019-05-14 12:50:27 +0530 | |
commit | 82e531a1ee8ffa30e80b27d9097a2272ae18cdee (patch) | |
tree | 900964c5f61e15437e0568f3a5bec3c7083ca5a2 /catalog-ui/src/app/view-models/workspace/tabs/composition | |
parent | 3d5b80b9035b9832f86326858b4c6c2cecd952a3 (diff) |
Support Capability Properties
This change includes following changes
1. Get capability properties from global types- BE
2. Show capability properties in cap/req screen
3. Support Capability Properties in assingment, operation and consumption screens
Change-Id: Ieb4fa5705007c8bed3d82eb4fe4604572aa202d7
Issue-ID: SDC-2294
Signed-off-by: Mojahidul Islam <mojahidul.islam@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/view-models/workspace/tabs/composition')
2 files changed, 24 insertions, 1 deletions
diff --git a/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/service-consumption/service-consumption-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/service-consumption/service-consumption-view-model.ts index 20e99b0d39..737002303b 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/service-consumption/service-consumption-view-model.ts +++ b/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/service-consumption/service-consumption-view-model.ts @@ -16,7 +16,17 @@ import {ICompositionViewModelScope} from "../../composition-view-model"; -import {Service, PropertiesGroup, InputsGroup, ServiceInstanceObject, InterfaceModel, InputBEModel} from 'app/models'; +import { + Service, + PropertiesGroup, + InputsGroup, + ServiceInstanceObject, + InterfaceModel, + InputBEModel, + CapabilitiesGroup, + Capability, + ComponentInstance +} from 'app/models'; import {ComponentGenericResponse} from "app/ng2/services/responses/component-generic-response"; import {ServiceServiceNg2} from "app/ng2/services/component-services/service.service"; @@ -27,6 +37,8 @@ interface IServiceConsumptionViewModelScope extends ICompositionViewModelScope { componentInstancesInputs: InputsGroup; componentInstancesInterfaces: Map<string, Array<InterfaceModel>>; componentInputs: Array<InputBEModel>; + componentCapabilities: Array<Capability>; + instancesCapabilitiesMap: Map<string, Array<Capability>>; } @@ -49,10 +61,20 @@ export class ServiceConsumptionViewModel { this.$scope.componentInstancesInputs = genericResponse.componentInstancesInputs; this.$scope.componentInstancesInterfaces = genericResponse.componentInstancesInterfaces; this.$scope.componentInputs = genericResponse.inputs; + this.buildInstancesCapabilitiesMap(genericResponse.componentInstances); this.updateInstanceAttributes(); }); } + buildInstancesCapabilitiesMap = (componentInstances: Array<ComponentInstance>): void => { + this.$scope.instancesCapabilitiesMap = new Map(); + let flattenCapabilities = []; + _.forEach(componentInstances, componentInstance => { + flattenCapabilities = CapabilitiesGroup.getFlattenedCapabilities(componentInstance.capabilities); + this.$scope.instancesCapabilitiesMap[componentInstance.uniqueId] = _.filter(flattenCapabilities, cap => cap.properties && cap.ownerId === componentInstance.uniqueId); + }); + } + private updateInstanceAttributes = ():void => { if (this.$scope.isComponentInstanceSelected() && this.$scope.componentInstancesProperties) { this.$scope.instancesMappedList = this.$scope.service.componentInstances.map(coInstance => new ServiceInstanceObject({ diff --git a/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/service-consumption/service-consumption-view.html b/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/service-consumption/service-consumption-view.html index 835ded33f6..8404a7f653 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/service-consumption/service-consumption-view.html +++ b/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/service-consumption/service-consumption-view.html @@ -14,6 +14,7 @@ [selected-service-instance-id]="currentComponent.selectedInstance.uniqueId" [instances-mapped-list]="instancesMappedList" [parent-service-inputs]="componentInputs" + [instances-capabilities-map]="instancesCapabilitiesMap" [readonly]="isViewMode() || !isDesigner()"> </ng2-service-consumption> </div> |