Fix instance req and capabilities not updating 59/129459/2
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>
Wed, 1 Jun 2022 17:58:16 +0000 (18:58 +0100)
committerMichael Morris <michael.morris@est.tech>
Tue, 7 Jun 2022 09:10:07 +0000 (09:10 +0000)
Issue-ID: SDC-4030
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Change-Id: I02c61e306087be24fb63b64b6a9c2fa27d52c0e4

catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/req-capabilities-tab/req-capabilities-tab.component.ts

index 7bb88c7..744e56a 100644 (file)
@@ -144,6 +144,10 @@ export class ReqAndCapabilitiesTabComponent implements OnInit, OnDestroy {
 
         // if instance selected, we take the requirement and capabilities of the instance - always exist because we load them with the graph
         if (this.component instanceof FullComponentInstance) {
+            const selectedComponentInstance = this.compositionService.getComponentInstances()
+            .find(componentInstance => componentInstance.uniqueId == this.component.uniqueId);
+            this.component.capabilities = selectedComponentInstance.capabilities;
+            this.component.requirements = selectedComponentInstance.requirements;
             this.store.dispatch(new TogglePanelLoadingAction({isLoading: false}));
             this.setScopeCapabilitiesRequirements(this.component.capabilities, this.component.requirements);
             if (this.component.originType === 'VF') {