summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/components
diff options
context:
space:
mode:
authorMojahidul Islam <mojahidul.islam@amdocs.com>2019-05-14 12:49:31 +0530
committerMojahidul Islam <mojahidul.islam@amdocs.com>2019-05-14 12:50:27 +0530
commit82e531a1ee8ffa30e80b27d9097a2272ae18cdee (patch)
tree900964c5f61e15437e0568f3a5bec3c7083ca5a2 /catalog-ui/src/app/ng2/components
parent3d5b80b9035b9832f86326858b4c6c2cecd952a3 (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/ng2/components')
-rw-r--r--catalog-ui/src/app/ng2/components/logic/service-consumption/service-consumption.component.ts22
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();