diff options
author | Mojahidul Islam <mojahidul.islam@amdocs.com> | 2019-05-13 17:08:25 +0530 |
---|---|---|
committer | Mojahidul Islam <mojahidul.islam@amdocs.com> | 2019-05-13 17:09:02 +0530 |
commit | 0cf08bff1f9b50d227d7047b5fdd7776c667ca25 (patch) | |
tree | 2b3700b5fd02cbedb2f53acddcee96c8249fe04a /catalog-ui/src/app/ng2/components | |
parent | 81f5b9422af04f3287f7c1e0babf355b5251dada (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: I7e21691beedfa8831ecf78c01ed501804f81ec78
Issue-ID: SDC-2295
Signed-off-by: Mojahidul Islam <mojahidul.islam@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/components')
-rw-r--r-- | catalog-ui/src/app/ng2/components/logic/service-consumption/service-consumption.component.ts | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/catalog-ui/src/app/ng2/components/logic/service-consumption/service-consumption.component.ts b/catalog-ui/src/app/ng2/components/logic/service-consumption/service-consumption.component.ts index ef8d63df97..ebcf9eba22 100644 --- a/catalog-ui/src/app/ng2/components/logic/service-consumption/service-consumption.component.ts +++ b/catalog-ui/src/app/ng2/components/logic/service-consumption/service-consumption.component.ts @@ -29,7 +29,9 @@ import { PropertyFEModel, PropertyBEModel, InputBEModel, - InterfaceModel + InterfaceModel, + CapabilitiesGroup, + Capability } from 'app/models'; import {ServiceConsumptionCreatorComponent} from 'app/ng2/pages/service-consumption-editor/service-consumption-editor.component'; @@ -59,6 +61,7 @@ export class ConsumptionInputDetails extends ConsumptionInput { assignValueLabel: string; associatedProps: Array<string>; associatedInterfaces: Array<any>; + associatedCapabilities: Array<Capability>; origVal: string; isValid: boolean; @@ -70,6 +73,7 @@ export class ConsumptionInputDetails extends ConsumptionInput { this.assignValueLabel = input.assignValueLabel; this.associatedProps = input.associatedProps; this.associatedInterfaces = input.associatedInterfaces; + this.associatedCapabilities = input.associatedCapabilities; this.origVal = input.value || ""; this.isValid = input.isValid; } @@ -128,15 +132,18 @@ export class ServiceConsumptionComponent { @Input() selectedService: Service; @Input() selectedServiceInstanceId: string; @Input() instancesMappedList: Array<ServiceInstanceObject>; + @Input() instancesCapabilitiesMap: Map<string, Array<Capability>>; @Input() readonly: boolean; selectedInstanceSiblings: Array<ServiceInstanceObject>; selectedInstancePropertiesList: Array<PropertyBEModel> = []; + selectedInstanceCapabilitisList: Array<Capability> = []; constructor(private ModalServiceNg2: ModalService, private serviceServiceNg2: ServiceServiceNg2, private componentServiceNg2: ComponentServiceNg2, private componentInstanceServiceNg2:ComponentInstanceServiceNg2) {} ngOnInit() { this.updateSelectedInstancePropertiesAndSiblings(); + this.updateSelectedServiceCapabilities(); } ngOnChanges(changes) { @@ -146,9 +153,11 @@ export class ServiceConsumptionComponent { this.selectedService = changes.selectedService.currentValue; } this.updateSelectedInstancePropertiesAndSiblings(); + this.updateSelectedServiceCapabilities(); } if(changes.instancesMappedList && !_.isEqual(changes.instancesMappedList.currentValue, changes.instancesMappedList.previousValue)) { this.updateSelectedInstancePropertiesAndSiblings(); + this.updateSelectedServiceCapabilities(); } } @@ -166,6 +175,13 @@ export class ServiceConsumptionComponent { this.selectedInstanceSiblings = _.filter(this.instancesMappedList, coInstance => coInstance.id !== this.selectedServiceInstanceId); } + updateSelectedServiceCapabilities() { + this.selectedInstanceCapabilitisList = _.filter( + CapabilitiesGroup.getFlattenedCapabilities(this.selectedService.capabilities), + cap => cap.properties && cap.ownerId === this.selectedService.uniqueId + ); + } + expandCollapseInterfaceGroup(currInterface) { currInterface.isExpanded = !currInterface.isExpanded; } @@ -190,7 +206,9 @@ export class ServiceConsumptionComponent { parentServiceInputs: this.parentServiceInputs, selectedServiceProperties: this.selectedInstancePropertiesList, selectedServiceInstanceId: this.selectedServiceInstanceId, - selectedInstanceSiblings: this.selectedInstanceSiblings + selectedInstanceSiblings: this.selectedInstanceSiblings, + selectedInstanceCapabilitisList: this.selectedInstanceCapabilitisList, + siblingsCapabilitiesList: this.instancesCapabilitiesMap } ); this.modalInstance.instance.open(); |