Make Service base type optional
[sdc.git] / catalog-ui / src / app / ng2 / pages / composition / panel / composition-panel.component.ts
index 6ed73b3..3422cc1 100644 (file)
@@ -264,7 +264,7 @@ export class CompositionPanelComponent {
             this.tabs.push(tabs.apiArtifacts);
         }
 
-        if((component.isService() || this.isVF()) && !this.isComponentInstanceSelected()){
+        if (this.showSubstitutionFilterTab(component)) {
             this.tabs.push(tabs.substitutionFilter);
         }
 
@@ -279,6 +279,17 @@ export class CompositionPanelComponent {
 
     }
 
+    private showSubstitutionFilterTab(component): boolean {
+        if ((component.isService() || this.isVF()) && !this.isComponentInstanceSelected()) {
+            if (component.isService()) {
+                return (<Service>component).isSubstituteCandidate();
+            }
+            return true;
+        }
+
+        return false;
+    }
+
     private toggleSidebarDisplay = () => {
         // this.withSidebar = !this.withSidebar;
         this.store.dispatch(new OnSidebarOpenOrCloseAction());