Fix UI not displaying directives list correctly 08/129308/2 1.11.3
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>
Wed, 18 May 2022 18:05:09 +0000 (19:05 +0100)
committerKrupa Nagabhushan <krupa.nagabhushan@est.tech>
Wed, 18 May 2022 19:25:03 +0000 (19:25 +0000)
Issue-ID: SDC-4010
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Change-Id: Ie67972b14e973ea0415383732b07cb8c10075638

catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts

index 4d69559..54f9e1f 100644 (file)
@@ -33,6 +33,7 @@ import { TopologyTemplateService } from '../../../services/component-services/to
 import {CapabilitiesFilterPropertiesEditorComponent} from "../../../pages/composition/capabilities-filter-properties-editor/capabilities-filter-properties-editor.component";
 import { CapabilitiesConstraintObjectUI} from "../capabilities-constraint/capabilities-constraint.component";
 import {ToscaFilterConstraintType} from "../../../../models/tosca-filter-constraint-type.enum";
+import {CompositionService} from "../../../pages/composition/composition.service";
 
 export class ConstraintObject {
     servicePropertyName: string;
@@ -159,7 +160,10 @@ export class ServiceDependenciesComponent {
 
     @Input() componentInstanceCapabilitiesMap: Map<string, PropertyModel[]>;
 
-    constructor(private topologyTemplateService: TopologyTemplateService, private modalServiceNg2: ModalService, private translateService: TranslateService) {
+    constructor(private topologyTemplateService: TopologyTemplateService,
+                private modalServiceNg2: ModalService,
+                private translateService: TranslateService,
+                private compositionService: CompositionService) {
     }
 
     ngOnInit() {
@@ -270,6 +274,9 @@ export class ServiceDependenciesComponent {
                                                              this.compositeService.componentType,
                                                              this.currentServiceInstance)
                                                              .subscribe((updatedServiceIns: ComponentInstance) => {
+            const selectedComponentInstance = this.compositionService.getComponentInstances()
+            .find(componentInstance => componentInstance.uniqueId == this.currentServiceInstance.uniqueId);
+            selectedComponentInstance.directives = updatedServiceIns.directives;
             this.currentServiceInstance = new ComponentInstance(updatedServiceIns);
             this.isDependent = this.currentServiceInstance.isDependent();
             this.dependencyStatus.emit(this.isDependent);