diff options
author | 2023-07-04 14:45:53 +0100 | |
---|---|---|
committer | 2023-10-11 14:22:03 +0000 | |
commit | 0d9d05e705a6fbc9c4370fdd3a8ad543d04f8210 (patch) | |
tree | 92031d3d2bd92288686fb4c156cbbe02e64389ab /catalog-ui/src/app/ng2/pages/composition | |
parent | 98513d2be1f1c5f0fba48a972dea297b784aec68 (diff) |
No properties found when trying to add a node filter to a VF
Issue-ID: SDC-4607
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Change-Id: I5df11e156f4bc20ff1d4f19b7af8dfe798631077
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/composition')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/service-dependencies-tab/service-dependencies-tab.component.ts | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/service-dependencies-tab/service-dependencies-tab.component.ts b/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/service-dependencies-tab/service-dependencies-tab.component.ts index 7ca4604004..ace5a18f22 100644 --- a/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/service-dependencies-tab/service-dependencies-tab.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/service-dependencies-tab/service-dependencies-tab.component.ts @@ -26,13 +26,15 @@ import { Component as TopologyTemplate, FullComponentInstance, PropertiesGroup, - PropertyBEModel, PropertyModel, + PropertyBEModel, PropertyModel, ComponentInstance, } from 'app/models'; +import {ResourceType} from "app/utils"; import {DEPENDENCY_EVENTS} from 'app/utils/constants'; import {ComponentMetadata} from '../../../../../../models/component-metadata'; import {ServiceInstanceObject} from '../../../../../../models/service-instance-properties-and-interfaces'; import {EventListenerService} from '../../../../../../services/event-listener-service'; import {TopologyTemplateService} from '../../../../../services/component-services/topology-template.service'; +import {ComponentInstanceServiceNg2} from '../../../../../services/component-instance-services/component-instance.service'; import {ComponentGenericResponse} from '../../../../../services/responses/component-generic-response'; import {WorkspaceService} from '../../../../workspace/workspace.service'; import {SelectedComponentType} from '../../../common/store/graph.actions'; @@ -63,6 +65,7 @@ export class ServiceDependenciesTabComponent implements OnInit { constructor(private store: Store, private topologyTemplateService: TopologyTemplateService, + private componentInstanceServiceNg2: ComponentInstanceServiceNg2, private workspaceService: WorkspaceService, private compositionService: CompositionService, private eventListenerService: EventListenerService) { @@ -98,10 +101,22 @@ export class ServiceDependenciesTabComponent implements OnInit { } private initInstancesWithProperties = (): void => { - this.topologyTemplateService.getComponentInstanceProperties(this.metaData.componentType, this.metaData.uniqueId).subscribe((genericResponse: ComponentGenericResponse) => { - this.componentInstanceProperties = genericResponse.componentInstancesProperties; - this.updateInstanceAttributes(); - }); + if (this.component instanceof FullComponentInstance && this.isInput(this.component.resourceType)) { + this.componentInstanceServiceNg2 + .getComponentInstanceInputsByIdAndType(this.metaData.uniqueId, this.metaData.componentType, this.component as ComponentInstance) + .subscribe(response => { + this.selectedInstanceProperties = response; + }); + } else { + this.topologyTemplateService.getComponentInstanceProperties(this.metaData.componentType, this.metaData.uniqueId).subscribe((genericResponse: ComponentGenericResponse) => { + this.componentInstanceProperties = genericResponse.componentInstancesProperties; + this.updateInstanceAttributes(); + }); + } + } + + private isInput = (instanceType:string):boolean =>{ + return instanceType === ResourceType.VF || instanceType === ResourceType.PNF || instanceType === ResourceType.CVFC || instanceType === ResourceType.CR; } private updateInstanceAttributes = (): void => { |